diff options
author | Cong Hou <congh@google.com> | 2015-07-15 22:48:29 +0000 |
---|---|---|
committer | Cong Hou <congh@google.com> | 2015-07-15 22:48:29 +0000 |
commit | ab23bfbc0e12c77ab41daa392981e8bcb367930f (patch) | |
tree | b440893c4c3f1856735bbe406847b79effbedf76 /llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp | |
parent | 3f6994b3c7d7996c88a158fb229b3ac07e53c938 (diff) | |
download | bcm5719-llvm-ab23bfbc0e12c77ab41daa392981e8bcb367930f.tar.gz bcm5719-llvm-ab23bfbc0e12c77ab41daa392981e8bcb367930f.zip |
Create a wrapper pass for BranchProbabilityInfo.
This new wrapper pass is useful when we want to do branch probability analysis conditionally (e.g. only in PGO mode) but don't want to add one more pass dependence.
http://reviews.llvm.org/D11241
llvm-svn: 242349
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp index cbdacad8f28..08fdcc38c04 100644 --- a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp +++ b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp @@ -215,7 +215,7 @@ public: AU.addRequiredID(LoopSimplifyID); AU.addRequiredID(LCSSAID); AU.addRequired<ScalarEvolution>(); - AU.addRequired<BranchProbabilityInfo>(); + AU.addRequired<BranchProbabilityInfoWrapperPass>(); } bool runOnLoop(Loop *L, LPPassManager &LPM) override; @@ -1400,7 +1400,8 @@ bool InductiveRangeCheckElimination::runOnLoop(Loop *L, LPPassManager &LPM) { InductiveRangeCheck::AllocatorTy IRCAlloc; SmallVector<InductiveRangeCheck *, 16> RangeChecks; ScalarEvolution &SE = getAnalysis<ScalarEvolution>(); - BranchProbabilityInfo &BPI = getAnalysis<BranchProbabilityInfo>(); + BranchProbabilityInfo &BPI = + getAnalysis<BranchProbabilityInfoWrapperPass>().getBPI(); for (auto BBI : L->getBlocks()) if (BranchInst *TBI = dyn_cast<BranchInst>(BBI->getTerminator())) |