[llvm-commits] [llvm] r141151 - /llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp
Akira Hatanaka
ahatanaka at mips.com
Tue Oct 4 18:30:09 PDT 2011
Author: ahatanak
Date: Tue Oct 4 20:30:09 2011
New Revision: 141151
URL: http://llvm.org/viewvc/llvm-project?rev=141151&view=rev
Log:
Remove function Filler::isDelayFiller. Check if I is the same instruction that
filled the last delay slot visited.
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=141151&r1=141150&r2=141151&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp Tue Oct 4 20:30:09 2011
@@ -41,6 +41,7 @@
TargetMachine &TM;
const TargetInstrInfo *TII;
+ MachineBasicBlock::iterator LastFiller;
static char ID;
Filler(TargetMachine &tm)
@@ -92,6 +93,8 @@
bool Filler::
runOnMachineBasicBlock(MachineBasicBlock &MBB) {
bool Changed = false;
+ LastFiller = MBB.end();
+
for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ++I)
if (I->getDesc().hasDelaySlot()) {
++FilledSlots;
@@ -106,7 +109,9 @@
else
BuildMI(MBB, llvm::next(I), I->getDebugLoc(), TII->get(Mips::NOP));
- ++I; // Skip instruction that has just been moved to delay slot.
+ // Record the filler instruction that filled the delay slot.
+ // The instruction after it will be visited in the next iteration.
+ LastFiller = ++I;
}
return Changed;
@@ -149,7 +154,7 @@
if (I->hasUnmodeledSideEffects()
|| I->isInlineAsm()
|| I->isLabel()
- || isDelayFiller(MBB, I)
+ || I == LastFiller
|| I->getDesc().isPseudo()
//
// Should not allow:
@@ -264,12 +269,3 @@
return false;
}
-
-// return true if the candidate is a delay filler.
-bool Filler::isDelayFiller(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator candidate) {
- if (candidate == MBB.begin())
- return false;
- const MCInstrDesc &prevdesc = (--candidate)->getDesc();
- return prevdesc.hasDelaySlot();
-}
More information about the llvm-commits
mailing list