mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
fix a bug where we unswitched the wrong way
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26225 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
18a8452f3d
commit
f17c42d409
@ -197,9 +197,9 @@ static bool IsTrivialUnswitchCondition(Loop *L, Value *Cond,
|
||||
// side-effects. If so, determine the value of Cond that causes it to do
|
||||
// this.
|
||||
if ((LoopExitBB = isTrivialLoopExitBlock(L, BI->getSuccessor(0)))) {
|
||||
if (Val) *Val = ConstantBool::True;
|
||||
} else if ((LoopExitBB = isTrivialLoopExitBlock(L, BI->getSuccessor(1)))) {
|
||||
if (Val) *Val = ConstantBool::False;
|
||||
} else if ((LoopExitBB = isTrivialLoopExitBlock(L, BI->getSuccessor(1)))) {
|
||||
if (Val) *Val = ConstantBool::True;
|
||||
}
|
||||
} else if (SwitchInst *SI = dyn_cast<SwitchInst>(HeaderTerm)) {
|
||||
// If this isn't a switch on Cond, we can't handle it.
|
||||
|
Loading…
Reference in New Issue
Block a user