[LDist][LVer] Explicitly pass the set of memchecks to LoopVersioning, NFC
[oota-llvm.git] / lib / Transforms / Scalar / LoopDistribute.cpp
index 96ac582525dbcd103510f4a5c6e85d25eacadfc0..5ad4a454ce446767756661246629c9d3aeab5d36 100644 (file)
@@ -747,10 +747,12 @@ private:
     // If we need run-time checks to disambiguate pointers are run-time, version
     // the loop now.
     auto PtrToPartition = Partitions.computePartitionSetForPointers(LAI);
-    LoopVersioning LVer(LAI, L, LI, DT, &PtrToPartition);
-    if (LVer.needsRuntimeChecks()) {
+    auto Checks =
+        LAI.getRuntimePointerChecking()->generateChecks(&PtrToPartition);
+    if (!Checks.empty()) {
       DEBUG(dbgs() << "\nPointers:\n");
-      DEBUG(LAI.getRuntimePointerChecking()->print(dbgs(), 0, &PtrToPartition));
+      DEBUG(LAI.getRuntimePointerChecking()->printChecks(dbgs(), Checks));
+      LoopVersioning LVer(std::move(Checks), LAI, L, LI, DT);
       LVer.versionLoop(this);
       LVer.addPHINodes(DefsUsedOutside);
     }