From 2ca16899ecb723ed035402772d7ab32b9e0425a8 Mon Sep 17 00:00:00 2001 From: Mikael Holmen Date: Thu, 17 May 2018 09:05:40 +0000 Subject: 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 --- llvm/lib/Analysis/LazyBranchProbabilityInfo.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/Analysis/LazyBranchProbabilityInfo.cpp') 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(); AU.addRequired(); AU.addRequired(); AU.setPreservesAll(); -- cgit v1.2.3