[PATCH] IndVarSimplify: Don't let LFTR compare against a poison value

hfinkel at anl.gov hfinkel at anl.gov
Wed Sep 3 10:47:23 PDT 2014


================
Comment at: lib/Transforms/Scalar/IndVarSimplify.cpp:1652
@@ +1651,3 @@
+    // don't want to compare against a poison value.
+    if (ScalarEvolution::maskFlags(IncrementedIndvarSCEV->getNoWrapFlags(),
+                                   SCEV::FlagNUW | SCEV::FlagNSW) ==
----------------
I'm not 100% sure this is right. I think that IncrementedIndvarSCEV->getNoWrapFlags() will return only the deduced flags (the ones that SCEV can independently prove), and that could be different from the set of flags on the instruction itself. It might be better to test the flags on IncrementedIndvar itself (but, then again, I could just be wrong).

http://reviews.llvm.org/D5174






More information about the llvm-commits mailing list