|
12 | 12 | //
|
13 | 13 | //===----------------------------------------------------------------------===//
|
14 | 14 |
|
15 |
| -#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h" |
16 |
| -#include "mlir/Conversion/GPUToSPIRV/GPUToSPIRVPass.h" |
17 |
| -#include "mlir/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.h" |
18 | 15 | #include "mlir/Dialect/Arith/IR/Arith.h"
|
19 | 16 | #include "mlir/Dialect/Func/IR/FuncOps.h"
|
20 | 17 | #include "mlir/Dialect/GPU/IR/GPUDialect.h"
|
21 |
| -#include "mlir/Dialect/GPU/Transforms/Passes.h" |
22 | 18 | #include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
23 | 19 | #include "mlir/Dialect/MemRef/IR/MemRef.h"
|
24 | 20 | #include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
|
25 |
| -#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h" |
26 |
| -#include "mlir/Dialect/SPIRV/Transforms/Passes.h" |
27 | 21 | #include "mlir/ExecutionEngine/JitRunner.h"
|
28 | 22 | #include "mlir/ExecutionEngine/OptUtils.h"
|
29 | 23 | #include "mlir/Pass/Pass.h"
|
@@ -75,31 +69,13 @@ convertMLIRModule(Operation *op, llvm::LLVMContext &context) {
|
75 | 69 | return mainModule;
|
76 | 70 | }
|
77 | 71 |
|
78 |
| -static LogicalResult runMLIRPasses(Operation *module, |
79 |
| - JitRunnerOptions &options) { |
80 |
| - PassManager passManager(module->getContext(), |
81 |
| - module->getName().getStringRef()); |
82 |
| - if (failed(applyPassManagerCLOptions(passManager))) |
83 |
| - return failure(); |
84 |
| - passManager.addPass(createGpuKernelOutliningPass()); |
85 |
| - passManager.addPass(createConvertGPUToSPIRVPass(/*mapMemorySpace=*/true)); |
86 |
| - |
87 |
| - OpPassManager &nestedPM = passManager.nest<spirv::ModuleOp>(); |
88 |
| - nestedPM.addPass(spirv::createSPIRVLowerABIAttributesPass()); |
89 |
| - nestedPM.addPass(spirv::createSPIRVUpdateVCEPass()); |
90 |
| - passManager.addPass(createLowerHostCodeToLLVMPass()); |
91 |
| - passManager.addPass(createConvertSPIRVToLLVMPass()); |
92 |
| - return passManager.run(module); |
93 |
| -} |
94 |
| - |
95 | 72 | int main(int argc, char **argv) {
|
96 | 73 | llvm::InitLLVM y(argc, argv);
|
97 | 74 |
|
98 | 75 | llvm::InitializeNativeTarget();
|
99 | 76 | llvm::InitializeNativeTargetAsmPrinter();
|
100 | 77 |
|
101 | 78 | mlir::JitRunnerConfig jitRunnerConfig;
|
102 |
| - jitRunnerConfig.mlirTransformer = runMLIRPasses; |
103 | 79 | jitRunnerConfig.llvmModuleBuilder = convertMLIRModule;
|
104 | 80 |
|
105 | 81 | mlir::DialectRegistry registry;
|
|
0 commit comments