diff options
author | Krzysztof Drewniak <Krzysztof.Drewniak@amd.com> | 2024-01-03 14:28:15 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-03 14:28:15 -0600 |
commit | ddd6acd7a8e9296544bce49af7178f3eeb318e61 (patch) | |
tree | 0b68a6c869ec95d9505c259980eb3e2b876823c4 /mlir/test/Conversion/GPUCommon | |
parent | f64d1c810a2b8d89c3760cefb957da499c087404 (diff) | |
download | llvm-ddd6acd7a8e9296544bce49af7178f3eeb318e61.zip llvm-ddd6acd7a8e9296544bce49af7178f3eeb318e61.tar.gz llvm-ddd6acd7a8e9296544bce49af7178f3eeb318e61.tar.bz2 |
[mlir][GPU] Expand LLVM function attribute copies (#76755)
Expand the copying of attributes on GPU kernel arguments during LLVM
lowering.
Support copying attributes from values that are already LLVM pointers.
Support copying attributes, like `noundef`, that aren't specific to (the
pointer parts of) arguments.
Diffstat (limited to 'mlir/test/Conversion/GPUCommon')
-rw-r--r-- | mlir/test/Conversion/GPUCommon/memref-arg-attrs.mlir | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/mlir/test/Conversion/GPUCommon/memref-arg-attrs.mlir b/mlir/test/Conversion/GPUCommon/memref-arg-attrs.mlir index 3337498..e7c7420 100644 --- a/mlir/test/Conversion/GPUCommon/memref-arg-attrs.mlir +++ b/mlir/test/Conversion/GPUCommon/memref-arg-attrs.mlir @@ -24,6 +24,17 @@ gpu.module @kernel { // ROCDL-SAME: !llvm.ptr {llvm.writeonly} // NVVM-SAME: !llvm.ptr {llvm.writeonly} +// ----- + +gpu.module @kernel { + gpu.func @test_func_readonly_ptr(%arg0 : !llvm.ptr {llvm.readonly} ) { + gpu.return + } +} + +// CHECK-LABEL: llvm.func @test_func_readonly_ptr +// ROCDL-SAME: !llvm.ptr {llvm.readonly} +// NVVM-SAME: !llvm.ptr {llvm.readonly} // ----- @@ -62,3 +73,17 @@ gpu.module @kernel { // CHECK-LABEL: llvm.func @test_func_dereferenceable_or_null // ROCDL-SAME: !llvm.ptr {llvm.dereferenceable_or_null = 4 : i64} // NVVM-SAME: !llvm.ptr {llvm.dereferenceable_or_null = 4 : i64} + +// ----- + +gpu.module @kernel { + gpu.func @test_func_noundef(%arg0 : memref<f32> {llvm.noundef} ) { + gpu.return + } +} + +// CHECK-LABEL: llvm.func @test_func_noundef +// ROCDL-SAME: !llvm.ptr {llvm.noundef} +// ROCDL-SAME: i64 {llvm.noundef} +// NVVM-SAME: !llvm.ptr {llvm.noundef} +// NVVM-SAME: i64 {llvm.noundef} |