File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 2424#include " llvm/IR/IntrinsicInst.h"
2525#include " llvm/IR/Intrinsics.h"
2626#include " llvm/IR/IntrinsicsSPIRV.h"
27+ #include " llvm/IR/LegacyPassManager.h"
2728#include " llvm/InitializePasses.h"
29+ #include " llvm/PassRegistry.h"
30+ #include " llvm/Transforms/Utils.h"
2831#include " llvm/Transforms/Utils/Cloning.h"
2932#include " llvm/Transforms/Utils/LoopSimplify.h"
3033#include " llvm/Transforms/Utils/LowerMemIntrinsics.h"
34+ #include < memory>
3135#include < queue>
3236#include < stack>
3337#include < unordered_set>
@@ -1245,8 +1249,15 @@ FunctionPass *llvm::createSPIRVStructurizerPass() {
12451249
12461250PreservedAnalyses SPIRVStructurizerWrapper::run (Function &F,
12471251 FunctionAnalysisManager &AF) {
1248- FunctionPass *StructurizerPass = createSPIRVStructurizerPass ();
1249- if (!StructurizerPass->runOnFunction (F))
1252+ // TODO: Review this after migrating SPIRV passes to "modern" pass manager.
1253+ auto FPM = legacy::FunctionPassManager (F.getParent ());
1254+ FPM.add (createLoopSimplifyPass ());
1255+ FPM.add (new DominatorTreeWrapperPass ());
1256+ FPM.add (new LoopInfoWrapperPass ());
1257+ FPM.add (new SPIRVConvergenceRegionAnalysisWrapperPass ());
1258+ FPM.add (createSPIRVStructurizerPass ());
1259+
1260+ if (!FPM.run (F))
12501261 return PreservedAnalyses::all ();
12511262 PreservedAnalyses PA;
12521263 PA.preserveSet <CFGAnalyses>();
You can’t perform that action at this time.
0 commit comments