<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Nov 20, 2014 at 6:38 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><span class=""><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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div 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></span>Uh, this doesn't seem like it has much to do with SROA?</div></div>
</blockquote></div><br></div><div class="gmail_extra">Sorry about that, I saw it go by as the commit hit the server.  It was reverted in r222500.</div></div>