From 22354cfe078f1e416f5c4f69a4c170650cf9614f Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 11 Dec 2013 17:51:41 +0000 Subject: [PATCH] R600: Register R600EmitClauseMarkers pass This enables -print-before-all to dump MachineInstrs after it is run. Reviewed-by: Vincent Lejeune llvm-svn: 197056 --- lib/Target/R600/AMDGPU.h | 2 +- lib/Target/R600/AMDGPUTargetMachine.cpp | 2 +- lib/Target/R600/R600EmitClauseMarkers.cpp | 24 ++++++++++++++++------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/lib/Target/R600/AMDGPU.h b/lib/Target/R600/AMDGPU.h index 025b28e32bf..e73bde10d9e 100644 --- a/lib/Target/R600/AMDGPU.h +++ b/lib/Target/R600/AMDGPU.h @@ -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); diff --git a/lib/Target/R600/AMDGPUTargetMachine.cpp b/lib/Target/R600/AMDGPUTargetMachine.cpp index b42728550aa..2334b061bfc 100644 --- a/lib/Target/R600/AMDGPUTargetMachine.cpp +++ b/lib/Target/R600/AMDGPUTargetMachine.cpp @@ -168,7 +168,7 @@ bool AMDGPUPassConfig::addPreSched2() { const AMDGPUSubtarget &ST = TM->getSubtarget(); if (ST.getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS) - addPass(createR600EmitClauseMarkers(*TM)); + addPass(createR600EmitClauseMarkers()); if (ST.isIfCvtEnabled()) addPass(&IfConverterID); if (ST.getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS) diff --git a/lib/Target/R600/R600EmitClauseMarkers.cpp b/lib/Target/R600/R600EmitClauseMarkers.cpp index 1bbfd2b68f3..5bd793a3d35 100644 --- a/lib/Target/R600/R600EmitClauseMarkers.cpp +++ b/lib/Target/R600/R600EmitClauseMarkers.cpp @@ -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(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(); }