Skip to content

Commit d5aa686

Browse files
authored
[GPUToXeVMPipeline][Pipeline] Modify pipeline to add convert-vector-to-llvm. (#166204)
`convert-vector-to-llvm` pass applies a set of vector transformation patterns that are not included in the standard `convert-to-llvm` pass interface. These additional transformations are required to properly lower MLIR vector operations. Since not all vector ops have direct `llvm` dialect lowering, many of them must first be progressively rewritten into simpler or more canonical vector ops, which are then lowered to `llvm`. Therefore, running `convert-vector-to-llvm` is necessary to ensure a complete and correct lowering of vector operations to the `llvm` dialect.
1 parent 6a6b99a commit d5aa686

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mlir/lib/Dialect/GPU/Pipelines/GPUToXeVMPipeline.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,11 @@ void buildPostGPUCommonPassPipeline(
111111
pm.addPass(createGpuToLLVMConversionPass(gpuToLLVMOptions));
112112
}
113113
pm.addPass(createLowerAffinePass());
114+
pm.addPass(createConvertVectorToLLVMPass());
114115
pm.addPass(createConvertToLLVMPass());
115116
pm.addPass(createReconcileUnrealizedCastsPass());
117+
pm.addNestedPass<gpu::GPUModuleOp>(createCanonicalizerPass());
118+
pm.addNestedPass<gpu::GPUModuleOp>(createCSEPass());
116119
// gpu-module-to-binary
117120
{
118121
GpuModuleToBinaryPassOptions gpuToModuleBinOptions;

0 commit comments

Comments
 (0)