mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
MBlaze delay slot filler was not capable of using ADDK and variants to fill delay slots. This broke several test cases when 121649 was committed. This fixes the regression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121650 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a7c7b9dccb
commit
8f40b24ca1
@ -167,6 +167,23 @@ static bool isDelayFiller(MachineBasicBlock &MBB,
|
||||
return (brdesc.hasDelaySlot());
|
||||
}
|
||||
|
||||
static bool hasUnknownSideEffects(MachineBasicBlock::iterator &I,
|
||||
TargetInstrDesc &desc) {
|
||||
if (!desc.hasUnmodeledSideEffects())
|
||||
return false;
|
||||
|
||||
unsigned op = I->getOpcode();
|
||||
if (op == MBlaze::ADDK || op == MBlaze::ADDIK ||
|
||||
op == MBlaze::ADDC || op == MBlaze::ADDIC ||
|
||||
op == MBlaze::ADDKC || op == MBlaze::ADDIKC ||
|
||||
op == MBlaze::RSUBK || op == MBlaze::RSUBIK ||
|
||||
op == MBlaze::RSUBC || op == MBlaze::RSUBIC ||
|
||||
op == MBlaze::RSUBKC || op == MBlaze::RSUBIKC)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static MachineBasicBlock::iterator
|
||||
findDelayInstr(MachineBasicBlock &MBB,MachineBasicBlock::iterator slot) {
|
||||
MachineBasicBlock::iterator I = slot;
|
||||
@ -178,7 +195,7 @@ findDelayInstr(MachineBasicBlock &MBB,MachineBasicBlock::iterator slot) {
|
||||
TargetInstrDesc desc = I->getDesc();
|
||||
if (desc.hasDelaySlot() || desc.isBranch() || isDelayFiller(MBB,I) ||
|
||||
desc.isCall() || desc.isReturn() || desc.isBarrier() ||
|
||||
desc.hasUnmodeledSideEffects())
|
||||
hasUnknownSideEffects(I,desc))
|
||||
break;
|
||||
|
||||
if (hasImmInstruction(I) || delayHasHazard(I,slot))
|
||||
|
Loading…
Reference in New Issue
Block a user