aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Scalar/LoopDistribute.cpp
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2015-07-28 05:01:53 +0000
committerAdam Nemet <anemet@apple.com>2015-07-28 05:01:53 +0000
commit0a674401bf6c2a1e2ef46ac377c2ea4b8118d446 (patch)
tree8f7100a23e82c7df08cd31b390e47b0992eaa7bd /llvm/lib/Transforms/Scalar/LoopDistribute.cpp
parent70bd288534d90addd8a6d19e01a19c069b59df34 (diff)
downloadllvm-0a674401bf6c2a1e2ef46ac377c2ea4b8118d446.zip
llvm-0a674401bf6c2a1e2ef46ac377c2ea4b8118d446.tar.gz
llvm-0a674401bf6c2a1e2ef46ac377c2ea4b8118d446.tar.bz2
[LDist][LVer] Explicitly pass the set of memchecks to LoopVersioning, NFC
Before the patch, the checks were generated internally in addRuntimeCheck. Now, we use the new overloaded version of addRuntimeCheck that takes the ready-made set of checks as a parameter. The checks are now generated by the client (LoopDistribution) with the new RuntimePointerChecking::generateChecks API. Also the new printChecks API is used to print out the checks for debugging. This is to continue the transition over to the new model whereby clients will get the full set of checks from LAA, filter it and then pass it to LoopVersioning and in turn to addRuntimeCheck. llvm-svn: 243382
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopDistribute.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopDistribute.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopDistribute.cpp b/llvm/lib/Transforms/Scalar/LoopDistribute.cpp
index 96ac582..5ad4a45 100644
--- a/llvm/lib/Transforms/Scalar/LoopDistribute.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopDistribute.cpp
@@ -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);
}