Skip to content

Commit 0d4f233

Browse files
committed
Address review comments.
1 parent f3ce5e3 commit 0d4f233

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

mlir/include/mlir/Dialect/GPU/Pipelines/Passes.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- Passes.h - GPU NVVM/XeVM pipeline entry points----------------------===//
1+
//===- Passes.h - GPU pipeline entry points----------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -63,7 +63,6 @@ struct GPUToNVVMPipelineOptions
6363
// Options for the gpu to xevm pipeline.
6464
struct GPUToXeVMPipelineOptions
6565
: public PassPipelineOptions<GPUToXeVMPipelineOptions> {
66-
// XeGPU op granularity selection: workgroup | subgroup | lane
6766
PassOptions::Option<std::string> xegpuOpLevel{
6867
*this, "xegpu-op-level",
6968
llvm::cl::desc("Granularity of XeGPU operations to target: workgroup | "
@@ -123,7 +122,7 @@ void buildLowerToNVVMPassPipeline(OpPassManager &pm,
123122
void buildLowerToXeVMPassPipeline(OpPassManager &pm,
124123
const GPUToXeVMPipelineOptions &options);
125124

126-
/// Register all pipeleines for the `gpu` dialect.
125+
/// Register all pipelines for the `gpu` dialect.
127126
void registerGPUToNVVMPipeline();
128127
void registerGPUToXeVMPipeline();
129128

mlir/lib/Dialect/GPU/Pipelines/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ add_mlir_dialect_library(MLIRGPUPipelines
1313
MLIRLinalgTransforms
1414
MLIRAffineToStandard
1515
MLIRGPUToNVVMTransforms
16-
MLIRXeGPUToXeVM
1716
MLIRIndexToLLVM
1817
MLIRMathToLLVM
1918
MLIRNVGPUToNVVM

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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
//===----------------------------------------------------------------------===//
9193
void 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

Comments
 (0)