diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-06-24 06:30:22 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-06-24 06:30:22 +0000 |
commit | 9af2418e41a5a531e0b97765eac888555b4b2e47 (patch) | |
tree | 7161cc467156b1b738a39c12a2dab3901c15fb93 | |
parent | 759ed7e410c82fcf568ac646d52e8c39ebe8f15e (diff) |
AMDGPU: Remove disable-irstructurizer subtarget feature
The only real reason to use it is for testing, so replace
it with a command line option instead of a potentially function
dependent feature.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273653 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/AMDGPU/AMDGPU.td | 6 | ||||
-rw-r--r-- | lib/Target/AMDGPU/AMDGPUSubtarget.cpp | 1 | ||||
-rw-r--r-- | lib/Target/AMDGPU/AMDGPUSubtarget.h | 5 | ||||
-rw-r--r-- | lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | 9 | ||||
-rw-r--r-- | test/CodeGen/AMDGPU/predicates.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/AMDGPU/structurize.ll | 2 |
6 files changed, 9 insertions, 16 deletions
diff --git a/lib/Target/AMDGPU/AMDGPU.td b/lib/Target/AMDGPU/AMDGPU.td index c827ed77a10..dfd65fadf64 100644 --- a/lib/Target/AMDGPU/AMDGPU.td +++ b/lib/Target/AMDGPU/AMDGPU.td @@ -216,12 +216,6 @@ def FeatureDumpCodeLower : SubtargetFeature <"dumpcode", "Dump MachineInstrs in the CodeEmitter" >; -def FeatureIRStructurizer : SubtargetFeature <"disable-irstructurizer", - "EnableIRStructurizer", - "false", - "Disable IR Structurizer" ->; - def FeaturePromoteAlloca : SubtargetFeature <"promote-alloca", "EnablePromoteAlloca", "true", diff --git a/lib/Target/AMDGPU/AMDGPUSubtarget.cpp b/lib/Target/AMDGPU/AMDGPUSubtarget.cpp index 6b5a88db477..c6ac84bd3a3 100644 --- a/lib/Target/AMDGPU/AMDGPUSubtarget.cpp +++ b/lib/Target/AMDGPU/AMDGPUSubtarget.cpp @@ -103,7 +103,6 @@ AMDGPUSubtarget::AMDGPUSubtarget(const Triple &TT, StringRef GPU, StringRef FS, DebuggerReserveRegs(false), EnableVGPRSpilling(false), - EnableIRStructurizer(true), EnablePromoteAlloca(false), EnableIfCvt(true), EnableLoadStoreOpt(false), diff --git a/lib/Target/AMDGPU/AMDGPUSubtarget.h b/lib/Target/AMDGPU/AMDGPUSubtarget.h index 300a92e4bec..3c1bb5c07f0 100644 --- a/lib/Target/AMDGPU/AMDGPUSubtarget.h +++ b/lib/Target/AMDGPU/AMDGPUSubtarget.h @@ -80,7 +80,6 @@ protected: // Used as options. bool EnableVGPRSpilling; - bool EnableIRStructurizer; bool EnablePromoteAlloca; bool EnableIfCvt; bool EnableLoadStoreOpt; @@ -218,10 +217,6 @@ public: return CaymanISA; } - bool IsIRStructurizerEnabled() const { - return EnableIRStructurizer; - } - bool isPromoteAllocaEnabled() const { return EnablePromoteAlloca; } diff --git a/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp index 8bc999b9b15..d07ca874c06 100644 --- a/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp +++ b/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp @@ -40,6 +40,11 @@ using namespace llvm; +static cl::opt<bool> EnableR600StructurizeCFG( + "r600-ir-structurize", + cl::desc("Use StructurizeCFG IR pass"), + cl::init(true)); + extern "C" void LLVMInitializeAMDGPUTarget() { // Register the target RegisterTargetMachine<R600TargetMachine> X(TheAMDGPUTarget); @@ -326,8 +331,8 @@ bool AMDGPUPassConfig::addGCPasses() { bool R600PassConfig::addPreISel() { AMDGPUPassConfig::addPreISel(); - const AMDGPUSubtarget &ST = *getAMDGPUTargetMachine().getSubtargetImpl(); - if (ST.IsIRStructurizerEnabled()) + + if (EnableR600StructurizeCFG) addPass(createStructurizeCFGPass()); addPass(createR600TextureIntrinsicsReplacer()); return false; diff --git a/test/CodeGen/AMDGPU/predicates.ll b/test/CodeGen/AMDGPU/predicates.ll index 79dee61cc7c..c1af815c7b1 100644 --- a/test/CodeGen/AMDGPU/predicates.ll +++ b/test/CodeGen/AMDGPU/predicates.ll @@ -1,4 +1,4 @@ -; RUN: llc -spec-exec-max-speculation-cost=0 -march=r600 -mattr=disable-irstructurizer -mcpu=redwood < %s | FileCheck %s +; RUN: llc -spec-exec-max-speculation-cost=0 -march=r600 -r600-ir-structurize=0 -mcpu=redwood < %s | FileCheck %s ; These tests make sure the compiler is optimizing branches using predicates ; when it is legal to do so. diff --git a/test/CodeGen/AMDGPU/structurize.ll b/test/CodeGen/AMDGPU/structurize.ll index 02e592e9a55..174e64e2cf8 100644 --- a/test/CodeGen/AMDGPU/structurize.ll +++ b/test/CodeGen/AMDGPU/structurize.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=r600 -mcpu=redwood -mattr=disable-irstructurizer | FileCheck %s +; RUN: llc < %s -march=r600 -mcpu=redwood -r600-ir-structurize=0 | FileCheck %s ; Test case for a crash in the AMDILCFGStructurizer from a CFG like this: ; ; entry |