From 9c77dc9579b136983ec6238413d5b38f29c28dbc Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 5 Oct 2011 18:16:09 +0000 Subject: [PATCH] Make sure candidate for delay slot filler is not a return instruction. llvm-svn: 141196 --- lib/Target/Mips/MipsDelaySlotFiller.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Target/Mips/MipsDelaySlotFiller.cpp b/lib/Target/Mips/MipsDelaySlotFiller.cpp index b8443c1030b..94bdd681078 100644 --- a/lib/Target/Mips/MipsDelaySlotFiller.cpp +++ b/lib/Target/Mips/MipsDelaySlotFiller.cpp @@ -174,15 +174,16 @@ bool Filler::delayHasHazard(MachineBasicBlock::iterator candidate, if (candidate->isImplicitDef() || candidate->isKill()) return true; + MCInstrDesc MCID = candidate->getDesc(); // Loads or stores cannot be moved past a store to the delay slot // and stores cannot be moved past a load. - if (candidate->getDesc().mayLoad()) { + if (MCID.mayLoad()) { if (sawStore) return true; sawLoad = true; } - if (candidate->getDesc().mayStore()) { + if (MCID.mayStore()) { if (sawStore) return true; sawStore = true; @@ -190,7 +191,8 @@ bool Filler::delayHasHazard(MachineBasicBlock::iterator candidate, return true; } - assert(!candidate->getDesc().isCall() && "Cannot put calls in delay slot."); + assert((!MCID.isCall() && !MCID.isReturn()) && + "Cannot put calls in delay slot."); for (unsigned i = 0, e = candidate->getNumOperands(); i!= e; ++i) { const MachineOperand &MO = candidate->getOperand(i);