projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
[oota-llvm.git]
/
lib
/
Target
/
Sparc
/
DelaySlotFiller.cpp
diff --git
a/lib/Target/Sparc/DelaySlotFiller.cpp
b/lib/Target/Sparc/DelaySlotFiller.cpp
index 768b79b9fb101aa2bc4fcc717ae8c969c2a40374..15b26c29872f3bfefbd47a90f70d44cef8564f55 100644
(file)
--- a/
lib/Target/Sparc/DelaySlotFiller.cpp
+++ b/
lib/Target/Sparc/DelaySlotFiller.cpp
@@
-2,8
+2,8
@@
//
// The LLVM Compiler Infrastructure
//
//
// The LLVM Compiler Infrastructure
//
-// This file
was developed by the LLVM research group and is distributed under
-//
the University of Illinois Open Source
License. See LICENSE.TXT for details.
+// This file
is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//
//===----------------------------------------------------------------------===//
//
@@
-11,6
+11,7
@@
//
//===----------------------------------------------------------------------===//
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "delayslotfiller"
#include "Sparc.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "Sparc.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
@@
-19,9
+20,9
@@
#include "llvm/ADT/Statistic.h"
using namespace llvm;
#include "llvm/ADT/Statistic.h"
using namespace llvm;
-namespace {
- Statistic FilledSlots("delayslotfiller", "Num. of delay slots filled");
+STATISTIC(FilledSlots, "Number of delay slots filled");
+namespace {
struct Filler : public MachineFunctionPass {
/// Target machine description which we query for reg. names, data
/// layout, etc.
struct Filler : public MachineFunctionPass {
/// Target machine description which we query for reg. names, data
/// layout, etc.
@@
-29,7
+30,9
@@
namespace {
TargetMachine &TM;
const TargetInstrInfo *TII;
TargetMachine &TM;
const TargetInstrInfo *TII;
- Filler(TargetMachine &tm) : TM(tm), TII(tm.getInstrInfo()) { }
+ static char ID;
+ Filler(TargetMachine &tm)
+ : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { }
virtual const char *getPassName() const {
return "SPARC Delay Slot Filler";
virtual const char *getPassName() const {
return "SPARC Delay Slot Filler";
@@
-45,6
+48,7
@@
namespace {
}
};
}
};
+ char Filler::ID = 0;
} // end of anonymous namespace
/// createSparcDelaySlotFillerPass - Returns a pass that fills in delay
} // end of anonymous namespace
/// createSparcDelaySlotFillerPass - Returns a pass that fills in delay
@@
-61,10
+65,10
@@
FunctionPass *llvm::createSparcDelaySlotFillerPass(TargetMachine &tm) {
bool Filler::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
bool Changed = false;
for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ++I)
bool Filler::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
bool Changed = false;
for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ++I)
- if (
TII->hasDelaySlot(I->getOpcode()
)) {
+ if (
I->getDesc().hasDelaySlot(
)) {
MachineBasicBlock::iterator J = I;
++J;
MachineBasicBlock::iterator J = I;
++J;
- BuildMI(MBB, J, TII->get(SP::NOP));
+ BuildMI(MBB, J,
DebugLoc::getUnknownLoc(),
TII->get(SP::NOP));
++FilledSlots;
Changed = true;
}
++FilledSlots;
Changed = true;
}