Add in some things I forgot, which Chris helpfully reminded me of...
authorBrian Gaeke <gaeke@uiuc.edu>
Wed, 7 Apr 2004 04:05:12 +0000 (04:05 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Wed, 7 Apr 2004 04:05:12 +0000 (04:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12735 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/DelaySlotFiller.cpp
lib/Target/SparcV8/DelaySlotFiller.cpp

index 036b1dd658936aebb1d4b348b6d54b9db5bea4ab..10449ad5246c251bee4e4885d0ffd20e0432719a 100644 (file)
@@ -63,14 +63,18 @@ static bool hasDelaySlot (unsigned Opcode) {
 }
 
 /// runOnMachineBasicBlock - Fill in delay slots for the given basic block.
+/// Currently, we fill delay slots with NOPs. We assume there is only one
+/// delay slot per delayed instruction.
 ///
 bool Filler::runOnMachineBasicBlock (MachineBasicBlock &MBB) {
+  bool Changed = false;
   for (MachineBasicBlock::iterator I = MBB.begin (); I != MBB.end (); ++I)
     if (hasDelaySlot (I->getOpcode ())) {
       MachineBasicBlock::iterator J = I;
       ++J;
-      MBB.insert (J, BuildMI (V8::NOP, 0));
+      BuildMI (MBB, J, V8::NOP, 0);
       ++FilledSlots;
+      Changed = true;
     }
-  return false;
+  return Changed;
 }
index 036b1dd658936aebb1d4b348b6d54b9db5bea4ab..10449ad5246c251bee4e4885d0ffd20e0432719a 100644 (file)
@@ -63,14 +63,18 @@ static bool hasDelaySlot (unsigned Opcode) {
 }
 
 /// runOnMachineBasicBlock - Fill in delay slots for the given basic block.
+/// Currently, we fill delay slots with NOPs. We assume there is only one
+/// delay slot per delayed instruction.
 ///
 bool Filler::runOnMachineBasicBlock (MachineBasicBlock &MBB) {
+  bool Changed = false;
   for (MachineBasicBlock::iterator I = MBB.begin (); I != MBB.end (); ++I)
     if (hasDelaySlot (I->getOpcode ())) {
       MachineBasicBlock::iterator J = I;
       ++J;
-      MBB.insert (J, BuildMI (V8::NOP, 0));
+      BuildMI (MBB, J, V8::NOP, 0);
       ++FilledSlots;
+      Changed = true;
     }
-  return false;
+  return Changed;
 }