1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
// RUN: mlir-opt %s -split-input-file -convert-gpu-to-rocdl='use-bare-ptr-memref-call-conv=0' | FileCheck %s --check-prefixes=CHECK,ROCDL
// RUN: mlir-opt %s -split-input-file -convert-gpu-to-nvvm='use-bare-ptr-memref-call-conv=0' | FileCheck %s --check-prefixes=CHECK,NVVM
gpu.module @kernel {
gpu.func @test_func_readonly(%arg0 : memref<f32> {llvm.readonly} ) {
gpu.return
}
}
// CHECK-LABEL: llvm.func @test_func_readonly
// ROCDL-SAME: !llvm.ptr {llvm.readonly}
// NVVM-SAME: !llvm.ptr {llvm.readonly}
// -----
gpu.module @kernel {
gpu.func @test_func_writeonly(%arg0 : memref<f32> {llvm.writeonly} ) {
gpu.return
}
}
// CHECK-LABEL: llvm.func @test_func_writeonly
// 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}
// -----
gpu.module @kernel {
gpu.func @test_func_nonnull(%arg0 : memref<f32> {llvm.nonnull} ) {
gpu.return
}
}
// CHECK-LABEL: llvm.func @test_func_nonnull
// ROCDL-SAME: !llvm.ptr {llvm.nonnull}
// NVVM-SAME: !llvm.ptr {llvm.nonnull}
// -----
gpu.module @kernel {
gpu.func @test_func_dereferenceable(%arg0 : memref<f32> {llvm.dereferenceable = 4 : i64} ) {
gpu.return
}
}
// CHECK-LABEL: llvm.func @test_func_dereferenceable
// ROCDL-SAME: !llvm.ptr {llvm.dereferenceable = 4 : i64}
// NVVM-SAME: !llvm.ptr {llvm.dereferenceable = 4 : i64}
// -----
gpu.module @kernel {
gpu.func @test_func_dereferenceable_or_null(%arg0 : memref<f32> {llvm.dereferenceable_or_null = 4 : i64} ) {
gpu.return
}
}
// 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}
|