@@ -263,13 +263,6 @@ static cl::opt<bool> EnableAMDGPUAliasAnalysis("enable-amdgpu-aa", cl::Hidden,
263
263
cl::desc (" Enable AMDGPU Alias Analysis" ),
264
264
cl::init(true ));
265
265
266
- // Disable structurizer-based control-flow lowering in order to test convergence
267
- // control tokens. This should eventually be replaced by the wave-transform.
268
- static cl::opt<bool , true > DisableStructurizer (
269
- " amdgpu-disable-structurizer" ,
270
- cl::desc (" Disable structurizer for experiments; produces unusable code" ),
271
- cl::location(AMDGPUTargetMachine::DisableStructurizer), cl::ReallyHidden);
272
-
273
266
// Enable lib calls simplifications
274
267
static cl::opt<bool > EnableLibCallSimplify (
275
268
" amdgpu-simplify-libcall" ,
@@ -622,7 +615,6 @@ AMDGPUTargetMachine::AMDGPUTargetMachine(const Target &T, const Triple &TT,
622
615
623
616
bool AMDGPUTargetMachine::EnableFunctionCalls = false ;
624
617
bool AMDGPUTargetMachine::EnableLowerModuleLDS = true ;
625
- bool AMDGPUTargetMachine::DisableStructurizer = false ;
626
618
bool AMDGPUTargetMachine::EnableStructurizerWorkarounds = true ;
627
619
628
620
AMDGPUTargetMachine::~AMDGPUTargetMachine () = default ;
@@ -1239,21 +1231,19 @@ bool GCNPassConfig::addPreISel() {
1239
1231
// Merge divergent exit nodes. StructurizeCFG won't recognize the multi-exit
1240
1232
// regions formed by them.
1241
1233
addPass (&AMDGPUUnifyDivergentExitNodesID);
1242
- if (!DisableStructurizer) {
1243
- if (EnableStructurizerWorkarounds) {
1244
- addPass (createFixIrreduciblePass ());
1245
- addPass (createUnifyLoopExitsPass ());
1246
- }
1247
- addPass (createStructurizeCFGPass (false )); // true -> SkipUniformRegions
1234
+ if (EnableStructurizerWorkarounds) {
1235
+ addPass (createFixIrreduciblePass ());
1236
+ addPass (createUnifyLoopExitsPass ());
1248
1237
}
1238
+ addPass (createStructurizeCFGPass (false )); // true -> SkipUniformRegions
1239
+
1249
1240
addPass (createAMDGPUAnnotateUniformValuesLegacy ());
1250
- if (!DisableStructurizer) {
1251
- addPass (createSIAnnotateControlFlowLegacyPass ());
1252
- // TODO: Move this right after structurizeCFG to avoid extra divergence
1253
- // analysis. This depends on stopping SIAnnotateControlFlow from making
1254
- // control flow modifications.
1255
- addPass (createAMDGPURewriteUndefForPHILegacyPass ());
1256
- }
1241
+ addPass (createSIAnnotateControlFlowLegacyPass ());
1242
+ // TODO: Move this right after structurizeCFG to avoid extra divergence
1243
+ // analysis. This depends on stopping SIAnnotateControlFlow from making
1244
+ // control flow modifications.
1245
+ addPass (createAMDGPURewriteUndefForPHILegacyPass ());
1246
+
1257
1247
addPass (createLCSSAPass ());
1258
1248
1259
1249
if (TM->getOptLevel () > CodeGenOptLevel::Less)
@@ -1863,7 +1853,6 @@ void AMDGPUCodeGenPassBuilder::addCodeGenPrepare(AddIRPass &addPass) const {
1863
1853
}
1864
1854
1865
1855
void AMDGPUCodeGenPassBuilder::addPreISel (AddIRPass &addPass) const {
1866
- const bool DisableStructurizer = AMDGPUTargetMachine::DisableStructurizer;
1867
1856
const bool EnableStructurizerWorkarounds =
1868
1857
AMDGPUTargetMachine::EnableStructurizerWorkarounds;
1869
1858
@@ -1880,25 +1869,21 @@ void AMDGPUCodeGenPassBuilder::addPreISel(AddIRPass &addPass) const {
1880
1869
1881
1870
addPass (AMDGPUUnifyDivergentExitNodesPass ());
1882
1871
1883
- if (!DisableStructurizer) {
1884
- if (EnableStructurizerWorkarounds) {
1885
- addPass (FixIrreduciblePass ());
1886
- addPass (UnifyLoopExitsPass ());
1887
- }
1888
-
1889
- addPass (StructurizeCFGPass (/* SkipUniformRegions=*/ false ));
1872
+ if (EnableStructurizerWorkarounds) {
1873
+ addPass (FixIrreduciblePass ());
1874
+ addPass (UnifyLoopExitsPass ());
1890
1875
}
1891
1876
1877
+ addPass (StructurizeCFGPass (/* SkipUniformRegions=*/ false ));
1878
+
1892
1879
addPass (AMDGPUAnnotateUniformValuesPass ());
1893
1880
1894
- if (!DisableStructurizer) {
1895
- addPass (SIAnnotateControlFlowPass (TM));
1881
+ addPass (SIAnnotateControlFlowPass (TM));
1896
1882
1897
- // TODO: Move this right after structurizeCFG to avoid extra divergence
1898
- // analysis. This depends on stopping SIAnnotateControlFlow from making
1899
- // control flow modifications.
1900
- addPass (AMDGPURewriteUndefForPHIPass ());
1901
- }
1883
+ // TODO: Move this right after structurizeCFG to avoid extra divergence
1884
+ // analysis. This depends on stopping SIAnnotateControlFlow from making
1885
+ // control flow modifications.
1886
+ addPass (AMDGPURewriteUndefForPHIPass ());
1902
1887
1903
1888
addPass (LCSSAPass ());
1904
1889
0 commit comments