summaryrefslogtreecommitdiff
path: root/lib/Target/Sparc/DelaySlotFiller.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-02-05 05:50:24 +0000
committerChris Lattner <sabre@nondot.org>2006-02-05 05:50:24 +0000
commit7c90f73a1b06040d971a3dd95a491031ae6238d5 (patch)
treeb08b13069e8e41b83636b53103804110e993d376 /lib/Target/Sparc/DelaySlotFiller.cpp
parent213845367cb394237cbf10ccfba5a219bbec4781 (diff)
downloadllvm-7c90f73a1b06040d971a3dd95a491031ae6238d5.tar.gz
llvm-7c90f73a1b06040d971a3dd95a491031ae6238d5.tar.bz2
llvm-7c90f73a1b06040d971a3dd95a491031ae6238d5.tar.xz
Rename SPARC V8 target to be the LLVM SPARC target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25985 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc/DelaySlotFiller.cpp')
-rw-r--r--lib/Target/Sparc/DelaySlotFiller.cpp37
1 files changed, 18 insertions, 19 deletions
diff --git a/lib/Target/Sparc/DelaySlotFiller.cpp b/lib/Target/Sparc/DelaySlotFiller.cpp
index 71dc022b9f..2ef8ffef80 100644
--- a/lib/Target/Sparc/DelaySlotFiller.cpp
+++ b/lib/Target/Sparc/DelaySlotFiller.cpp
@@ -1,4 +1,4 @@
-//===-- DelaySlotFiller.cpp - SparcV8 delay slot filler -------------------===//
+//===-- DelaySlotFiller.cpp - SPARC delay slot filler ---------------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -11,17 +11,16 @@
//
//===----------------------------------------------------------------------===//
-#include "SparcV8.h"
+#include "Sparc.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/ADT/Statistic.h"
-
using namespace llvm;
namespace {
- Statistic<> FilledSlots ("delayslotfiller", "Num. of delay slots filled");
+ Statistic<> FilledSlots("delayslotfiller", "Num. of delay slots filled");
struct Filler : public MachineFunctionPass {
/// Target machine description which we query for reg. names, data
@@ -30,42 +29,42 @@ namespace {
TargetMachine &TM;
const TargetInstrInfo *TII;
- Filler (TargetMachine &tm) : TM (tm), TII (tm.getInstrInfo ()) { }
+ Filler(TargetMachine &tm) : TM(tm), TII(tm.getInstrInfo()) { }
- virtual const char *getPassName () const {
- return "SparcV8 Delay Slot Filler";
+ virtual const char *getPassName() const {
+ return "SPARC Delay Slot Filler";
}
- bool runOnMachineBasicBlock (MachineBasicBlock &MBB);
- bool runOnMachineFunction (MachineFunction &F) {
+ bool runOnMachineBasicBlock(MachineBasicBlock &MBB);
+ bool runOnMachineFunction(MachineFunction &F) {
bool Changed = false;
- for (MachineFunction::iterator FI = F.begin (), FE = F.end ();
+ for (MachineFunction::iterator FI = F.begin(), FE = F.end();
FI != FE; ++FI)
- Changed |= runOnMachineBasicBlock (*FI);
+ Changed |= runOnMachineBasicBlock(*FI);
return Changed;
}
};
} // end of anonymous namespace
-/// createSparcV8DelaySlotFillerPass - Returns a pass that fills in delay
-/// slots in SparcV8 MachineFunctions
+/// createSparcDelaySlotFillerPass - Returns a pass that fills in delay
+/// slots in Sparc MachineFunctions
///
-FunctionPass *llvm::createSparcV8DelaySlotFillerPass (TargetMachine &tm) {
- return new Filler (tm);
+FunctionPass *llvm::createSparcDelaySlotFillerPass(TargetMachine &tm) {
+ return new Filler(tm);
}
/// 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 Filler::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
bool Changed = false;
- for (MachineBasicBlock::iterator I = MBB.begin (); I != MBB.end (); ++I)
- if (TII->hasDelaySlot (I->getOpcode ())) {
+ for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ++I)
+ if (TII->hasDelaySlot(I->getOpcode())) {
MachineBasicBlock::iterator J = I;
++J;
- BuildMI (MBB, J, V8::NOP, 0);
+ BuildMI(MBB, J, SP::NOP, 0);
++FilledSlots;
Changed = true;
}