[llvm-commits] [llvm] r141196 - /llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp

Akira Hatanaka ahatanaka at mips.com
Wed Oct 5 11:16:10 PDT 2011


Author: ahatanak
Date: Wed Oct  5 13:16:09 2011
New Revision: 141196

URL: http://llvm.org/viewvc/llvm-project?rev=141196&view=rev
Log:
Make sure candidate for delay slot filler is not a return instruction.


Modified:
    llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp

Modified: llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp?rev=141196&r1=141195&r2=141196&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp Wed Oct  5 13:16:09 2011
@@ -174,15 +174,16 @@
   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 @@
       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);





More information about the llvm-commits mailing list