mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-18 13:34:04 +00:00
Revert part of r147716. Looks like x87 instructions kill markers are all messed
up so branch folding pass can't use the scavenger. :-( This doesn't breaks anything currently. It just means targets which do not carefully update kill markers cannot run post-ra scheduler (not new, it has always been the case). We should fix this at some point since it's really hacky. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147719 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
acdb4aaf9b
commit
70017fb01b
@ -180,7 +180,7 @@ bool BranchFolder::OptimizeFunction(MachineFunction &MF,
|
|||||||
TRI = tri;
|
TRI = tri;
|
||||||
MMI = mmi;
|
MMI = mmi;
|
||||||
|
|
||||||
RS = new RegScavenger();
|
RS = TRI->requiresRegisterScavenging(MF) ? new RegScavenger() : NULL;
|
||||||
|
|
||||||
// Fix CFG. The later algorithms expect it to be right.
|
// Fix CFG. The later algorithms expect it to be right.
|
||||||
bool MadeChange = false;
|
bool MadeChange = false;
|
||||||
@ -368,14 +368,16 @@ static unsigned ComputeCommonTailLength(MachineBasicBlock *MBB1,
|
|||||||
|
|
||||||
void BranchFolder::MaintainLiveIns(MachineBasicBlock *CurMBB,
|
void BranchFolder::MaintainLiveIns(MachineBasicBlock *CurMBB,
|
||||||
MachineBasicBlock *NewMBB) {
|
MachineBasicBlock *NewMBB) {
|
||||||
RS->enterBasicBlock(CurMBB);
|
if (RS) {
|
||||||
if (!CurMBB->empty())
|
RS->enterBasicBlock(CurMBB);
|
||||||
RS->forward(prior(CurMBB->end()));
|
if (!CurMBB->empty())
|
||||||
BitVector RegsLiveAtExit(TRI->getNumRegs());
|
RS->forward(prior(CurMBB->end()));
|
||||||
RS->getRegsUsed(RegsLiveAtExit, false);
|
BitVector RegsLiveAtExit(TRI->getNumRegs());
|
||||||
for (unsigned int i = 0, e = TRI->getNumRegs(); i != e; i++)
|
RS->getRegsUsed(RegsLiveAtExit, false);
|
||||||
if (RegsLiveAtExit[i])
|
for (unsigned int i = 0, e = TRI->getNumRegs(); i != e; i++)
|
||||||
NewMBB->addLiveIn(i);
|
if (RegsLiveAtExit[i])
|
||||||
|
NewMBB->addLiveIn(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ReplaceTailWithBranchTo - Delete the instruction OldInst and everything
|
/// ReplaceTailWithBranchTo - Delete the instruction OldInst and everything
|
||||||
|
Loading…
x
Reference in New Issue
Block a user