|
10 | 10 |
|
11 | 11 | #include "Analysis/SPIRVConvergenceRegionAnalysis.h"
|
12 | 12 | #include "SPIRV.h"
|
| 13 | +#include "SPIRVStructurizerWrapper.h" |
13 | 14 | #include "SPIRVSubtarget.h"
|
14 | 15 | #include "SPIRVTargetMachine.h"
|
15 | 16 | #include "SPIRVUtils.h"
|
16 | 17 | #include "llvm/ADT/DenseMap.h"
|
17 | 18 | #include "llvm/ADT/SmallPtrSet.h"
|
18 | 19 | #include "llvm/Analysis/LoopInfo.h"
|
19 | 20 | #include "llvm/CodeGen/IntrinsicLowering.h"
|
| 21 | +#include "llvm/IR/Analysis.h" |
20 | 22 | #include "llvm/IR/CFG.h"
|
21 | 23 | #include "llvm/IR/Dominators.h"
|
22 | 24 | #include "llvm/IR/IRBuilder.h"
|
@@ -1211,16 +1213,26 @@ class SPIRVStructurizer : public FunctionPass {
|
1211 | 1213 |
|
1212 | 1214 | char SPIRVStructurizer::ID = 0;
|
1213 | 1215 |
|
1214 |
| -INITIALIZE_PASS_BEGIN(SPIRVStructurizer, "structurizer", "structurize SPIRV", |
1215 |
| - false, false) |
| 1216 | +INITIALIZE_PASS_BEGIN(SPIRVStructurizer, "spirv-structurizer", |
| 1217 | + "structurize SPIRV", false, false) |
1216 | 1218 | INITIALIZE_PASS_DEPENDENCY(LoopSimplify)
|
1217 | 1219 | INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
|
1218 | 1220 | INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
|
1219 | 1221 | INITIALIZE_PASS_DEPENDENCY(SPIRVConvergenceRegionAnalysisWrapperPass)
|
1220 | 1222 |
|
1221 |
| -INITIALIZE_PASS_END(SPIRVStructurizer, "structurize", "structurize SPIRV", |
1222 |
| - false, false) |
| 1223 | +INITIALIZE_PASS_END(SPIRVStructurizer, "spirv-structurizer", |
| 1224 | + "structurize SPIRV", false, false) |
1223 | 1225 |
|
1224 | 1226 | FunctionPass *llvm::createSPIRVStructurizerPass() {
|
1225 | 1227 | return new SPIRVStructurizer();
|
1226 | 1228 | }
|
| 1229 | + |
| 1230 | +PreservedAnalyses SPIRVStructurizerWrapper::run(Function &F, |
| 1231 | + FunctionAnalysisManager &AF) { |
| 1232 | + FunctionPass *StructurizerPass = createSPIRVStructurizerPass(); |
| 1233 | + if (!StructurizerPass->runOnFunction(F)) |
| 1234 | + return PreservedAnalyses::all(); |
| 1235 | + PreservedAnalyses PA; |
| 1236 | + PA.preserveSet<CFGAnalyses>(); |
| 1237 | + return PA; |
| 1238 | +} |
0 commit comments