[PATCH] D13087: A fix for loop vectorizer with handling loops with volatile induction variables

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 18:16:29 PST 2015


hfinkel added inline comments.

================
Comment at: include/llvm/Transforms/Utils/Local.h:139
@@ -137,3 +138,3 @@
 /// the basic block that was pointed to.
 ///
 bool SimplifyCFG(BasicBlock *BB, const TargetTransformInfo &TTI,
----------------
Please note in the comment that LoopHeaders is an optional input parameter, providing the set of loop header that SimplyCFG should not eliminate.

================
Comment at: include/llvm/Transforms/Utils/Local.h:142
@@ -141,1 +141,3 @@
+            unsigned BonusInstThreshold, AssumptionCache *AC = nullptr, 
+            SmallPtrSet<BasicBlock*, 16> * LoopHeaders = nullptr);
 
----------------
You can use SmallPtrSetImpl<BasicBlock *> here, instead of SmallPtrSet<BasicBlock *, 16>, to avoid encoding a particular size on the interface boundary.

================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:138
@@ +137,3 @@
+                unsigned BonusInstThreshold, AssumptionCache *AC, 
+                SmallPtrSet<BasicBlock*, 16> * LoopHeaders)
+      : TTI(TTI), DL(DL), BonusInstThreshold(BonusInstThreshold), 
----------------
Corresponding SmallPtrSetImpl change here.

================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:4624
@@ +4623,3 @@
+  // (This is for early invocations before loop simplify and vectorization
+  // to keep canonical loop forms for loops with volatile induction variables.
+  // These blocks can be eliminated when the pass is invoked later 
----------------
loops with volatile induction variables -> nested loops

(the problem is much more general than loops with volatile induction variables)

================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:4892
@@ -4879,1 +4891,3 @@
+                      unsigned BonusInstThreshold, AssumptionCache *AC, 
+                      SmallPtrSet<BasicBlock*, 16> * LoopHeaders) {
   return SimplifyCFGOpt(TTI, BB->getModule()->getDataLayout(),
----------------
Corresponding SmallPtrSetImpl change.


Repository:
  rL LLVM

http://reviews.llvm.org/D13087





More information about the llvm-commits mailing list