6
6
//
7
7
// ===----------------------------------------------------------------------===//
8
8
9
- #include < string>
10
-
11
- #include " gc/Transforms/Passes.h"
12
-
13
- #include " imex/Conversion/Passes.h"
14
- #include " imex/Transforms/Passes.h"
15
-
16
9
#include " mlir/Conversion/Passes.h"
10
+ #include " mlir/Dialect/Arith/Transforms/Passes.h"
17
11
#include " mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h"
18
12
#include " mlir/Dialect/Bufferization/Transforms/Passes.h"
19
- #include " mlir/Dialect/GPU/IR/GPUDialect.h"
20
- #include " mlir/Dialect/GPU/Transforms/Passes.h"
13
+ #include " mlir/Dialect/LLVMIR/LLVMDialect.h"
21
14
#include " mlir/Dialect/LLVMIR/Transforms/Passes.h"
22
15
#include " mlir/Dialect/Linalg/Passes.h"
16
+ #include " mlir/Dialect/Math/Transforms/Passes.h"
17
+ #include " mlir/Dialect/MemRef/IR/MemRef.h"
23
18
#include " mlir/Dialect/MemRef/Transforms/Passes.h"
24
- #include " mlir/Dialect/SPIRV/Transforms/Passes.h"
19
+ #include " mlir/Dialect/SCF/IR/SCF.h"
20
+ #include " mlir/Dialect/Tensor/IR/Tensor.h"
21
+ #include " mlir/IR/DialectRegistry.h"
25
22
#include " mlir/InitAllPasses.h"
26
23
#include " mlir/Pass/PassManager.h"
24
+ #include " mlir/Support/LogicalResult.h"
27
25
#include " mlir/Transforms/Passes.h"
26
+ #include < iostream>
27
+
28
+ #include " mlir/Dialect/GPU/IR/GPUDialect.h"
29
+ #include " mlir/Dialect/GPU/Transforms/Passes.h"
30
+ #include " mlir/Dialect/SPIRV/Transforms/Passes.h"
31
+
32
+ #include < imex/Conversion/Passes.h>
33
+ #include < imex/Transforms/Passes.h>
34
+
35
+ #include < string>
36
+
37
+ #include " gc/Transforms/Passes.h"
28
38
29
39
namespace mlir ::gc {
30
40
31
41
struct GPUPipelineOption : PassPipelineOptions<GPUPipelineOption> {
32
- Option<bool > isUsmArgs{
42
+ PassOptions:: Option<bool > isUsmArgs{
33
43
*this , " is-usm-args" ,
34
- desc (" Whether to use USM(unified shared memory) func args, in "
35
- " which the host and device could access the same buffer "
36
- " and there is no need to add memcpy explicitly" ),
37
- init (true )};
44
+ llvm::cl:: desc (" Whether to use USM(unified shared memory) func args, in "
45
+ " which the host and device could access the same buffer "
46
+ " and there is no need to add memcpy explicitly" ),
47
+ llvm::cl:: init (true )};
38
48
};
39
49
40
- void populateGPUPipeline (OpPassManager &pm,
50
+ void populateGPUPipeline (mlir:: OpPassManager &pm,
41
51
const GPUPipelineOption &pipelineOption) {
42
- // Add an argument for the GPU context
43
- pm.addNestedPass <func::FuncOp>(createAddContextArg ());
44
-
45
52
pm.addNestedPass <func::FuncOp>(createIterativeTilingAndFusion ());
46
53
47
54
pm.addPass (bufferization::createEmptyTensorEliminationPass ());
@@ -84,7 +91,6 @@ void populateGPUPipeline(OpPassManager &pm,
84
91
/* isUsmArgs*/ pipelineOption.isUsmArgs .getValue ()};
85
92
pm.addNestedPass <func::FuncOp>(
86
93
imex::createInsertGPUAllocsPass (insertGPUAllocsOption));
87
-
88
94
pm.addPass (createGpuKernelOutliningPass ());
89
95
pm.addPass (createCanonicalizerPass ());
90
96
pm.addPass (imex::createSetSPIRVCapabilitiesPass ());
@@ -103,14 +109,15 @@ void populateGPUPipeline(OpPassManager &pm,
103
109
pm.addNestedPass <func::FuncOp>(LLVM::createRequestCWrappersPass ());
104
110
pm.addPass (imex::createSerializeSPIRVPass ());
105
111
pm.addPass (createConvertVectorToSCFPass ());
112
+ pm.addPass (imex::createConvertGPUToGPUXPass ());
106
113
pm.addPass (createConvertSCFToCFPass ());
107
114
pm.addPass (createConvertControlFlowToLLVMPass ());
108
115
pm.addPass (createConvertVectorToLLVMPass ());
109
116
pm.addPass (createConvertIndexToLLVMPass ());
110
117
pm.addPass (createArithToLLVMConversionPass ());
111
118
pm.addPass (createConvertFuncToLLVMPass ());
112
119
pm.addPass (createConvertMathToLLVMPass ());
113
- pm.addPass (createGpuToGpuOcl ());
120
+ pm.addPass (imex::createConvertGPUXToLLVMPass ());
114
121
pm.addPass (createConvertIndexToLLVMPass ());
115
122
pm.addPass (memref::createExpandStridedMetadataPass ());
116
123
pm.addPass (createLowerAffinePass ());
0 commit comments