R600: Register R600EmitClauseMarkers pass

This enables -print-before-all to dump MachineInstrs after it is run.

Reviewed-by: Vincent Lejeune <vljn at ovi.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197056 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Tom Stellard 2013-12-11 17:51:41 +00:00
parent 61f848360f
commit 23df2a7178
3 changed files with 19 additions and 9 deletions

View File

@ -28,7 +28,7 @@ class TargetMachine;
FunctionPass *createR600VectorRegMerger(TargetMachine &tm);
FunctionPass *createR600TextureIntrinsicsReplacer();
FunctionPass *createR600ExpandSpecialInstrsPass(TargetMachine &tm);
FunctionPass *createR600EmitClauseMarkers(TargetMachine &tm);
FunctionPass *createR600EmitClauseMarkers();
FunctionPass *createR600ClauseMergePass(TargetMachine &tm);
FunctionPass *createR600Packetizer(TargetMachine &tm);
FunctionPass *createR600ControlFlowFinalizer(TargetMachine &tm);

View File

@ -168,7 +168,7 @@ bool AMDGPUPassConfig::addPreSched2() {
const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>();
if (ST.getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS)
addPass(createR600EmitClauseMarkers(*TM));
addPass(createR600EmitClauseMarkers());
if (ST.isIfCvtEnabled())
addPass(&IfConverterID);
if (ST.getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS)

View File

@ -25,12 +25,15 @@
using namespace llvm;
namespace llvm {
void initializeR600EmitClauseMarkersPass(PassRegistry&);
}
namespace {
class R600EmitClauseMarkersPass : public MachineFunctionPass {
class R600EmitClauseMarkers : public MachineFunctionPass {
private:
static char ID;
const R600InstrInfo *TII;
int Address;
@ -287,8 +290,11 @@ private:
}
public:
R600EmitClauseMarkersPass(TargetMachine &tm) : MachineFunctionPass(ID),
TII(0), Address(0) { }
static char ID;
R600EmitClauseMarkers() : MachineFunctionPass(ID), TII(0), Address(0) {
initializeR600EmitClauseMarkersPass(*PassRegistry::getPassRegistry());
}
virtual bool runOnMachineFunction(MachineFunction &MF) {
TII = static_cast<const R600InstrInfo *>(MF.getTarget().getInstrInfo());
@ -314,12 +320,16 @@ public:
}
};
char R600EmitClauseMarkersPass::ID = 0;
char R600EmitClauseMarkers::ID = 0;
} // end anonymous namespace
INITIALIZE_PASS_BEGIN(R600EmitClauseMarkers, "emitclausemarkers",
"R600 Emit Clause Markters", false, false)
INITIALIZE_PASS_END(R600EmitClauseMarkers, "emitclausemarkers",
"R600 Emit Clause Markters", false, false)
llvm::FunctionPass *llvm::createR600EmitClauseMarkers(TargetMachine &TM) {
return new R600EmitClauseMarkersPass(TM);
llvm::FunctionPass *llvm::createR600EmitClauseMarkers() {
return new R600EmitClauseMarkers();
}