mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-02 09:33:59 +00:00
Do jump table adjustment before constant island allocation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86857 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cdc06ba5df
commit
f4997e87e3
@ -294,6 +294,11 @@ bool ARMConstantIslands::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
// sizes of each block, the location of all the water, and finding all of the
|
// sizes of each block, the location of all the water, and finding all of the
|
||||||
// constant pool users.
|
// constant pool users.
|
||||||
InitialFunctionScan(MF, CPEMIs);
|
InitialFunctionScan(MF, CPEMIs);
|
||||||
|
|
||||||
|
bool MadeChange = false;
|
||||||
|
if (isThumb2)
|
||||||
|
MadeChange |= OptimizeThumb2JumpTables(MF);
|
||||||
|
|
||||||
CPEMIs.clear();
|
CPEMIs.clear();
|
||||||
|
|
||||||
/// Remove dead constant pool entries.
|
/// Remove dead constant pool entries.
|
||||||
@ -301,7 +306,6 @@ bool ARMConstantIslands::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
|
|
||||||
// Iteratively place constant pool entries and fix up branches until there
|
// Iteratively place constant pool entries and fix up branches until there
|
||||||
// is no change.
|
// is no change.
|
||||||
bool MadeChange = false;
|
|
||||||
unsigned NoCPIters = 0, NoBRIters = 0;
|
unsigned NoCPIters = 0, NoBRIters = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
bool CPChange = false;
|
bool CPChange = false;
|
||||||
@ -1476,7 +1480,6 @@ bool ARMConstantIslands::OptimizeThumb2Instructions(MachineFunction &MF) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MadeChange |= OptimizeThumb2Branches(MF);
|
MadeChange |= OptimizeThumb2Branches(MF);
|
||||||
MadeChange |= OptimizeThumb2JumpTables(MF);
|
|
||||||
return MadeChange;
|
return MadeChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1722,8 +1725,8 @@ AdjustJTTargetBlockForward(MachineBasicBlock *BB, MachineBasicBlock *JTBB)
|
|||||||
JTBB->addSuccessor(NewBB);
|
JTBB->addSuccessor(NewBB);
|
||||||
|
|
||||||
// Update internal data structures to account for the newly inserted MBB.
|
// Update internal data structures to account for the newly inserted MBB.
|
||||||
// This is almost the same as UpdateForInsertedWaterBlock, except that
|
// Don't mark the new block as having water following it, as we want the
|
||||||
// the Water goes after OrigBB, not NewBB.
|
// blocks following the jump table to be as close together as possible.
|
||||||
MF.RenumberBlocks(NewBB);
|
MF.RenumberBlocks(NewBB);
|
||||||
|
|
||||||
// Insert a size into BBSizes to align it properly with the (newly
|
// Insert a size into BBSizes to align it properly with the (newly
|
||||||
|
Loading…
x
Reference in New Issue
Block a user