Skip to content

Commit 8e12f31

Browse files
authored
[mlir][gpu] Update LaunchFuncOp lowering in GPU to LLVM (#94991)
This patch updates the lowering of `LaunchFuncOp` in GPU to LLVM to only legalize the operation with the converted operands, effectively removing the lowering used by the old serialization pipeline. It also removes all remaining uses of the old gpu serialization infrastructure in `gpu-to-llvm`. See [Compilation overview | 'gpu' Dialect - MLIR docs](https://mlir.llvm.org/docs/Dialects/GPU/#compilation-overview) for additional information on the target attributes compilation pipeline that replaced the old serialization pipeline.
1 parent 5275aed commit 8e12f31

File tree

4 files changed

+66
-368
lines changed

4 files changed

+66
-368
lines changed

mlir/include/mlir/Conversion/GPUCommon/GPUCommonPass.h

+3-7
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ class LLVMDialect;
4646
#define GEN_PASS_DECL_GPUTOLLVMCONVERSIONPASS
4747
#include "mlir/Conversion/Passes.h.inc"
4848

49-
using OwnedBlob = std::unique_ptr<std::vector<char>>;
50-
using BlobGenerator =
51-
std::function<OwnedBlob(const std::string &, Location, StringRef)>;
5249
using LoweringCallback = std::function<std::unique_ptr<llvm::Module>(
5350
Operation *, llvm::LLVMContext &, StringRef)>;
5451

@@ -66,10 +63,9 @@ struct FunctionCallBuilder {
6663

6764
/// Collect a set of patterns to convert from the GPU dialect to LLVM and
6865
/// populate converter for gpu types.
69-
void populateGpuToLLVMConversionPatterns(
70-
LLVMTypeConverter &converter, RewritePatternSet &patterns,
71-
StringRef gpuBinaryAnnotation = {}, bool kernelBarePtrCallConv = false,
72-
SymbolTable *cachedModuleTable = nullptr);
66+
void populateGpuToLLVMConversionPatterns(LLVMTypeConverter &converter,
67+
RewritePatternSet &patterns,
68+
bool kernelBarePtrCallConv = false);
7369

7470
/// A function that maps a MemorySpace enum to a target-specific integer value.
7571
using MemorySpaceMapping = std::function<unsigned(gpu::AddressSpace)>;

mlir/include/mlir/Conversion/Passes.td

+1-5
Original file line numberDiff line numberDiff line change
@@ -478,11 +478,7 @@ def GpuToLLVMConversionPass : Pass<"gpu-to-llvm", "ModuleOp"> {
478478
/*default=*/"false",
479479
"Use bare pointers to pass memref arguments to kernels. "
480480
"The kernel must use the same setting for this option."
481-
>,
482-
Option<"gpuBinaryAnnotation", "gpu-binary-annotation", "std::string",
483-
/*default=*/"gpu::getDefaultGpuBinaryAnnotation()",
484-
"Annotation attribute string for GPU binary"
485-
>
481+
>
486482
];
487483

488484
let dependentDialects = [

0 commit comments

Comments
 (0)