mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Move break-crit-edges before the predicate simplifier. Allows us to
optimize in more cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30699 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
99435d32b3
commit
5c8c5d9ace
@ -500,8 +500,10 @@ bool PredicateSimplifier::runOnFunction(Function &F) {
|
||||
}
|
||||
|
||||
void PredicateSimplifier::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AU.addRequiredID(BreakCriticalEdgesID);
|
||||
AU.addRequired<DominatorTree>();
|
||||
AU.setPreservesCFG();
|
||||
AU.addPreservedID(BreakCriticalEdgesID);
|
||||
}
|
||||
|
||||
// resolve catches cases addProperty won't because it wasn't used as a
|
||||
@ -622,13 +624,7 @@ void PredicateSimplifier::proceedToSuccessor(TerminatorInst *TI,
|
||||
PropertySet &NextPS) {
|
||||
assert(edge < TI->getNumSuccessors() && "Invalid index for edge.");
|
||||
|
||||
BasicBlock *BB = TI->getParent(),
|
||||
*BBNext = TI->getSuccessor(edge);
|
||||
|
||||
if (BBNext->getSinglePredecessor() == BB)
|
||||
visitBasicBlock(BBNext, NextPS);
|
||||
else
|
||||
visitBasicBlock(BBNext, CurrentPS);
|
||||
visitBasicBlock(TI->getSuccessor(edge), NextPS);
|
||||
}
|
||||
|
||||
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]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user