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

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 9 11:24:25 PDT 2017


davide accepted this revision.
davide added a comment.

Minors, otherwise, looks good. Feel free to submit once you addressed them without another round of review.



================
Comment at: lib/Transforms/Scalar/SCCP.cpp:28
 #include "llvm/Analysis/ConstantFolding.h"
+#include "llvm/Analysis/ValueLattice.h"
 #include "llvm/Analysis/GlobalsModRef.h"
----------------
Unsorted.


================
Comment at: lib/Transforms/Scalar/SCCP.cpp:1602
+    for (auto &Use : V->uses()) {
+      if (auto *Icmp = dyn_cast<ICmpInst>(Use.getUser())) {
+        auto A = Solver.getLatticeValueFor(Icmp->getOperand(0));
----------------
If would be nicer if you broke earlier to reduced the indentation, but, I mean, I/you can probably clean this up as a follow up.


================
Comment at: lib/Transforms/Scalar/SCCP.cpp:1608
+          C = ConstantInt::getTrue(Icmp->getType());
+        else if(A.satisfiesPredicate(Icmp->getInversePredicate(), B))
+          C = ConstantInt::getFalse(Icmp->getType());
----------------
unformatted.


================
Comment at: lib/Transforms/Scalar/SCCP.cpp:1646
+    if (IV.isConstantRange()) {
+      if(IV.getConstantRange().isSingleElement())
+        Const = ConstantInt::get(V->getType(),
----------------
can you please clang format?


https://reviews.llvm.org/D36656





More information about the llvm-commits mailing list