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/LazyBranchProbabilityInfo.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/LazyBranchProbabilityInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/LazyBranchProbabilityInfo.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LazyBranchProbabilityInfo.cpp b/llvm/lib/Analysis/LazyBranchProbabilityInfo.cpp index e2884d0a456..429b78c3a47 100644 --- a/llvm/lib/Analysis/LazyBranchProbabilityInfo.cpp +++ b/llvm/lib/Analysis/LazyBranchProbabilityInfo.cpp @@ -17,6 +17,7 @@ #include "llvm/Analysis/LazyBranchProbabilityInfo.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/TargetLibraryInfo.h" +#include "llvm/IR/Dominators.h" using namespace llvm; @@ -42,6 +43,10 @@ void LazyBranchProbabilityInfoPass::print(raw_ostream &OS, } void LazyBranchProbabilityInfoPass::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(); |