[PATCH] D36656: [SCCP] Propagate integer range information in IPSCCP (WIP).

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 14 12:32:25 PDT 2017


efriedma added a comment.

Should we use range/nonnull metadata or assumptions to generate ranges?

Should IPSCCP itself try to fold operations based on ranges?

Inserting a bunch of "llvm.assume" calls is probably not a good idea; it's likely to be a big performance sink, and block other optimizations.  (Not sure what the right answer looks like here, though; it's a hard problem.)



================
Comment at: lib/Transforms/Scalar/SCCP.cpp:129
+    if (getLatticeValue() == constant) {
+      auto *C = dyn_cast<ConstantInt>(getConstant());
+      return (C->isNegative() ? (-1) : 1) * C->getLimitedValue();
----------------
cast<>, not dyn_cast<>


================
Comment at: lib/Transforms/Scalar/SCCP.cpp:1641
-        // Hey, we just changed something!
-        MadeChanges = true;
         ++NumInstRemoved;
----------------
?


https://reviews.llvm.org/D36656





More information about the llvm-commits mailing list