diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2004-04-07 04:05:12 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-04-07 04:05:12 +0000 |
commit | 0f51cc1759e2162485b5f9ee57b3b5bc8f5c6759 (patch) | |
tree | fd2b50c98051369d80cd31e2d2edf12483fa8889 | |
parent | 59e04e4889eb3af3a679ddd13f4e3048dfb354d2 (diff) | |
download | external_llvm-0f51cc1759e2162485b5f9ee57b3b5bc8f5c6759.zip external_llvm-0f51cc1759e2162485b5f9ee57b3b5bc8f5c6759.tar.gz external_llvm-0f51cc1759e2162485b5f9ee57b3b5bc8f5c6759.tar.bz2 |
Add in some things I forgot, which Chris helpfully reminded me of...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12735 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/Sparc/DelaySlotFiller.cpp | 8 | ||||
-rw-r--r-- | lib/Target/SparcV8/DelaySlotFiller.cpp | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/Target/Sparc/DelaySlotFiller.cpp b/lib/Target/Sparc/DelaySlotFiller.cpp index 036b1dd..10449ad 100644 --- a/lib/Target/Sparc/DelaySlotFiller.cpp +++ b/lib/Target/Sparc/DelaySlotFiller.cpp @@ -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; } diff --git a/lib/Target/SparcV8/DelaySlotFiller.cpp b/lib/Target/SparcV8/DelaySlotFiller.cpp index 036b1dd..10449ad 100644 --- a/lib/Target/SparcV8/DelaySlotFiller.cpp +++ b/lib/Target/SparcV8/DelaySlotFiller.cpp @@ -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; } |