Move break-crit-edges before the predicate simplifier. Allows us to
optimize in more cases. llvm-svn: 30699
This commit is contained in:
parent
ff510a58c2
commit
755f801adc
|
|
@ -500,8 +500,10 @@ bool PredicateSimplifier::runOnFunction(Function &F) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PredicateSimplifier::getAnalysisUsage(AnalysisUsage &AU) const {
|
void PredicateSimplifier::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||||
|
AU.addRequiredID(BreakCriticalEdgesID);
|
||||||
AU.addRequired<DominatorTree>();
|
AU.addRequired<DominatorTree>();
|
||||||
AU.setPreservesCFG();
|
AU.setPreservesCFG();
|
||||||
|
AU.addPreservedID(BreakCriticalEdgesID);
|
||||||
}
|
}
|
||||||
|
|
||||||
// resolve catches cases addProperty won't because it wasn't used as a
|
// resolve catches cases addProperty won't because it wasn't used as a
|
||||||
|
|
@ -622,13 +624,7 @@ void PredicateSimplifier::proceedToSuccessor(TerminatorInst *TI,
|
||||||
PropertySet &NextPS) {
|
PropertySet &NextPS) {
|
||||||
assert(edge < TI->getNumSuccessors() && "Invalid index for edge.");
|
assert(edge < TI->getNumSuccessors() && "Invalid index for edge.");
|
||||||
|
|
||||||
BasicBlock *BB = TI->getParent(),
|
visitBasicBlock(TI->getSuccessor(edge), NextPS);
|
||||||
*BBNext = TI->getSuccessor(edge);
|
|
||||||
|
|
||||||
if (BBNext->getSinglePredecessor() == BB)
|
|
||||||
visitBasicBlock(BBNext, NextPS);
|
|
||||||
else
|
|
||||||
visitBasicBlock(BBNext, CurrentPS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PredicateSimplifier::proceedToSuccessors(PropertySet &KP,
|
void PredicateSimplifier::proceedToSuccessors(PropertySet &KP,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
; RUN: llvm-as < %s | opt -predsimplify | llvm-dis | grep br | grep bb8 | grep cond_true$ | grep false
|
; RUN: llvm-as < %s | opt -predsimplify | llvm-dis | grep br | grep return.i.bb8_crit_edge | grep false
|
||||||
|
|
||||||
%str = external global [4 x sbyte] ; <[4 x sbyte]*> [#uses=1]
|
%str = external global [4 x sbyte] ; <[4 x sbyte]*> [#uses=1]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue