[PATCH] D12494: New IR pass: LoopExitValues

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 02:44:21 PDT 2015


hfinkel added a subscriber: hfinkel.

================
Comment at: lib/CodeGen/Passes.cpp:411
@@ +410,3 @@
+	if (PrintLoopExitValues)
+	  addPass(createPrintFunctionPass(dbgs(), "\n\n*** Code after Loop Exit Values Optimization **\n"));
+  }
----------------
Fix indenting.

================
Comment at: lib/Transforms/Scalar/LoopExitValues.cpp:1
@@ +1,2 @@
+//===- LoopStrengthReduce.cpp - Strength Reduce IVs in Loops --------------===//
+//
----------------
Stale header comment.

================
Comment at: lib/Transforms/Scalar/LoopExitValues.cpp:149
@@ +148,3 @@
+    for (Instruction *Cand : iter->second) {
+      if (not DT.properlyDominates(Cand->getParent(), I->getParent()))
+        continue;
----------------
not -> ! [to match our general conventions]

================
Comment at: lib/Transforms/Scalar/LoopExitValues.cpp:154
@@ +153,3 @@
+      Instruction *NewInstr = Cand;
+      if (NewInstr->getType() != I->getType()) {
+        // If either instruction is a bitcast, that's ok, just insert a
----------------
You should do the type-based validity checking prior to calling DT.dominates (which is going to be significantly more expensive).

Also, when do the types not match? Can getSCEVAtScope return an SCEV with a different type than its argument?



Repository:
  rL LLVM

http://reviews.llvm.org/D12494





More information about the llvm-commits mailing list