[llvm] [AMDGPU] Remove "amdgpu-enable-structurizer-workarounds" flag (PR #105819)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 23 05:15:38 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-amdgpu
Author: Juan Manuel Martinez CaamaƱo (jmmartinez)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/105819.diff
2 Files Affected:
- (modified) llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp (+4-19)
- (modified) llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h (-1)
``````````diff
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index 7a9735790371a1..7ac7b3315bb972 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -338,12 +338,6 @@ static cl::opt<bool> EnableScalarIRPasses(
cl::init(true),
cl::Hidden);
-static cl::opt<bool, true> EnableStructurizerWorkarounds(
- "amdgpu-enable-structurizer-workarounds",
- cl::desc("Enable workarounds for the StructurizeCFG pass"),
- cl::location(AMDGPUTargetMachine::EnableStructurizerWorkarounds),
- cl::init(true), cl::Hidden);
-
static cl::opt<bool, true> EnableLowerModuleLDS(
"amdgpu-enable-lower-module-lds", cl::desc("Enable lower module lds pass"),
cl::location(AMDGPUTargetMachine::EnableLowerModuleLDS), cl::init(true),
@@ -615,7 +609,6 @@ AMDGPUTargetMachine::AMDGPUTargetMachine(const Target &T, const Triple &TT,
bool AMDGPUTargetMachine::EnableFunctionCalls = false;
bool AMDGPUTargetMachine::EnableLowerModuleLDS = true;
-bool AMDGPUTargetMachine::EnableStructurizerWorkarounds = true;
AMDGPUTargetMachine::~AMDGPUTargetMachine() = default;
@@ -1231,10 +1224,8 @@ bool GCNPassConfig::addPreISel() {
// Merge divergent exit nodes. StructurizeCFG won't recognize the multi-exit
// regions formed by them.
addPass(&AMDGPUUnifyDivergentExitNodesID);
- if (EnableStructurizerWorkarounds) {
- addPass(createFixIrreduciblePass());
- addPass(createUnifyLoopExitsPass());
- }
+ addPass(createFixIrreduciblePass());
+ addPass(createUnifyLoopExitsPass());
addPass(createStructurizeCFGPass(false)); // true -> SkipUniformRegions
addPass(createAMDGPUAnnotateUniformValuesLegacy());
@@ -1853,8 +1844,6 @@ void AMDGPUCodeGenPassBuilder::addCodeGenPrepare(AddIRPass &addPass) const {
}
void AMDGPUCodeGenPassBuilder::addPreISel(AddIRPass &addPass) const {
- const bool EnableStructurizerWorkarounds =
- AMDGPUTargetMachine::EnableStructurizerWorkarounds;
if (TM.getOptLevel() > CodeGenOptLevel::None)
addPass(FlattenCFGPass());
@@ -1868,12 +1857,8 @@ void AMDGPUCodeGenPassBuilder::addPreISel(AddIRPass &addPass) const {
// regions formed by them.
addPass(AMDGPUUnifyDivergentExitNodesPass());
-
- if (EnableStructurizerWorkarounds) {
- addPass(FixIrreduciblePass());
- addPass(UnifyLoopExitsPass());
- }
-
+ addPass(FixIrreduciblePass());
+ addPass(UnifyLoopExitsPass());
addPass(StructurizeCFGPass(/*SkipUniformRegions=*/false));
addPass(AMDGPUAnnotateUniformValuesPass());
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h
index 66dfd2f733e3e9..5b7257ddb36f1e 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h
@@ -38,7 +38,6 @@ class AMDGPUTargetMachine : public LLVMTargetMachine {
public:
static bool EnableFunctionCalls;
static bool EnableLowerModuleLDS;
- static bool EnableStructurizerWorkarounds;
AMDGPUTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
StringRef FS, const TargetOptions &Options,
``````````
</details>
https://github.com/llvm/llvm-project/pull/105819
More information about the llvm-commits
mailing list