[Sparc] LEON erratum fix - Delay Slot Filler modification.

This code should have been with the previous check-in (r270417) and prevents the DelaySlotFiller pass being utilized in functions where the erratum fix has been applied as this will break the run-time code.

llvm-svn: 270418
This commit is contained in:
Chris Dewhurst 2016-05-23 11:52:28 +00:00
parent 4f7cac3674
commit 6bc3e13133
1 changed files with 9 additions and 0 deletions

View File

@ -273,6 +273,15 @@ bool Filler::delayHasHazard(MachineBasicBlock::iterator candidate,
return true;
}
}
unsigned Opcode = candidate->getOpcode();
// LD and LDD may have NOPs inserted afterwards in the case of some LEON
// processors, so we can't use the delay slot if this feature is switched-on.
if (Subtarget->insertNOPLoad()
&&
Opcode >= SP::LDDArr && Opcode <= SP::LDrr)
return true;
return false;
}