[Mlir-commits] [mlir] 7dd974a - [mlir][llvm] Drop opaque ptr test in LLVM IR import.

Tobias Gysi llvmlistbot at llvm.org
Mon Feb 6 01:20:33 PST 2023


Author: Tobias Gysi
Date: 2023-02-06T10:18:30+01:00
New Revision: 7dd974a11532c7495f54168f69d6ab3942308fbe

URL: https://github.com/llvm/llvm-project/commit/7dd974a11532c7495f54168f69d6ab3942308fbe
DIFF: https://github.com/llvm/llvm-project/commit/7dd974a11532c7495f54168f69d6ab3942308fbe.diff

LOG: [mlir][llvm] Drop opaque ptr test in LLVM IR import.

After switching all LLVM IR import tests to opaque pointers
the specialized opaque pointer test file is redundant.

Reviewed By: Dinistro

Differential Revision: https://reviews.llvm.org/D143370

Added: 
    

Modified: 
    mlir/test/Target/LLVMIR/Import/instructions.ll

Removed: 
    mlir/test/Target/LLVMIR/Import/opaque.ll


################################################################################
diff  --git a/mlir/test/Target/LLVMIR/Import/instructions.ll b/mlir/test/Target/LLVMIR/Import/instructions.ll
index 438b4f0c3584..15abc3dc96a7 100644
--- a/mlir/test/Target/LLVMIR/Import/instructions.ll
+++ b/mlir/test/Target/LLVMIR/Import/instructions.ll
@@ -448,7 +448,7 @@ define void @indirect_call(ptr addrspace(42) %fn) {
 ; CHECK-SAME:  %[[PTR:[a-zA-Z0-9]+]]
 define void @gep_static_idx(ptr %ptr) {
   ; CHECK: %[[IDX:.+]] = llvm.mlir.constant(7 : i32)
-  ; CHECK: llvm.getelementptr inbounds %[[PTR]][%[[IDX]]] : (!llvm.ptr, i32) -> !llvm.ptr
+  ; CHECK: llvm.getelementptr inbounds %[[PTR]][%[[IDX]]] : (!llvm.ptr, i32) -> !llvm.ptr, f32
   %1 = getelementptr inbounds float, ptr %ptr, i32 7
   ret void
 }
@@ -476,7 +476,7 @@ define void @varargs_call(i32 %0) {
 ; CHECK-SAME:  %[[IDX:[a-zA-Z0-9]+]]
 define void @gep_dynamic_idx(ptr %ptr, i32 %idx) {
   ; CHECK: %[[C0:.+]] = llvm.mlir.constant(0 : i32)
-  ; CHECK: llvm.getelementptr %[[PTR]][%[[C0]], 1, %[[IDX]]]
+  ; CHECK: llvm.getelementptr %[[PTR]][%[[C0]], 1, %[[IDX]]]{{.*}}"my_struct"
   %1 = getelementptr %my_struct, ptr %ptr, i32 0, i32 1, i32 %idx
   ret void
 }

diff  --git a/mlir/test/Target/LLVMIR/Import/opaque.ll b/mlir/test/Target/LLVMIR/Import/opaque.ll
deleted file mode 100644
index 2d20b2c0b771..000000000000
--- a/mlir/test/Target/LLVMIR/Import/opaque.ll
+++ /dev/null
@@ -1,53 +0,0 @@
-; RUN: mlir-translate -import-llvm -split-input-file -opaque-pointers %s | FileCheck %s
-
-; CHECK-LABEL: @opaque_ptr_load
-define i32 @opaque_ptr_load(ptr %0) {
-  ; CHECK: = llvm.load %{{.*}} : !llvm.ptr -> i32
-  %2 = load i32, ptr %0, align 4
-  ret i32 %2
-}
-
-; // -----
-
-; CHECK-LABEL: @opaque_ptr_store
-define void @opaque_ptr_store(i32 %0, ptr %1) {
-  ; CHECK: llvm.store %{{.*}}, %{{.*}} : i32, !llvm.ptr
-  store i32 %0, ptr %1, align 4
-  ret void
-}
-
-; // -----
-
-; CHECK-LABEL: @opaque_ptr_ptr_store
-define void @opaque_ptr_ptr_store(ptr %0, ptr %1) {
-  ; CHECK: llvm.store %{{.*}}, %{{.*}} : !llvm.ptr, !llvm.ptr
-  store ptr %0, ptr %1, align 8
-  ret void
-}
-
-; // -----
-
-; CHECK-LABEL: @opaque_ptr_alloca
-define ptr @opaque_ptr_alloca(i32 %0) {
-  ; CHECK: = llvm.alloca %{{.*}} x f32 {alignment = 4 : i64} : (i32) -> !llvm.ptr
-  %2 = alloca float, i32 %0, align 4
-  ret ptr %2
-}
-
-; // -----
-
-; CHECK-LABEL: @opaque_ptr_gep
-define ptr @opaque_ptr_gep(ptr %0, i32 %1) {
-  ; CHECK: = llvm.getelementptr inbounds %{{.*}}[%{{.*}}] : (!llvm.ptr, i32) -> !llvm.ptr, f32
-  %3 = getelementptr inbounds float, ptr %0, i32 %1
-  ret ptr %3
-}
-
-; // -----
-
-; CHECK-LABEL: @opaque_ptr_gep
-define ptr @opaque_ptr_gep_struct(ptr %0, i32 %1){
-  ; CHECK: = llvm.getelementptr %{{.*}}[%{{.*}}, 0, 1] : (!llvm.ptr, i32) -> !llvm.ptr, !llvm.struct<(struct<(f32, f64)>, struct<(i32, i64)>)>
-  %3 = getelementptr { { float, double }, { i32, i64 } }, ptr %0, i32 %1, i32 0, i32 1
-  ret ptr %3
-}


        


More information about the Mlir-commits mailing list