[Mlir-commits] [mlir] [MLIR][LLVM] Remove last typed pointer remnants from tests (PR #71232)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Nov 3 14:19:08 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Christian Ulmann (Dinistro)

<details>
<summary>Changes</summary>

This commit removes all LLVM dialect typed pointers from the lit tests. Typed pointers have been deprecated for a while now and it's planned to soon remove them from the LLVM dialect.

Related PSA: https://discourse.llvm.org/t/psa-removal-of-typed-pointers-from-the-llvm-dialect/74502

---

Patch is 147.79 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/71232.diff


33 Files Affected:

- (removed) mlir/test/Conversion/FuncToLLVM/convert-types-typed-pointers.mlir (-40) 
- (modified) mlir/test/Conversion/GPUCommon/lower-launch-func-to-gpu-runtime-calls.mlir (+4-4) 
- (modified) mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir (+89-91) 
- (modified) mlir/test/Dialect/GPU/invalid.mlir (+10-10) 
- (modified) mlir/test/Dialect/GPU/module-to-binary-nvvm.mlir (+4-4) 
- (modified) mlir/test/Dialect/GPU/module-to-binary-rocdl.mlir (+4-4) 
- (modified) mlir/test/Dialect/GPU/outlining.mlir (+2-2) 
- (removed) mlir/test/Dialect/LLVMIR/canonicalize-typed-pointers.mlir (-86) 
- (removed) mlir/test/Dialect/LLVMIR/dynamic-gep-index-typed-pointers.mlir (-12) 
- (removed) mlir/test/Dialect/LLVMIR/global-typed-pointers.mlir (-46) 
- (removed) mlir/test/Dialect/LLVMIR/invalid-typed-pointers.mlir (-299) 
- (removed) mlir/test/Dialect/LLVMIR/layout-typed-pointers.mlir (-145) 
- (removed) mlir/test/Dialect/LLVMIR/nvvm-typed-pointers.mlir (-55) 
- (removed) mlir/test/Dialect/LLVMIR/parameter-attrs-invalid-typed-pointers.mlir (-6) 
- (modified) mlir/test/Dialect/LLVMIR/parameter-attrs-invalid.mlir (-15) 
- (removed) mlir/test/Dialect/LLVMIR/roundtrip-typed-pointers.mlir (-73) 
- (modified) mlir/test/Dialect/LLVMIR/sroa.mlir (-14) 
- (removed) mlir/test/Dialect/LLVMIR/types-invalid-typed-pointers.mlir (-42) 
- (removed) mlir/test/Dialect/LLVMIR/types-typed-pointers.mlir (-118) 
- (modified) mlir/test/Dialect/LLVMIR/types.mlir (+2-2) 
- (modified) mlir/test/Dialect/OpenACC/invalid.mlir (+34-38) 
- (modified) mlir/test/Dialect/OpenACC/ops.mlir (+140-140) 
- (modified) mlir/test/Dialect/OpenMP/canonicalize.mlir (+2-2) 
- (modified) mlir/test/Dialect/OpenMP/invalid.mlir (+42-42) 
- (modified) mlir/test/Dialect/OpenMP/ops.mlir (+86-86) 
- (modified) mlir/test/Dialect/SparseTensor/invalid.mlir (+4-4) 
- (modified) mlir/test/Dialect/SparseTensor/one_shot_bufferize_tensor_copy_insertion.mlir (+1-1) 
- (modified) mlir/test/Dialect/SparseTensor/rewriting_for_codegen.mlir (+15-15) 
- (modified) mlir/test/Dialect/SparseTensor/roundtrip.mlir (+8-8) 
- (modified) mlir/test/mlir-cpu-runner/simple.mlir (+13-15) 
- (modified) mlir/test/mlir-cpu-runner/x86-varargs.mlir (+17-19) 
- (modified) mlir/test/python/dialects/gpu/module-to-binary-nvvm.py (+4-4) 
- (modified) mlir/test/python/dialects/gpu/module-to-binary-rocdl.py (+4-4) 


``````````diff
diff --git a/mlir/test/Conversion/FuncToLLVM/convert-types-typed-pointers.mlir b/mlir/test/Conversion/FuncToLLVM/convert-types-typed-pointers.mlir
deleted file mode 100644
index c55bb8bb71c676b..000000000000000
--- a/mlir/test/Conversion/FuncToLLVM/convert-types-typed-pointers.mlir
+++ /dev/null
@@ -1,40 +0,0 @@
-// RUN: mlir-opt -test-convert-call-op %s | FileCheck %s
-
-// CHECK-LABEL: @ptr
-// CHECK: !llvm.ptr<i42>
-func.func private @ptr() -> !llvm.ptr<!test.smpla>
-
-// CHECK-LABEL: @opaque_ptr
-// CHECK: !llvm.ptr
-// CHECK-NOT: <
-func.func private @opaque_ptr() -> !llvm.ptr
-
-// CHECK-LABEL: @ptr_ptr()
-// CHECK: !llvm.ptr<ptr<i42>>
-func.func private @ptr_ptr() -> !llvm.ptr<!llvm.ptr<!test.smpla>>
-
-// CHECK-LABEL: @struct_ptr()
-// CHECK: !llvm.struct<(ptr<i42>)>
-func.func private @struct_ptr() -> !llvm.struct<(ptr<!test.smpla>)>
-
-// CHECK-LABEL: @named_struct_ptr()
-// CHECK: !llvm.struct<"_Converted_named", (ptr<i42>)>
-func.func private @named_struct_ptr() -> !llvm.struct<"named", (ptr<!test.smpla>)>
-
-// CHECK-LABEL: @named_no_convert
-// CHECK: !llvm.struct<"no_convert", (ptr<struct<"no_convert">>)>
-func.func private @named_no_convert() -> !llvm.struct<"no_convert", (ptr<struct<"no_convert">>)>
-
-// CHECK-LABEL: @array_ptr()
-// CHECK: !llvm.array<10 x ptr<i42>>
-func.func private @array_ptr() -> !llvm.array<10 x ptr<!test.smpla>>
-
-// CHECK-LABEL: @func()
-// CHECK: !llvm.ptr<func<i42 (i42)>>
-func.func private @func() -> !llvm.ptr<!llvm.func<!test.smpla (!test.smpla)>>
-
-// TODO: support conversion of recursive types in the conversion infra.
-// CHECK-LABEL: @named_recursive()
-// CHECK: !llvm.struct<"_Converted_recursive", (ptr<i42>, ptr<struct<"_Converted_recursive">>)>
-func.func private @named_recursive() -> !llvm.struct<"recursive", (ptr<!test.smpla>, ptr<struct<"recursive">>)>
-
diff --git a/mlir/test/Conversion/GPUCommon/lower-launch-func-to-gpu-runtime-calls.mlir b/mlir/test/Conversion/GPUCommon/lower-launch-func-to-gpu-runtime-calls.mlir
index 1b9afcdf50a17f0..f5462b579b5eb0c 100644
--- a/mlir/test/Conversion/GPUCommon/lower-launch-func-to-gpu-runtime-calls.mlir
+++ b/mlir/test/Conversion/GPUCommon/lower-launch-func-to-gpu-runtime-calls.mlir
@@ -10,8 +10,8 @@ module attributes {gpu.container_module} {
   gpu.module @kernel_module attributes {
       nvvm.cubin = "CUBIN", rocdl.hsaco = "HSACO"
   } {
-    llvm.func @kernel(%arg0: i32, %arg1: !llvm.ptr<f32>,
-        %arg2: !llvm.ptr<f32>, %arg3: i64, %arg4: i64,
+    llvm.func @kernel(%arg0: i32, %arg1: !llvm.ptr,
+        %arg2: !llvm.ptr, %arg3: i64, %arg4: i64,
         %arg5: i64) attributes {gpu.kernel} {
       llvm.return
     }
@@ -69,8 +69,8 @@ module attributes {gpu.container_module} {
   // CHECK: gpu.module
   // ROCDL: gpu.module
   gpu.module @kernel_module [#nvvm.target] {
-    llvm.func @kernel(%arg0: i32, %arg1: !llvm.ptr<f32>,
-        %arg2: !llvm.ptr<f32>, %arg3: i64, %arg4: i64,
+    llvm.func @kernel(%arg0: i32, %arg1: !llvm.ptr,
+        %arg2: !llvm.ptr, %arg3: i64, %arg4: i64,
         %arg5: i64) attributes {gpu.kernel} {
       llvm.return
     }
diff --git a/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir b/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
index 9c777703bb73970..bbf50617edf9448 100644
--- a/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
+++ b/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
@@ -88,30 +88,30 @@ func.func @wsloop(%arg0: index, %arg1: index, %arg2: index, %arg3: index, %arg4:
 // -----
 
 // CHECK-LABEL: @atomic_write
-// CHECK: (%[[ARG0:.*]]: !llvm.ptr<i32>)
+// CHECK: (%[[ARG0:.*]]: !llvm.ptr)
 // CHECK: %[[VAL0:.*]] = llvm.mlir.constant(1 : i32) : i32
-// CHECK: omp.atomic.write %[[ARG0]] = %[[VAL0]] memory_order(relaxed) : !llvm.ptr<i32>, i32
-func.func @atomic_write(%a: !llvm.ptr<i32>) -> () {
+// CHECK: omp.atomic.write %[[ARG0]] = %[[VAL0]] memory_order(relaxed) : !llvm.ptr, i32
+func.func @atomic_write(%a: !llvm.ptr) -> () {
   %1 = arith.constant 1 : i32
-  omp.atomic.write %a = %1 hint(none) memory_order(relaxed) : !llvm.ptr<i32>, i32
+  omp.atomic.write %a = %1 hint(none) memory_order(relaxed) : !llvm.ptr, i32
   return
 }
 
 // -----
 
 // CHECK-LABEL: @atomic_read
-// CHECK: (%[[ARG0:.*]]: !llvm.ptr<i32>, %[[ARG1:.*]]: !llvm.ptr<i32>)
-// CHECK: omp.atomic.read %[[ARG1]] = %[[ARG0]] memory_order(acquire) hint(contended) : !llvm.ptr<i32>
-func.func @atomic_read(%a: !llvm.ptr<i32>, %b: !llvm.ptr<i32>) -> () {
-  omp.atomic.read %b = %a memory_order(acquire) hint(contended) : !llvm.ptr<i32>, i32
+// CHECK: (%[[ARG0:.*]]: !llvm.ptr, %[[ARG1:.*]]: !llvm.ptr)
+// CHECK: omp.atomic.read %[[ARG1]] = %[[ARG0]] memory_order(acquire) hint(contended) : !llvm.ptr
+func.func @atomic_read(%a: !llvm.ptr, %b: !llvm.ptr) -> () {
+  omp.atomic.read %b = %a memory_order(acquire) hint(contended) : !llvm.ptr, i32
   return
 }
 
 // -----
 
 func.func @atomic_update() {
-  %0 = llvm.mlir.addressof @_QFsEc : !llvm.ptr<i32>
-  omp.atomic.update   %0 : !llvm.ptr<i32> {
+  %0 = llvm.mlir.addressof @_QFsEc : !llvm.ptr
+  omp.atomic.update   %0 : !llvm.ptr {
   ^bb0(%arg0: i32):
     %1 = arith.constant 1 : i32
     %2 = arith.addi %arg0, %1  : i32
@@ -125,8 +125,8 @@ llvm.mlir.global internal @_QFsEc() : i32 {
 }
 
 // CHECK-LABEL: @atomic_update
-// CHECK: %[[GLOBAL_VAR:.*]] = llvm.mlir.addressof @_QFsEc : !llvm.ptr<i32>
-// CHECK: omp.atomic.update   %[[GLOBAL_VAR]] : !llvm.ptr<i32> {
+// CHECK: %[[GLOBAL_VAR:.*]] = llvm.mlir.addressof @_QFsEc : !llvm.ptr
+// CHECK: omp.atomic.update   %[[GLOBAL_VAR]] : !llvm.ptr {
 // CHECK: ^bb0(%[[IN_VAL:.*]]: i32):
 // CHECK:   %[[CONST_1:.*]] = llvm.mlir.constant(1 : i32) : i32
 // CHECK:   %[[OUT_VAL:.*]] = llvm.add %[[IN_VAL]], %[[CONST_1]]  : i32
@@ -136,10 +136,10 @@ llvm.mlir.global internal @_QFsEc() : i32 {
 // -----
 
 // CHECK-LABEL: @threadprivate
-// CHECK: (%[[ARG0:.*]]: !llvm.ptr<i32>)
-// CHECK: %[[VAL0:.*]] = omp.threadprivate %[[ARG0]] : !llvm.ptr<i32> -> !llvm.ptr<i32>
-func.func @threadprivate(%a: !llvm.ptr<i32>) -> () {
-  %1 = omp.threadprivate %a : !llvm.ptr<i32> -> !llvm.ptr<i32>
+// CHECK: (%[[ARG0:.*]]: !llvm.ptr)
+// CHECK: %[[VAL0:.*]] = omp.threadprivate %[[ARG0]] : !llvm.ptr -> !llvm.ptr
+func.func @threadprivate(%a: !llvm.ptr) -> () {
+  %1 = omp.threadprivate %a : !llvm.ptr -> !llvm.ptr
   return
 }
 
@@ -175,15 +175,15 @@ func.func @simdloop_block_arg(%val : i32, %ub : i32, %i : index) {
 // -----
 
 // CHECK-LABEL: @task_depend
-// CHECK:  (%[[ARG0:.*]]: !llvm.ptr<i32>) {
-// CHECK:  omp.task depend(taskdependin -> %[[ARG0]] : !llvm.ptr<i32>) {
+// CHECK:  (%[[ARG0:.*]]: !llvm.ptr) {
+// CHECK:  omp.task depend(taskdependin -> %[[ARG0]] : !llvm.ptr) {
 // CHECK:    omp.terminator
 // CHECK:  }
 // CHECK:   llvm.return
 // CHECK: }
 
-func.func @task_depend(%arg0: !llvm.ptr<i32>) {
-  omp.task depend(taskdependin -> %arg0 : !llvm.ptr<i32>) {
+func.func @task_depend(%arg0: !llvm.ptr) {
+  omp.task depend(taskdependin -> %arg0 : !llvm.ptr) {
     omp.terminator
   }
   return
@@ -192,47 +192,47 @@ func.func @task_depend(%arg0: !llvm.ptr<i32>) {
 // -----
 
 // CHECK-LABEL: @_QPomp_target_data
-// CHECK: (%[[ARG0:.*]]: !llvm.ptr<i32>, %[[ARG1:.*]]: !llvm.ptr<i32>, %[[ARG2:.*]]: !llvm.ptr<i32>, %[[ARG3:.*]]: !llvm.ptr<i32>)
-// CHECK: %[[MAP0:.*]] = omp.map_info var_ptr(%[[ARG0]] : !llvm.ptr<i32>, i32)   map_clauses(to) capture(ByRef) -> !llvm.ptr<i32> {name = ""}
-// CHECK: %[[MAP1:.*]] = omp.map_info var_ptr(%[[ARG1]] : !llvm.ptr<i32>, i32)   map_clauses(to) capture(ByRef) -> !llvm.ptr<i32> {name = ""}
-// CHECK: %[[MAP2:.*]] = omp.map_info var_ptr(%[[ARG2]] : !llvm.ptr<i32>, i32)   map_clauses(always, exit_release_or_enter_alloc) capture(ByRef) -> !llvm.ptr<i32> {name = ""}
-// CHECK: omp.target_enter_data map_entries(%[[MAP0]], %[[MAP1]], %[[MAP2]] : !llvm.ptr<i32>, !llvm.ptr<i32>, !llvm.ptr<i32>)
-// CHECK: %[[MAP3:.*]] = omp.map_info var_ptr(%[[ARG0]] : !llvm.ptr<i32>, i32)   map_clauses(from) capture(ByRef) -> !llvm.ptr<i32> {name = ""}
-// CHECK: %[[MAP4:.*]] = omp.map_info var_ptr(%[[ARG1]] : !llvm.ptr<i32>, i32)   map_clauses(from) capture(ByRef) -> !llvm.ptr<i32> {name = ""}
-// CHECK: %[[MAP5:.*]] = omp.map_info var_ptr(%[[ARG2]] : !llvm.ptr<i32>, i32)   map_clauses(exit_release_or_enter_alloc) capture(ByRef) -> !llvm.ptr<i32> {name = ""}
-// CHECK: %[[MAP6:.*]] = omp.map_info var_ptr(%[[ARG3]] : !llvm.ptr<i32>, i32)   map_clauses(always, delete) capture(ByRef) -> !llvm.ptr<i32> {name = ""}
-// CHECK: omp.target_exit_data map_entries(%[[MAP3]], %[[MAP4]], %[[MAP5]], %[[MAP6]] : !llvm.ptr<i32>, !llvm.ptr<i32>, !llvm.ptr<i32>, !llvm.ptr<i32>)
-
-llvm.func @_QPomp_target_data(%a : !llvm.ptr<i32>, %b : !llvm.ptr<i32>, %c : !llvm.ptr<i32>, %d : !llvm.ptr<i32>) {
-  %0 = omp.map_info var_ptr(%a : !llvm.ptr<i32>, i32)   map_clauses(to) capture(ByRef) -> !llvm.ptr<i32> {name = ""}
-  %1 = omp.map_info var_ptr(%b : !llvm.ptr<i32>, i32)   map_clauses(to) capture(ByRef) -> !llvm.ptr<i32> {name = ""}
-  %2 = omp.map_info var_ptr(%c : !llvm.ptr<i32>, i32)   map_clauses(always, exit_release_or_enter_alloc) capture(ByRef) -> !llvm.ptr<i32> {name = ""}
-  omp.target_enter_data map_entries(%0, %1, %2 : !llvm.ptr<i32>, !llvm.ptr<i32>, !llvm.ptr<i32>) {}
-  %3 = omp.map_info var_ptr(%a : !llvm.ptr<i32>, i32)   map_clauses(from) capture(ByRef) -> !llvm.ptr<i32> {name = ""}
-  %4 = omp.map_info var_ptr(%b : !llvm.ptr<i32>, i32)   map_clauses(from) capture(ByRef) -> !llvm.ptr<i32> {name = ""}
-  %5 = omp.map_info var_ptr(%c : !llvm.ptr<i32>, i32)   map_clauses(exit_release_or_enter_alloc) capture(ByRef) -> !llvm.ptr<i32> {name = ""}
-  %6 = omp.map_info var_ptr(%d : !llvm.ptr<i32>, i32)   map_clauses(always, delete) capture(ByRef) -> !llvm.ptr<i32> {name = ""}
-  omp.target_exit_data map_entries(%3, %4, %5, %6 : !llvm.ptr<i32>, !llvm.ptr<i32>, !llvm.ptr<i32>, !llvm.ptr<i32>) {}
+// CHECK: (%[[ARG0:.*]]: !llvm.ptr, %[[ARG1:.*]]: !llvm.ptr, %[[ARG2:.*]]: !llvm.ptr, %[[ARG3:.*]]: !llvm.ptr)
+// CHECK: %[[MAP0:.*]] = omp.map_info var_ptr(%[[ARG0]] : !llvm.ptr, i32)   map_clauses(to) capture(ByRef) -> !llvm.ptr {name = ""}
+// CHECK: %[[MAP1:.*]] = omp.map_info var_ptr(%[[ARG1]] : !llvm.ptr, i32)   map_clauses(to) capture(ByRef) -> !llvm.ptr {name = ""}
+// CHECK: %[[MAP2:.*]] = omp.map_info var_ptr(%[[ARG2]] : !llvm.ptr, i32)   map_clauses(always, exit_release_or_enter_alloc) capture(ByRef) -> !llvm.ptr {name = ""}
+// CHECK: omp.target_enter_data map_entries(%[[MAP0]], %[[MAP1]], %[[MAP2]] : !llvm.ptr, !llvm.ptr, !llvm.ptr)
+// CHECK: %[[MAP3:.*]] = omp.map_info var_ptr(%[[ARG0]] : !llvm.ptr, i32)   map_clauses(from) capture(ByRef) -> !llvm.ptr {name = ""}
+// CHECK: %[[MAP4:.*]] = omp.map_info var_ptr(%[[ARG1]] : !llvm.ptr, i32)   map_clauses(from) capture(ByRef) -> !llvm.ptr {name = ""}
+// CHECK: %[[MAP5:.*]] = omp.map_info var_ptr(%[[ARG2]] : !llvm.ptr, i32)   map_clauses(exit_release_or_enter_alloc) capture(ByRef) -> !llvm.ptr {name = ""}
+// CHECK: %[[MAP6:.*]] = omp.map_info var_ptr(%[[ARG3]] : !llvm.ptr, i32)   map_clauses(always, delete) capture(ByRef) -> !llvm.ptr {name = ""}
+// CHECK: omp.target_exit_data map_entries(%[[MAP3]], %[[MAP4]], %[[MAP5]], %[[MAP6]] : !llvm.ptr, !llvm.ptr, !llvm.ptr, !llvm.ptr)
+
+llvm.func @_QPomp_target_data(%a : !llvm.ptr, %b : !llvm.ptr, %c : !llvm.ptr, %d : !llvm.ptr) {
+  %0 = omp.map_info var_ptr(%a : !llvm.ptr, i32)   map_clauses(to) capture(ByRef) -> !llvm.ptr {name = ""}
+  %1 = omp.map_info var_ptr(%b : !llvm.ptr, i32)   map_clauses(to) capture(ByRef) -> !llvm.ptr {name = ""}
+  %2 = omp.map_info var_ptr(%c : !llvm.ptr, i32)   map_clauses(always, exit_release_or_enter_alloc) capture(ByRef) -> !llvm.ptr {name = ""}
+  omp.target_enter_data map_entries(%0, %1, %2 : !llvm.ptr, !llvm.ptr, !llvm.ptr) {}
+  %3 = omp.map_info var_ptr(%a : !llvm.ptr, i32)   map_clauses(from) capture(ByRef) -> !llvm.ptr {name = ""}
+  %4 = omp.map_info var_ptr(%b : !llvm.ptr, i32)   map_clauses(from) capture(ByRef) -> !llvm.ptr {name = ""}
+  %5 = omp.map_info var_ptr(%c : !llvm.ptr, i32)   map_clauses(exit_release_or_enter_alloc) capture(ByRef) -> !llvm.ptr {name = ""}
+  %6 = omp.map_info var_ptr(%d : !llvm.ptr, i32)   map_clauses(always, delete) capture(ByRef) -> !llvm.ptr {name = ""}
+  omp.target_exit_data map_entries(%3, %4, %5, %6 : !llvm.ptr, !llvm.ptr, !llvm.ptr, !llvm.ptr) {}
   llvm.return
 }
 
 // -----
 
 // CHECK-LABEL: @_QPomp_target_data_region
-// CHECK: (%[[ARG0:.*]]: !llvm.ptr<array<1024 x i32>>, %[[ARG1:.*]]: !llvm.ptr<i32>) {
-// CHECK: %[[MAP_0:.*]] = omp.map_info var_ptr(%[[ARG0]] : !llvm.ptr<array<1024 x i32>>, !llvm.array<1024 x i32>)  map_clauses(tofrom) capture(ByRef) -> !llvm.ptr<array<1024 x i32>> {name = ""}
-// CHECK: omp.target_data map_entries(%[[MAP_0]] : !llvm.ptr<array<1024 x i32>>) {
+// CHECK: (%[[ARG0:.*]]: !llvm.ptr, %[[ARG1:.*]]: !llvm.ptr) {
+// CHECK: %[[MAP_0:.*]] = omp.map_info var_ptr(%[[ARG0]] : !llvm.ptr, !llvm.array<1024 x i32>)  map_clauses(tofrom) capture(ByRef) -> !llvm.ptr {name = ""}
+// CHECK: omp.target_data map_entries(%[[MAP_0]] : !llvm.ptr) {
 // CHECK:           %[[VAL_1:.*]] = llvm.mlir.constant(10 : i32) : i32
-// CHECK:           llvm.store %[[VAL_1]], %[[ARG1]] : !llvm.ptr<i32>
+// CHECK:           llvm.store %[[VAL_1]], %[[ARG1]] : i32, !llvm.ptr
 // CHECK:           omp.terminator
 // CHECK:         }
 // CHECK:         llvm.return
 
-llvm.func @_QPomp_target_data_region(%a : !llvm.ptr<array<1024 x i32>>, %i : !llvm.ptr<i32>) {
-  %1 = omp.map_info var_ptr(%a : !llvm.ptr<array<1024 x i32>>, !llvm.array<1024 x i32>)   map_clauses(tofrom) capture(ByRef) -> !llvm.ptr<array<1024 x i32>> {name = ""}
-  omp.target_data map_entries(%1 : !llvm.ptr<array<1024 x i32>>) {
+llvm.func @_QPomp_target_data_region(%a : !llvm.ptr, %i : !llvm.ptr) {
+  %1 = omp.map_info var_ptr(%a : !llvm.ptr, !llvm.array<1024 x i32>)   map_clauses(tofrom) capture(ByRef) -> !llvm.ptr {name = ""}
+  omp.target_data map_entries(%1 : !llvm.ptr) {
     %2 = llvm.mlir.constant(10 : i32) : i32
-    llvm.store %2, %i : !llvm.ptr<i32>
+    llvm.store %2, %i : i32, !llvm.ptr
     omp.terminator
   }
   llvm.return
@@ -241,24 +241,24 @@ llvm.func @_QPomp_target_data_region(%a : !llvm.ptr<array<1024 x i32>>, %i : !ll
 // -----
 
 // CHECK-LABEL:   llvm.func @_QPomp_target(
-// CHECK:                             %[[ARG_0:.*]]: !llvm.ptr<array<1024 x i32>>,
-// CHECK:                             %[[ARG_1:.*]]: !llvm.ptr<i32>) {
+// CHECK:                             %[[ARG_0:.*]]: !llvm.ptr,
+// CHECK:                             %[[ARG_1:.*]]: !llvm.ptr) {
 // CHECK:           %[[VAL_0:.*]] = llvm.mlir.constant(64 : i32) : i32
-// CHECK:           %[[MAP:.*]] = omp.map_info var_ptr(%[[ARG_0]] : !llvm.ptr<array<1024 x i32>>, !llvm.array<1024 x i32>)   map_clauses(tofrom) capture(ByRef) -> !llvm.ptr<array<1024 x i32>> {name = ""}
-// CHECK:           omp.target   thread_limit(%[[VAL_0]] : i32) map_entries(%[[MAP]] : !llvm.ptr<array<1024 x i32>>) {
+// CHECK:           %[[MAP:.*]] = omp.map_info var_ptr(%[[ARG_0]] : !llvm.ptr, !llvm.array<1024 x i32>)   map_clauses(tofrom) capture(ByRef) -> !llvm.ptr {name = ""}
+// CHECK:           omp.target   thread_limit(%[[VAL_0]] : i32) map_entries(%[[MAP]] : !llvm.ptr) {
 // CHECK:             %[[VAL_1:.*]] = llvm.mlir.constant(10 : i32) : i32
-// CHECK:             llvm.store %[[VAL_1]], %[[ARG_1]] : !llvm.ptr<i32>
+// CHECK:             llvm.store %[[VAL_1]], %[[ARG_1]] : i32, !llvm.ptr
 // CHECK:             omp.terminator
 // CHECK:           }
 // CHECK:           llvm.return
 // CHECK:         }
 
-llvm.func @_QPomp_target(%a : !llvm.ptr<array<1024 x i32>>, %i : !llvm.ptr<i32>) {
+llvm.func @_QPomp_target(%a : !llvm.ptr, %i : !llvm.ptr) {
   %0 = llvm.mlir.constant(64 : i32) : i32
-  %1 = omp.map_info var_ptr(%a : !llvm.ptr<array<1024 x i32>>, !llvm.array<1024 x i32>)   map_clauses(tofrom) capture(ByRef) -> !llvm.ptr<array<1024 x i32>> {name = ""}
-  omp.target   thread_limit(%0 : i32) map_entries(%1 : !llvm.ptr<array<1024 x i32>>) {
+  %1 = omp.map_info var_ptr(%a : !llvm.ptr, !llvm.array<1024 x i32>)   map_clauses(tofrom) capture(ByRef) -> !llvm.ptr {name = ""}
+  omp.target   thread_limit(%0 : i32) map_entries(%1 : !llvm.ptr) {
     %2 = llvm.mlir.constant(10 : i32) : i32
-    llvm.store %2, %i : !llvm.ptr<i32>
+    llvm.store %2, %i : i32, !llvm.ptr
     omp.terminator
   }
   llvm.return
@@ -314,10 +314,10 @@ llvm.func @_QPsb() {
 // CHECK:    %[[COMBINE_VAL_EXT:.*]] = llvm.zext %[[COMBINE_VAL]] : i1 to i32
 // CHECK:    omp.yield(%[[COMBINE_VAL_EXT]] : i32)
 // CHECK-LABEL:  @_QPsimple_reduction
-// CHECK:    %[[RED_ACCUMULATOR:.*]] = llvm.alloca %{{.*}} x i32 {bindc_name = "x", uniq_name = "_QFsimple_reductionEx"} : (i64) -> !llvm.ptr<i32>
+// CHECK:    %[[RED_ACCUMULATOR:.*]] = llvm.alloca %{{.*}} x i32 {bindc_name = "x", uniq_name = "_QFsimple_reductionEx"} : (i64) -> !llvm.ptr
 // CHECK:    omp.parallel
-// CHECK:      omp.wsloop reduction(@eqv_reduction -> %[[RED_ACCUMULATOR]] : !llvm.ptr<i32>) for
-// CHECK:        omp.reduction %{{.*}}, %[[RED_ACCUMULATOR]] : i32, !llvm.ptr<i32>
+// CHECK:      omp.wsloop reduction(@eqv_reduction -> %[[RED_ACCUMULATOR]] : !llvm.ptr) for
+// CHECK:        omp.reduction %{{.*}}, %[[RED_ACCUMULATOR]] : i32, !llvm.ptr
 // CHECK:        omp.yield
 // CHECK:      omp.terminator
 // CHECK:    llvm.return
@@ -336,24 +336,24 @@ omp.reduction.declare @eqv_reduction : i32 init {
   %4 = llvm.zext %3 : i1 to i32
   omp.yield(%4 : i32)
 }
-llvm.func @_QPsimple_reduction(%arg0: !llvm.ptr<array<100 x i32>> {fir.bindc_name = "y"}) {
+llvm.func @_QPsimple_reduction(%arg0: !llvm.ptr {fir.bindc_name = "y"}) {
   %0 = llvm.mlir.constant(100 : i32) : i32
   %1 = llvm.mlir.constant(1 : i32) : i32
   %2 = llvm.mlir.constant(true) : i1
   %3 = llvm.mlir.constant(1 : i64) : i64
-  %4 = llvm.alloca %3 x i32 {bindc_name = "x", uniq_name = "_QFsimple_reductionEx"} : (i64) -> !llvm.ptr<i32>
+  %4 = llvm.alloca %3 x i32 {bindc_name = "x", uniq_name = "_QFsimple_reductionEx"} : (i64) -> !llvm.ptr
   %5 = llvm.zext %2 : i1 to i32
-  llvm.store %5, %4 : !llvm.ptr<i32>
+  llvm.store %5, %4 : i32, !llvm.ptr
   omp.parallel   {
-    %6 = llvm.alloca %3 x i32 {adapt.valuebyref, in_type = i32, operandSegmentSizes = array<i32: 0, 0>, pinned} : (i64) -> !llvm.ptr<i32>
-    omp.wsloop   reduction(@eqv_reduction -> %4 : !llvm.ptr<i32>) for  (%arg1) : i32 = (%1) to (%0) inclusive step (%1) {
-      llvm.store %arg1, %6 : !llvm.ptr<i32>
-      %7 = llvm.load %6 : !llvm.ptr<i32>
+    %6 = llvm.alloca %3 x i32 {adapt.valuebyref, in_type = i32, operandSegmentSizes = array<i32: 0, 0>, pinned} : (i64) -> !llvm.ptr
+    omp.wsloop   reduction(@eqv_reduction -> %4 : !llvm.ptr) for  (%arg1) : i32 = (%1) to (%0) inclusive step (%1) {
+      llvm.store %arg1, %6 : i32, !llvm.ptr
+      %7 = llvm.load %6 : !llvm.ptr -> i32
       %8 = llvm.sext %7 : i32 to i64
       %9 = llvm.sub %8, %3  : i64
-      %10 = llvm.getelementptr %arg0[0, %9] : (!llvm.ptr<array<100 x i32>>, i64) -> !llvm.ptr<i32>
-      %11 = llvm.load %10 : !llvm.ptr<i32>
-      omp.reduction %11, %4 : i32, !llvm.ptr<i32>
+      %10 = llvm.getelementptr %arg0[0, %9] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i32>
+      %11 = llvm.load %10 : !llvm.ptr -> i32
+      omp.reduction %11, %4 : i32, !llvm.ptr
       omp.yield
     }
     omp.terminator
@@ -369,7 +369,7 @@ llvm.func @_QQmain() {
   %1 = llvm.mlir.constant(5 : index) : i64
   %2 = llvm.mlir.constant(1 : index) : i64
   %3 = llvm.mlir.constant(1 : i64) : i64
-  %4 = llvm.alloca %3 x i32 : (i64) -> !llvm.ptr<i32>
+  %4 = llvm.alloca %3 x i32 : (i64) -> !llvm.ptr
 // CHECK: omp.taskgroup
   omp.taskgroup   {
     %5 = llvm.trunc %2 : i64 to i32
@@ -378,27 +378,27 @@ llvm.func @_QQmain() {
     %8 = llvm.icmp "sgt" %7, %0 : i64
     llvm.cond_br %8, ^bb2, ^bb3
   ^bb2:  // pred: ^bb1
-    llvm.store %6, %4 : !llvm.ptr<i32>
+    llvm.store %6, %4 : i32, !llvm.ptr
 // CHECK: omp.task
     omp.task   {
 // CHECK: llvm.call @[[CALL_FUNC:.*]]({{.*}}) :
-      llvm.call @_QFPdo_work(%4) : (!llvm.ptr<i32>) -> ()
+      llvm.call @_QFPdo_work(%4) : (!llvm.ptr) -> ()
 // CHECK: omp.terminator
       omp.terminator
     }
-    %9 = llvm.load %4 : !llvm.ptr<i32>
+    %9 = llvm.load %4 : !llvm.ptr -> i32
     %10 = llvm.add %9, %5  : i32
     %11 = llvm.sub %7, %2  : i64
     llvm.br ^bb1(%10, %11 : i32, i64)
   ^bb3:  // pred: ^bb1
-    llvm.store %6, %4 : !llvm.ptr<i32>
+   ...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/71232


More information about the Mlir-commits mailing list