mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-11 21:38:46 +00:00
Analyze has to be before checking the condition, obviously. Properly construct an iterator for prior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88917 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1546b11140
commit
ca215e7804
@ -1772,13 +1772,15 @@ AdjustJTTargetBlockForward(MachineBasicBlock *BB, MachineBasicBlock *JTBB)
|
|||||||
int Size = BBSizes[BBI];
|
int Size = BBSizes[BBI];
|
||||||
MachineBasicBlock *TBB = 0, *FBB = 0;
|
MachineBasicBlock *TBB = 0, *FBB = 0;
|
||||||
SmallVector<MachineOperand, 4> Cond;
|
SmallVector<MachineOperand, 4> Cond;
|
||||||
// If the block is small and ends in an unconditional branch, move it.
|
|
||||||
if (Size < 50 && Cond.empty()) {
|
|
||||||
// If the block terminator isn't analyzable, don't try to move the block
|
// If the block terminator isn't analyzable, don't try to move the block
|
||||||
if (TII->AnalyzeBranch(*BB, TBB, FBB, Cond))
|
if (TII->AnalyzeBranch(*BB, TBB, FBB, Cond))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
MachineFunction::iterator OldPrior = prior(BB);
|
// If the block is small and ends in an unconditional branch, move it.
|
||||||
|
if (Size < 50 && Cond.empty() && BB != MF.begin()) {
|
||||||
|
MachineFunction::iterator BBi = BB;
|
||||||
|
MachineFunction::iterator OldPrior = prior(BBi);
|
||||||
BB->moveAfter(JTBB);
|
BB->moveAfter(JTBB);
|
||||||
OldPrior->updateTerminator();
|
OldPrior->updateTerminator();
|
||||||
BB->updateTerminator();
|
BB->updateTerminator();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user