diff options
author | Mikael Holmen <mikael.holmen@ericsson.com> | 2018-05-17 09:05:40 +0000 |
---|---|---|
committer | Mikael Holmen <mikael.holmen@ericsson.com> | 2018-05-17 09:05:40 +0000 |
commit | 2ca16899ecb723ed035402772d7ab32b9e0425a8 (patch) | |
tree | afe74f5748e47650a2983bd31ee839da1e37ff3f /llvm/lib/Analysis/BranchProbabilityInfo.cpp | |
parent | b48d65ca757f8d7199b6a7825cb100b95c5d9781 (diff) | |
download | bcm5719-llvm-2ca16899ecb723ed035402772d7ab32b9e0425a8.tar.gz bcm5719-llvm-2ca16899ecb723ed035402772d7ab32b9e0425a8.zip |
Require DominatorTree when requiring/preserving LoopInfo in the old pass manager
Summary:
Require DominatorTree when requiring/preserving LoopInfo in the old pass manager
BreakCriticalEdges tries to keep LoopInfo and DominatorTree updated if they
exist. However, since commit r321653 and r321805, to update LoopInfo we
must have a DominatorTree, or we will hit an assert.
To fix this we now make a couple of passes that only required/preserved
LoopInfo also require DominatorTree.
This solves PR37334.
Reviewers: eli.friedman, efriedma
Reviewed By: efriedma
Subscribers: efriedma, llvm-commits
Differential Revision: https://reviews.llvm.org/D46829
llvm-svn: 332583
Diffstat (limited to 'llvm/lib/Analysis/BranchProbabilityInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/BranchProbabilityInfo.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/BranchProbabilityInfo.cpp b/llvm/lib/Analysis/BranchProbabilityInfo.cpp index 7299ef45ff5..ed4dc9031ab 100644 --- a/llvm/lib/Analysis/BranchProbabilityInfo.cpp +++ b/llvm/lib/Analysis/BranchProbabilityInfo.cpp @@ -22,6 +22,7 @@ #include "llvm/IR/BasicBlock.h" #include "llvm/IR/CFG.h" #include "llvm/IR/Constants.h" +#include "llvm/IR/Dominators.h" #include "llvm/IR/Function.h" #include "llvm/IR/InstrTypes.h" #include "llvm/IR/Instruction.h" @@ -1001,6 +1002,10 @@ void BranchProbabilityInfo::calculate(const Function &F, const LoopInfo &LI, void BranchProbabilityInfoWrapperPass::getAnalysisUsage( AnalysisUsage &AU) const { + // We require DT so it's available when LI is available. The LI updating code + // asserts that DT is also present so if we don't make sure that we have DT + // here, that assert will trigger. + AU.addRequired<DominatorTreeWrapperPass>(); AU.addRequired<LoopInfoWrapperPass>(); AU.addRequired<TargetLibraryInfoWrapperPass>(); AU.setPreservesAll(); |