@@ -40,6 +40,7 @@ void buildCommonPassPipeline(
4040 OpPassManager &pm, const mlir::gpu::GPUToXeVMPipelineOptions &options) {
4141 // builtin.module scope passes
4242 pm.addPass (createCSEPass ());
43+ pm.addPass (createConvertVectorToSCFPass ());
4344 {
4445 GpuXeVMAttachTargetOptions xevmTargetOptions;
4546 xevmTargetOptions.moduleMatcher = options.xevmModuleMatcher ;
@@ -49,6 +50,8 @@ void buildCommonPassPipeline(
4950 xevmTargetOptions.cmdOptions = options.cmdOptions ;
5051 pm.addPass (createGpuXeVMAttachTarget (xevmTargetOptions));
5152 }
53+ pm.addNestedPass <gpu::GPUModuleOp>(createLowerAffinePass ());
54+ pm.addNestedPass <func::FuncOp>(createGpuAsyncRegionPass ());
5255}
5356
5457// ===----------------------------------------------------------------------===//
@@ -59,7 +62,6 @@ void buildGpuPassPipeline(OpPassManager &pm,
5962 if (options.xegpuOpLevel == " workgroup" ) {
6063 pm.addNestedPass <gpu::GPUModuleOp>(xegpu::createXeGPUWgToSgDistribute ());
6164 pm.addNestedPass <gpu::GPUModuleOp>(createCSEPass ());
62- pm.addNestedPass <gpu::GPUModuleOp>(createLowerAffinePass ());
6365 pm.addNestedPass <gpu::GPUModuleOp>(xegpu::createXeGPUBlocking ());
6466 pm.addNestedPass <gpu::GPUModuleOp>(createCanonicalizerPass ());
6567 pm.addNestedPass <gpu::GPUModuleOp>(createCSEPass ());
@@ -90,21 +92,17 @@ void buildGpuPassPipeline(OpPassManager &pm,
9092// ===----------------------------------------------------------------------===//
9193void buildHostPostPipeline (OpPassManager &pm,
9294 const mlir::gpu::GPUToXeVMPipelineOptions &options) {
93- pm.addNestedPass <func::FuncOp>(LLVM::createLLVMRequestCWrappersPass ());
94- pm.addNestedPass <func::FuncOp>(createGpuAsyncRegionPass ());
9595 pm.addPass (createReconcileUnrealizedCastsPass ());
96- pm.addPass (createConvertVectorToSCFPass ());
9796 pm.addPass (createSCFToControlFlowPass ());
9897 pm.addPass (memref::createExpandStridedMetadataPass ());
99- pm.addPass (createFinalizeMemRefToLLVMConversionPass ());
10098 {
10199 GpuToLLVMConversionPassOptions gpuToLLVMOptions;
102100 gpuToLLVMOptions.hostBarePtrCallConv = options.hostBarePtrCallConv ;
103101 gpuToLLVMOptions.kernelBarePtrCallConv = options.kernelBarePtrCallConv ;
104102 pm.addPass (createGpuToLLVMConversionPass (gpuToLLVMOptions));
105103 }
106- pm.addPass (createConvertToLLVMPass ());
107104 pm.addPass (createLowerAffinePass ());
105+ pm.addPass (createConvertToLLVMPass ());
108106 pm.addPass (createReconcileUnrealizedCastsPass ());
109107 // gpu-module-to-binary
110108 {
0 commit comments