aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopVersioning.cpp
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2015-08-12 16:51:19 +0000
committerAdam Nemet <anemet@apple.com>2015-08-12 16:51:19 +0000
commitdfaeb33ec7dcef6389fa70af5d68006585ac8c65 (patch)
tree0b00dca9d44f62af0c0f54018d8555ad67446c3a /llvm/lib/Transforms/Utils/LoopVersioning.cpp
parenteb2bd9a2699188bdc25f19631497bee77f0c5949 (diff)
downloadllvm-dfaeb33ec7dcef6389fa70af5d68006585ac8c65.zip
llvm-dfaeb33ec7dcef6389fa70af5d68006585ac8c65.tar.gz
llvm-dfaeb33ec7dcef6389fa70af5d68006585ac8c65.tar.bz2
[LoopVer] Optionally allow using memchecks from LAA
r243382 changed the behavior to always require a set of memchecks to be passed to LoopVer. This change restores the prior behavior as an alternative to the new behavior. This allows the checks to be implicitly taken from the LAA object. Patch by Ashutosh Nema! llvm-svn: 244763
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopVersioning.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopVersioning.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopVersioning.cpp b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
index 4d2b1ee..ad2de24 100644
--- a/llvm/lib/Transforms/Utils/LoopVersioning.cpp
+++ b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
@@ -31,6 +31,15 @@ LoopVersioning::LoopVersioning(
assert(L->getLoopPreheader() && "No preheader");
}
+LoopVersioning::LoopVersioning(const LoopAccessInfo &LAInfo, Loop *L,
+ LoopInfo *LI, DominatorTree *DT)
+ : VersionedLoop(L), NonVersionedLoop(nullptr),
+ Checks(LAInfo.getRuntimePointerChecking()->getChecks()), LAI(LAInfo),
+ LI(LI), DT(DT) {
+ assert(L->getExitBlock() && "No single exit block");
+ assert(L->getLoopPreheader() && "No preheader");
+}
+
void LoopVersioning::versionLoop(Pass *P) {
Instruction *FirstCheckInst;
Instruction *MemRuntimeCheck;