mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
eliminate gotos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21780 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1f243e9f43
commit
989f6229bc
@ -365,7 +365,6 @@ void Reassociate::OptimizeExpression(unsigned Opcode,
|
|||||||
std::vector<ValueEntry> &Ops) {
|
std::vector<ValueEntry> &Ops) {
|
||||||
// Now that we have the linearized expression tree, try to optimize it.
|
// Now that we have the linearized expression tree, try to optimize it.
|
||||||
// Start by folding any constants that we found.
|
// Start by folding any constants that we found.
|
||||||
Iterate:
|
|
||||||
bool IterateOptimization = false;
|
bool IterateOptimization = false;
|
||||||
if (Ops.size() == 1) return;
|
if (Ops.size() == 1) return;
|
||||||
|
|
||||||
@ -373,7 +372,8 @@ Iterate:
|
|||||||
if (Constant *V2 = dyn_cast<Constant>(Ops.back().Op)) {
|
if (Constant *V2 = dyn_cast<Constant>(Ops.back().Op)) {
|
||||||
Ops.pop_back();
|
Ops.pop_back();
|
||||||
Ops.back().Op = ConstantExpr::get(Opcode, V1, V2);
|
Ops.back().Op = ConstantExpr::get(Opcode, V1, V2);
|
||||||
goto Iterate;
|
OptimizeExpression(Opcode, Ops);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for destructive annihilation due to a constant being used.
|
// Check for destructive annihilation due to a constant being used.
|
||||||
@ -494,7 +494,8 @@ Iterate:
|
|||||||
//case Instruction::Mul:
|
//case Instruction::Mul:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IterateOptimization) goto Iterate;
|
if (IterateOptimization)
|
||||||
|
OptimizeExpression(Opcode, Ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user