Skip to content

Commit

Permalink
[AMDGPU] Remove "amdgpu-enable-structurizer-workarounds" flag (llvm#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmartinez authored and dmpolukhin committed Sep 2, 2024
1 parent e34ed1c commit 9517df4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
23 changes: 4 additions & 19 deletions llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand All @@ -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());
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9517df4

Please sign in to comment.