[PATCH] D13685: [SCEV] Commute sign extends through nsw additions

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 16:20:52 PDT 2015


sanjoy added inline comments.

================
Comment at: lib/Analysis/ScalarEvolution.cpp:1635-1637
@@ +1634,5 @@
+
+    if (SA->getNoWrapFlags(SCEV::FlagNSW)) {
+      // If the addition does not sign overflow then we can, by definition,
+      // commute the sign extension with the addition operation.
+      SmallVector<const SCEV *, 4> Ops;
----------------
nlewycky wrote:
> Any reason not to do this with zext and nuw?
No specific reason; we've only run into the `sext` case so far.  If you think that it'll be good for symmetry, I can add a separate change for `nuw` by next week.


http://reviews.llvm.org/D13685





More information about the llvm-commits mailing list