diff options
author | Zoran Jovanovic <zoran.jovanovic@imgtec.com> | 2014-11-10 17:27:56 +0000 |
---|---|---|
committer | Zoran Jovanovic <zoran.jovanovic@imgtec.com> | 2014-11-10 17:27:56 +0000 |
commit | 37bca10148f8a28b640a833daafdc87175fa631c (patch) | |
tree | b206410f1f54d13bb330a7b71d881546a1499b16 /llvm/lib | |
parent | 29a4584484ddc7e1409072db63414bf7d4a758fd (diff) | |
download | bcm5719-llvm-37bca10148f8a28b640a833daafdc87175fa631c.tar.gz bcm5719-llvm-37bca10148f8a28b640a833daafdc87175fa631c.zip |
[mips][microMIPS] Fix issue with delay slot filler and microMIPS
Differential Revision: http://reviews.llvm.org/D6193
llvm-svn: 221612
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp b/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp index f8daec9e50f..9ac62b0df7d 100644 --- a/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp +++ b/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp @@ -497,24 +497,32 @@ getUnderlyingObjects(const MachineInstr &MI, /// We assume there is only one delay slot per delayed instruction. bool Filler::runOnMachineBasicBlock(MachineBasicBlock &MBB) { bool Changed = false; + bool InMicroMipsMode = TM.getSubtarget<MipsSubtarget>().inMicroMipsMode(); for (Iter I = MBB.begin(); I != MBB.end(); ++I) { if (!hasUnoccupiedSlot(&*I)) continue; - ++FilledSlots; - Changed = true; - - // Delay slot filling is disabled at -O0. - if (!DisableDelaySlotFiller && (TM.getOptLevel() != CodeGenOpt::None)) { - if (searchBackward(MBB, I)) - continue; + // For microMIPS, at the moment, do not fill delay slots of call + // instructions. + // + // TODO: Support for replacing regular call instructions with corresponding + // short delay slot instructions should be implemented. + if (!InMicroMipsMode || !I->isCall()) { + ++FilledSlots; + Changed = true; + + // Delay slot filling is disabled at -O0. + if (!DisableDelaySlotFiller && (TM.getOptLevel() != CodeGenOpt::None)) { + if (searchBackward(MBB, I)) + continue; - if (I->isTerminator()) { - if (searchSuccBBs(MBB, I)) + if (I->isTerminator()) { + if (searchSuccBBs(MBB, I)) + continue; + } else if (searchForward(MBB, I)) { continue; - } else if (searchForward(MBB, I)) { - continue; + } } } |