[PATCH] Handle cast instructions in complete loop unroll heuristic.
Chandler Carruth
chandlerc at gmail.com
Thu Jun 4 17:21:03 PDT 2015
No test case here? Is this covered by the tests in http://reviews.llvm.org/D10208?
================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:430-434
@@ +429,7 @@
+ return true;
+ // If we've already visited the operand and found a base pointer for it, we
+ // can't const-fold it other than when used in a load.
+ if (auto *Op0 = dyn_cast<Instruction>(I.getOperand(0)))
+ if (GEPPointerBases.lookup(Op0))
+ return false;
+
----------------
I think the need for this will go away when offsets aren't (incorrectly) marked as needed in SimplifiedValues. See my comments is D10205.
================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:436
@@ +435,3 @@
+
+ // Propagate constants through ptrtoint.
+ Constant *COp = dyn_cast<Constant>(I.getOperand(0));
----------------
This doesn't seem to be specific to ptrtoint. =]
http://reviews.llvm.org/D10207
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list