summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2011-10-05 18:16:09 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2011-10-05 18:16:09 +0000
commit426a8048255619ed9a667abcfcc99ee2f6266e80 (patch)
treed22a1cfda57d8180581379f16b42645f98d300c7 /llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp
parent8218b8f6ae222c82c4f72fe2b7b10e7fa755b49b (diff)
downloadbcm5719-llvm-426a8048255619ed9a667abcfcc99ee2f6266e80.tar.gz
bcm5719-llvm-426a8048255619ed9a667abcfcc99ee2f6266e80.zip
Make sure candidate for delay slot filler is not a return instruction.
llvm-svn: 141196
Diffstat (limited to 'llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp')
-rw-r--r--llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp b/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp
index b8443c1030b..94bdd681078 100644
--- a/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud