summaryrefslogtreecommitdiff
path: root/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
commit41a796e9cc6cc72b9380a5f09f0c27dc607e0613 (patch)
treec87824688093b860f9327ef05b611c376dec5d93 /lib/Target/Mips/MipsDelaySlotFiller.cpp
parentda5836572de7833052f8b7d0715662f930eaf81c (diff)
downloadllvm-41a796e9cc6cc72b9380a5f09f0c27dc607e0613.tar.gz
llvm-41a796e9cc6cc72b9380a5f09f0c27dc607e0613.tar.bz2
llvm-41a796e9cc6cc72b9380a5f09f0c27dc607e0613.tar.xz
Make sure candidate for delay slot filler is not a return instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141196 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsDelaySlotFiller.cpp')
-rw-r--r--lib/Target/Mips/MipsDelaySlotFiller.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Target/Mips/MipsDelaySlotFiller.cpp b/lib/Target/Mips/MipsDelaySlotFiller.cpp
index b8443c1030..94bdd68107 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);