[PATCH] [Reassociate] Better preserve NSW/NUW flags. (PR12985)

David Majnemer david.majnemer at gmail.com
Fri Nov 7 14:15:48 PST 2014


LGTM with tweaks.

================
Comment at: lib/Transforms/Scalar/Reassociate.cpp:1045
@@ +1044,3 @@
+  if (NUW && NSW)
+    Mul->setHasNoSignedWrap(NSW);
+  Mul->setHasNoUnsignedWrap(NUW);
----------------
This can just be `Mul->setHasNoSignedWrap(true);`

http://reviews.llvm.org/D6172






More information about the llvm-commits mailing list