[llvm-commits] PATCH: Preserving the 'nsw' flag in the instruction combiner.

Pranav Bhandarkar pranavb at codeaurora.org
Thu Aug 11 00:59:36 PDT 2011


Hi Nick,

>>How about:
>>
>>
>>   bool NSW = MaintainNoSignedWrap(I, B, C);
>>   I.clearSubclassOptionalData();
>>   I.setHasNoSignedWrap(NSW);

I have incorporated all of your suggestions except this one above. The
reason is that MaintainNoSignedWrap() checks if I is an
OverflowingBinaryOperator and therefore a call to setHasNoSignedWrap()
should be gated with a call to MaintainNoSignedWrap(). Not doing so causes
an assert inside setHasNoSignedWrap to fail.

I have attached the revised patch here. Please do verify if it is fit to be
committed.

Thanks for your comments.
Pranav

Qualcomm Innovation Center, Inc is a member of Code Aurora Forum.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: MaintainNoSignedWrapPatch_Integrated_1.txt
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110811/94b89a2c/attachment.txt>


More information about the llvm-commits mailing list