diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 18:49:54 +0900 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 18:49:54 +0900 |
commit | e2810c9a248f4c7fbfae84bb32b6f7e01027458b (patch) | |
tree | ae0b02a8491b969a1cee94ea16ffe42c559143c5 /mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h | |
parent | fa04eb4af95c1ca7377279728cb004bcd2324d01 (diff) | |
parent | bdcf47e4bcb92889665825654bb80a8bbe30379e (diff) | |
download | llvm-users/chapuni/cov/single/switch.zip llvm-users/chapuni/cov/single/switch.tar.gz llvm-users/chapuni/cov/single/switch.tar.bz2 |
Merge branch 'users/chapuni/cov/single/base' into users/chapuni/cov/single/switchusers/chapuni/cov/single/switch
Diffstat (limited to 'mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h')
-rw-r--r-- | mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h b/mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h index 444a07a..e73a748 100644 --- a/mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h +++ b/mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h @@ -14,6 +14,27 @@ namespace mlir { +//===----------------------------------------------------------------------===// +// Helper Functions +//===----------------------------------------------------------------------===// + +/// Find or create an external function declaration in the given module. +LLVM::LLVMFuncOp getOrDefineFunction(gpu::GPUModuleOp moduleOp, Location loc, + OpBuilder &b, StringRef name, + LLVM::LLVMFunctionType type); + +/// Create a global that contains the given string. If a global with the same +/// string already exists in the module, return that global. +LLVM::GlobalOp getOrCreateStringConstant(OpBuilder &b, Location loc, + gpu::GPUModuleOp moduleOp, Type llvmI8, + StringRef namePrefix, StringRef str, + uint64_t alignment = 0, + unsigned addrSpace = 0); + +//===----------------------------------------------------------------------===// +// Lowering Patterns +//===----------------------------------------------------------------------===// + /// Lowering for gpu.dynamic.shared.memory to LLVM dialect. The pattern first /// create a 0-sized global array symbol similar as LLVM expects. It constructs /// a memref descriptor with these values and return it. |