diff options
author | Sean Silva <chisophugis@gmail.com> | 2016-07-23 04:22:50 +0000 |
---|---|---|
committer | Sean Silva <chisophugis@gmail.com> | 2016-07-23 04:22:50 +0000 |
commit | ab6a6837651fa39124d41ec1484d360b47efa989 (patch) | |
tree | ff91117f0c5cc331b0d8a8ec7e64e7ebbbe7459e /llvm/lib/Transforms/Utils/InlineFunction.cpp | |
parent | c6b9be29f270e6adc0922cb6e9be000f7102b663 (diff) | |
download | llvm-ab6a6837651fa39124d41ec1484d360b47efa989.zip llvm-ab6a6837651fa39124d41ec1484d360b47efa989.tar.gz llvm-ab6a6837651fa39124d41ec1484d360b47efa989.tar.bz2 |
Avoid using a raw AssumptionCacheTracker in various inliner functions.
This unblocks the new PM part of River's patch in
https://reviews.llvm.org/D22706
Conveniently, this same change was needed for D21921 and so these
changes are just spun out from there.
llvm-svn: 276515
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 1fbb19d..e101412 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -1078,7 +1078,7 @@ static void AddAlignmentAssumptions(CallSite CS, InlineFunctionInfo &IFI) { // caller, then don't bother inserting the assumption. Value *Arg = CS.getArgument(I->getArgNo()); if (getKnownAlignment(Arg, DL, CS.getInstruction(), - &IFI.ACT->getAssumptionCache(*CS.getCaller()), + &(*IFI.GetAssumptionCache)(*CS.getCaller()), &DT) >= Align) continue; @@ -1199,7 +1199,7 @@ static Value *HandleByValArgument(Value *Arg, Instruction *TheCall, // If the pointer is already known to be sufficiently aligned, or if we can // round it up to a larger alignment, then we don't need a temporary. if (getOrEnforceKnownAlignment(Arg, ByValAlignment, DL, TheCall, - &IFI.ACT->getAssumptionCache(*Caller)) >= + &(*IFI.GetAssumptionCache)(*Caller)) >= ByValAlignment) return Arg; @@ -1604,8 +1604,8 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI, // FIXME: We could register any cloned assumptions instead of clearing the // whole function's cache. - if (IFI.ACT) - IFI.ACT->getAssumptionCache(*Caller).clear(); + if (IFI.GetAssumptionCache) + (*IFI.GetAssumptionCache)(*Caller).clear(); } // If there are any alloca instructions in the block that used to be the entry @@ -2125,7 +2125,7 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI, if (PHI) { auto &DL = Caller->getParent()->getDataLayout(); if (Value *V = SimplifyInstruction(PHI, DL, nullptr, nullptr, - &IFI.ACT->getAssumptionCache(*Caller))) { + &(*IFI.GetAssumptionCache)(*Caller))) { PHI->replaceAllUsesWith(V); PHI->eraseFromParent(); } |