[clang] [llvm] [HLSL] Adding Flatten and Branch if attributes (PR #116331)
Chris B via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 17 08:51:54 PST 2024
================
@@ -1229,8 +1248,15 @@ FunctionPass *llvm::createSPIRVStructurizerPass() {
PreservedAnalyses SPIRVStructurizerWrapper::run(Function &F,
FunctionAnalysisManager &AF) {
- FunctionPass *StructurizerPass = createSPIRVStructurizerPass();
- if (!StructurizerPass->runOnFunction(F))
+ // TODO: Review this after migrating SPIRV passes to "modern" pass manager.
+ auto FPM = legacy::FunctionPassManager(F.getParent());
+ FPM.add(createLoopSimplifyPass());
+ FPM.add(new DominatorTreeWrapperPass());
+ FPM.add(new LoopInfoWrapperPass());
+ FPM.add(new SPIRVConvergenceRegionAnalysisWrapperPass());
+ FPM.add(createSPIRVStructurizerPass());
+
+ if (!FPM.run(F))
----------------
llvm-beanz wrote:
This is real hacky... It seems way wrong to have the pass wrapper running a whole bunch of additional passes especially passes that mutate the IR. That defeats the point of being able to run a pass in isolation to test it.
https://github.com/llvm/llvm-project/pull/116331
More information about the llvm-commits
mailing list