Fix delay slot filler for non mips1 targets. Patch by Akira Hatanaka

llvm-svn: 121376
This commit is contained in:
Bruno Cardoso Lopes 2010-12-09 17:31:11 +00:00
parent ff76cb9727
commit fde21cfa64
1 changed files with 9 additions and 5 deletions

View File

@ -58,15 +58,19 @@ bool Filler::
runOnMachineBasicBlock(MachineBasicBlock &MBB) runOnMachineBasicBlock(MachineBasicBlock &MBB)
{ {
bool Changed = false; bool Changed = false;
for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ++I) for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ++I) {
if (TM.getSubtarget<MipsSubtarget>().isMips1() && const TargetInstrDesc& Tid = I->getDesc();
I->getDesc().hasDelaySlot()) { if (Tid.hasDelaySlot() &&
(TM.getSubtarget<MipsSubtarget>().isMips1() ||
Tid.isCall() || Tid.isBranch() || Tid.isReturn())) {
MachineBasicBlock::iterator J = I; MachineBasicBlock::iterator J = I;
++J; ++J;
BuildMI(MBB, J, I->getDebugLoc(), TII->get(Mips::NOP)); BuildMI(MBB, J, I->getDebugLoc(), TII->get(Mips::NOP));
++FilledSlots; ++FilledSlots;
Changed = true; Changed = true;
} }
}
return Changed; return Changed;
} }