[PATCH] D14240: Allow Loop Distribute and the loop versioning infrastructure to use SCEV predicates

silviu.baranga@arm.com via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 5 08:13:38 PST 2015


sbaranga added inline comments.

================
Comment at: lib/Transforms/Utils/LoopVersioning.cpp:26-38
@@ -24,11 +25,15 @@
 using namespace llvm;
 
-LoopVersioning::LoopVersioning(
-    SmallVector<RuntimePointerChecking::PointerCheck, 4> Checks,
-    const LoopAccessInfo &LAI, Loop *L, LoopInfo *LI, DominatorTree *DT)
-    : VersionedLoop(L), NonVersionedLoop(nullptr), Checks(std::move(Checks)),
-      LAI(LAI), LI(LI), DT(DT) {
+LoopVersioning::LoopVersioning(const LoopAccessInfo &LAI, Loop *L, LoopInfo *LI,
+                               DominatorTree *DT, ScalarEvolution *SE,
+                               bool UseLAIChecks)
+    : VersionedLoop(L), NonVersionedLoop(nullptr), LAI(LAI), LI(LI), DT(DT),
+      SE(SE) {
   assert(L->getExitBlock() && "No single exit block");
   assert(L->getLoopPreheader() && "No preheader");
+  if (UseLAIChecks) {
+    addAliasChecks(LAI.getRuntimePointerChecking()->getChecks());
+    addSCEVChecks(LAI.Preds);
+  }
 }
 
----------------
Removing the Checks parameter made the two constructors have identical arguments. Since we want to be able to construct with all the changes from the LAI, I've added a bool parameter to enable this.


http://reviews.llvm.org/D14240





More information about the llvm-commits mailing list