From dad6f6f38853d7ecdcf8176a2ecafb0a0c13ca86 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Thu, 9 Jun 2016 23:18:47 +0000 Subject: [PATCH] AMDGPU: Properly initialize SIShrinkInstructions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272336 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/AMDGPU/AMDGPU.h | 3 +++ lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | 1 + lib/Target/AMDGPU/SIShrinkInstructions.cpp | 10 ++-------- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/Target/AMDGPU/AMDGPU.h b/lib/Target/AMDGPU/AMDGPU.h index 0ac62e1c4f4..118e0a21ed1 100644 --- a/lib/Target/AMDGPU/AMDGPU.h +++ b/lib/Target/AMDGPU/AMDGPU.h @@ -61,6 +61,9 @@ extern char &AMDGPUAnnotateKernelFeaturesID; void initializeSIFoldOperandsPass(PassRegistry &); extern char &SIFoldOperandsID; +void initializeSIShrinkInstructionsPass(PassRegistry&); +extern char &SIShrinkInstructionsID; + void initializeSIFixSGPRCopiesPass(PassRegistry &); extern char &SIFixSGPRCopiesID; diff --git a/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp index 617ce097165..82a074e0183 100644 --- a/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp +++ b/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp @@ -49,6 +49,7 @@ extern "C" void LLVMInitializeAMDGPUTarget() { initializeSILowerI1CopiesPass(*PR); initializeSIFixSGPRCopiesPass(*PR); initializeSIFoldOperandsPass(*PR); + initializeSIShrinkInstructionsPass(*PR); initializeSIFixControlFlowLiveIntervalsPass(*PR); initializeSILoadStoreOptimizerPass(*PR); initializeAMDGPUAnnotateKernelFeaturesPass(*PR); diff --git a/lib/Target/AMDGPU/SIShrinkInstructions.cpp b/lib/Target/AMDGPU/SIShrinkInstructions.cpp index 912ac503664..18ad274d946 100644 --- a/lib/Target/AMDGPU/SIShrinkInstructions.cpp +++ b/lib/Target/AMDGPU/SIShrinkInstructions.cpp @@ -31,10 +31,6 @@ STATISTIC(NumInstructionsShrunk, STATISTIC(NumLiteralConstantsFolded, "Number of literal constants folded into 32-bit instructions."); -namespace llvm { - void initializeSIShrinkInstructionsPass(PassRegistry&); -} - using namespace llvm; namespace { @@ -61,10 +57,8 @@ public: } // End anonymous namespace. -INITIALIZE_PASS_BEGIN(SIShrinkInstructions, DEBUG_TYPE, - "SI Lower il Copies", false, false) -INITIALIZE_PASS_END(SIShrinkInstructions, DEBUG_TYPE, - "SI Lower il Copies", false, false) +INITIALIZE_PASS(SIShrinkInstructions, DEBUG_TYPE, + "SI Shrink Instructions", false, false) char SIShrinkInstructions::ID = 0;