<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 20, 2014 at 6:34 PM, David Majnemer <span dir="ltr"><<a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":2cf" class="a3s" style="overflow:hidden">Modified: llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp?rev=222499&r1=222498&r2=222499&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp?rev=222499&r1=222498&r2=222499&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Thu Nov 20 20:34:55 2014<br>
@@ -394,6 +394,13 @@ static BinaryOperator *LowerNegateToMult<br>
BinaryOperator *Res = CreateMul(Neg->getOperand(1), NegOne, "", Neg, Neg);<br>
Neg->setOperand(1, Constant::getNullValue(Ty)); // Drop use of op.<br>
Res->takeName(Neg);<br>
+ if (Ty->isIntegerTy()) {<br>
+ bool NSW = cast<BinaryOperator>(Neg)->hasNoSignedWrap();<br>
+ bool NUW = cast<BinaryOperator>(Neg)->hasNoUnsignedWrap();<br>
+ if (NSW || NUW)<br>
+ Res->setHasNoSignedWrap(true);<br>
+ Res->setHasNoUnsignedWrap(NUW);<br>
+ }</div></blockquote></div><br>Uh, this doesn't seem like it has much to do with SROA?</div></div>