diff --git a/include/imex/Conversion/GPUToSPIRV/GPUToSPIRVPass.h b/include/imex/Conversion/GPUToSPIRV/GPUToSPIRVPass.h index f47c63056..110e37458 100644 --- a/include/imex/Conversion/GPUToSPIRV/GPUToSPIRVPass.h +++ b/include/imex/Conversion/GPUToSPIRV/GPUToSPIRVPass.h @@ -29,7 +29,7 @@ template class OperationPass; namespace imex { /// Create a pass std::unique_ptr<::mlir::OperationPass<::mlir::ModuleOp>> -createConvertGPUXToSPIRVPass(bool mapMemorySpace = true); +createConvertGPUToSPIRVExtPass(bool mapMemorySpace = true); } // namespace imex diff --git a/include/imex/Conversion/Passes.td b/include/imex/Conversion/Passes.td index eade211f1..e83ed6a4a 100644 --- a/include/imex/Conversion/Passes.td +++ b/include/imex/Conversion/Passes.td @@ -90,7 +90,7 @@ def ConvertDistToStandard: Pass<"convert-dist-to-standard", "::mlir::ModuleOp"> // GPUToSPIRV //===----------------------------------------------------------------------===// -def ConvertGPUXToSPIRV : Pass<"imex-convert-gpu-to-spirv", "::mlir::ModuleOp"> { +def ConvertGPUToSPIRVExt : Pass<"imex-convert-gpu-to-spirv", "::mlir::ModuleOp"> { let summary = "Convert GPU dialect to SPIR-V dialect"; let description = [{ This pass extends upstream GPU dialect to SPIR-V dialect pass by adding more @@ -247,7 +247,7 @@ memref, arith and math. } ``` }]; - let constructor = "imex::createConvertGPUXToSPIRVPass()"; + let constructor = "imex::createConvertGPUToSPIRVExtPass()"; let dependentDialects = ["::mlir::spirv::SPIRVDialect"]; } diff --git a/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp b/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp index 197d7139a..679190404 100644 --- a/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp +++ b/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp @@ -40,9 +40,12 @@ namespace imex { /// replace it). /// /// 2) Lower the body of the spirv::ModuleOp. -class GPUXToSPIRVPass : public ::imex::ConvertGPUXToSPIRVBase { +/// This pass extends upstream GPU dialect to SPIR-V dialect pass by adding more +/// conversion patterns like SCF, math and control flow. +class GPUToSPIRVExtPass + : public ::imex::ConvertGPUToSPIRVExtBase { public: - explicit GPUXToSPIRVPass(bool mapMemorySpace) + explicit GPUToSPIRVExtPass(bool mapMemorySpace) : mapMemorySpace(mapMemorySpace) {} void runOnOperation() override; @@ -50,7 +53,7 @@ class GPUXToSPIRVPass : public ::imex::ConvertGPUXToSPIRVBase { bool mapMemorySpace; }; -void GPUXToSPIRVPass::runOnOperation() { +void GPUToSPIRVExtPass::runOnOperation() { mlir::MLIRContext *context = &getContext(); mlir::ModuleOp module = getOperation(); @@ -108,7 +111,7 @@ void GPUXToSPIRVPass::runOnOperation() { } std::unique_ptr<::mlir::OperationPass<::mlir::ModuleOp>> -createConvertGPUXToSPIRVPass(bool mapMemorySpace) { - return std::make_unique(mapMemorySpace); +createConvertGPUToSPIRVExtPass(bool mapMemorySpace) { + return std::make_unique(mapMemorySpace); } } // namespace imex