mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
Fix delay slot filler for non mips1 targets. Patch by Akira Hatanaka
llvm-svn: 121376
This commit is contained in:
parent
18da80f675
commit
0f5478218e
@ -58,15 +58,19 @@ bool Filler::
|
||||
runOnMachineBasicBlock(MachineBasicBlock &MBB)
|
||||
{
|
||||
bool Changed = false;
|
||||
for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ++I)
|
||||
if (TM.getSubtarget<MipsSubtarget>().isMips1() &&
|
||||
I->getDesc().hasDelaySlot()) {
|
||||
for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ++I) {
|
||||
const TargetInstrDesc& Tid = I->getDesc();
|
||||
if (Tid.hasDelaySlot() &&
|
||||
(TM.getSubtarget<MipsSubtarget>().isMips1() ||
|
||||
Tid.isCall() || Tid.isBranch() || Tid.isReturn())) {
|
||||
MachineBasicBlock::iterator J = I;
|
||||
++J;
|
||||
BuildMI(MBB, J, I->getDebugLoc(), TII->get(Mips::NOP));
|
||||
++FilledSlots;
|
||||
Changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
return Changed;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user