[llvm] f8feb64 - [GlobalMerge] Convert tests to opaque pointers (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 10 03:34:28 PST 2023


Author: Nikita Popov
Date: 2023-01-10T12:34:20+01:00
New Revision: f8feb64949eb87468b381c9edc7287183cd11eda

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

LOG: [GlobalMerge] Convert tests to opaque pointers (NFC)

Added: 
    

Modified: 
    llvm/test/Transforms/GlobalMerge/alignment-2.ll
    llvm/test/Transforms/GlobalMerge/alignment.ll
    llvm/test/Transforms/GlobalMerge/basic.ll
    llvm/test/Transforms/GlobalMerge/used.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/GlobalMerge/alignment-2.ll b/llvm/test/Transforms/GlobalMerge/alignment-2.ll
index 3bcbea83ff4fa..194421613e81e 100644
--- a/llvm/test/Transforms/GlobalMerge/alignment-2.ll
+++ b/llvm/test/Transforms/GlobalMerge/alignment-2.ll
@@ -7,16 +7,16 @@ target triple = "x86_64-unknown-linux-gnu"
 ; the AsmPrinter would do.
 ; CHECK: @_MergedGlobals = private global <{ [2 x i32], [2 x i32] }> <{ [2 x i32] [i32 1, i32 1], [2 x i32] [i32 2, i32 2] }>, align 4
 
-; CHECK: @a = internal alias [2 x i32], getelementptr inbounds (<{ [2 x i32], [2 x i32] }>, <{ [2 x i32], [2 x i32] }>* @_MergedGlobals, i32 0, i32 0)
+; CHECK: @a = internal alias [2 x i32], ptr @_MergedGlobals
 @a = internal global [2 x i32] [i32 1, i32 1], align 1
 
-; CHECK: @b = internal alias [2 x i32], getelementptr inbounds (<{ [2 x i32], [2 x i32] }>, <{ [2 x i32], [2 x i32] }>* @_MergedGlobals, i32 0, i32 1)
+; CHECK: @b = internal alias [2 x i32], getelementptr inbounds (<{ [2 x i32], [2 x i32] }>, ptr @_MergedGlobals, i32 0, i32 1)
 @b = internal global [2 x i32] [i32 2, i32 2], align 1
 
 define void @use() {
-  ; CHECK: load i32, i32* getelementptr inbounds (<{ [2 x i32], [2 x i32] }>, <{ [2 x i32], [2 x i32] }>* @_MergedGlobals, i32 0, i32 0, i32 0)
-  %x = load i32, i32* bitcast ([2 x i32]* @a to i32*)
-  ; CHECK: load i32, i32* getelementptr inbounds (<{ [2 x i32], [2 x i32] }>, <{ [2 x i32], [2 x i32] }>* @_MergedGlobals, i32 0, i32 1, i32 0)
-  %y = load i32, i32* bitcast ([2 x i32]* @b to i32*)
+  ; CHECK: load i32, ptr @_MergedGlobals
+  %x = load i32, ptr @a
+  ; CHECK: load i32, ptr getelementptr inbounds (<{ [2 x i32], [2 x i32] }>, ptr @_MergedGlobals, i32 0, i32 1)
+  %y = load i32, ptr @b
   ret void
 }

diff  --git a/llvm/test/Transforms/GlobalMerge/alignment.ll b/llvm/test/Transforms/GlobalMerge/alignment.ll
index e93dcb106a10c..e3c3eb3ce065b 100644
--- a/llvm/test/Transforms/GlobalMerge/alignment.ll
+++ b/llvm/test/Transforms/GlobalMerge/alignment.ll
@@ -5,16 +5,16 @@ target triple = "x86_64-unknown-linux-gnu"
 
 ; CHECK: @_MergedGlobals = private global <{ [5 x i8], [3 x i8], [2 x i32] }> <{ [5 x i8] c"\01\01\01\01\01", [3 x i8] zeroinitializer, [2 x i32] [i32 2, i32 2] }>, align 4
 
-; CHECK: @a = internal alias [5 x i8], getelementptr inbounds (<{ [5 x i8], [3 x i8], [2 x i32] }>, <{ [5 x i8], [3 x i8], [2 x i32] }>* @_MergedGlobals, i32 0, i32 0)
+; CHECK: @a = internal alias [5 x i8], ptr @_MergedGlobals
 @a = internal global [5 x i8] [i8 1, i8 1, i8 1, i8 1, i8 1], align 4
 
-; CHECK: @b = internal alias [2 x i32], getelementptr inbounds (<{ [5 x i8], [3 x i8], [2 x i32] }>, <{ [5 x i8], [3 x i8], [2 x i32] }>* @_MergedGlobals, i32 0, i32 2)
+; CHECK: @b = internal alias [2 x i32], getelementptr inbounds (<{ [5 x i8], [3 x i8], [2 x i32] }>, ptr @_MergedGlobals, i32 0, i32 2)
 @b = internal global [2 x i32] [i32 2, i32 2]
 
 define void @use() {
-  ; CHECK: load i32, i32* bitcast (<{ [5 x i8], [3 x i8], [2 x i32] }>* @_MergedGlobals to i32*)
-  %x = load i32, i32* bitcast ([5 x i8]* @a to i32*)
-  ; CHECK: load i32, i32* getelementptr inbounds (<{ [5 x i8], [3 x i8], [2 x i32] }>, <{ [5 x i8], [3 x i8], [2 x i32] }>* @_MergedGlobals, i32 0, i32 2, i32 0)
-  %y = load i32, i32* bitcast ([2 x i32]* @b to i32*)
+  ; CHECK: load i32, ptr @_MergedGlobals
+  %x = load i32, ptr @a
+  ; CHECK: load i32, ptr getelementptr inbounds (<{ [5 x i8], [3 x i8], [2 x i32] }>, ptr @_MergedGlobals, i32 0, i32 2)
+  %y = load i32, ptr @b
   ret void
 }

diff  --git a/llvm/test/Transforms/GlobalMerge/basic.ll b/llvm/test/Transforms/GlobalMerge/basic.ll
index 4244ae77031aa..69d897d04a1a0 100644
--- a/llvm/test/Transforms/GlobalMerge/basic.ll
+++ b/llvm/test/Transforms/GlobalMerge/basic.ll
@@ -6,26 +6,26 @@ target triple = "x86_64-unknown-linux-gnu"
 ; CHECK: @_MergedGlobals = private global <{ i32, i32 }> <{ i32 3, i32 4 }>, section "foo", align 4
 ; CHECK: @_MergedGlobals.1 = private global <{ i32, i32 }> <{ i32 1, i32 2 }>, align 4
 
-; CHECK-DAG: @a = internal alias i32, getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals.1, i32 0, i32 0)
+; CHECK-DAG: @a = internal alias i32, ptr @_MergedGlobals.1
 @a = internal global i32 1
 
-; CHECK-DAG: @b = internal alias i32, getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals.1, i32 0, i32 1)
+; CHECK-DAG: @b = internal alias i32, getelementptr inbounds (<{ i32, i32 }>, ptr @_MergedGlobals.1, i32 0, i32 1)
 @b = internal global i32 2
 
-; CHECK-DAG: @c = internal alias i32, getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 0)
+; CHECK-DAG: @c = internal alias i32, ptr @_MergedGlobals
 @c = internal global i32 3, section "foo"
 
-; CHECK-DAG: @d = internal alias i32, getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 1)
+; CHECK-DAG: @d = internal alias i32, getelementptr inbounds (<{ i32, i32 }>, ptr @_MergedGlobals, i32 0, i32 1)
 @d = internal global i32 4, section "foo"
 
 define void @use() {
-  ; CHECK: load i32, i32* getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals.1, i32 0, i32 0)
-  %x = load i32, i32* @a
-  ; CHECK: load i32, i32* getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals.1, i32 0, i32 1)
-  %y = load i32, i32* @b
-  ; CHECK: load i32, i32* getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 0)
-  %z1 = load i32, i32* @c
-  ; CHECK: load i32, i32* getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 1)
-  %z2 = load i32, i32* @d
+  ; CHECK: load i32, ptr @_MergedGlobals.1
+  %x = load i32, ptr @a
+  ; CHECK: load i32, ptr getelementptr inbounds (<{ i32, i32 }>, ptr @_MergedGlobals.1, i32 0, i32 1)
+  %y = load i32, ptr @b
+  ; CHECK: load i32, ptr @_MergedGlobals
+  %z1 = load i32, ptr @c
+  ; CHECK: load i32, ptr getelementptr inbounds (<{ i32, i32 }>, ptr @_MergedGlobals, i32 0, i32 1)
+  %z2 = load i32, ptr @d
   ret void
 }

diff  --git a/llvm/test/Transforms/GlobalMerge/used.ll b/llvm/test/Transforms/GlobalMerge/used.ll
index 0cb29e08a6b0c..18a68d1a737a9 100644
--- a/llvm/test/Transforms/GlobalMerge/used.ll
+++ b/llvm/test/Transforms/GlobalMerge/used.ll
@@ -13,17 +13,17 @@ target triple = "x86_64-unknown-linux-gnu"
 
 @d = internal global i32 3
 
- at llvm.used = appending global [1 x i8*] [i8* bitcast (i32* @a to i8*)], section "llvm.metadata"
- at llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32* @b to i8*)], section "llvm.metadata"
+ at llvm.used = appending global [1 x ptr] [ptr @a], section "llvm.metadata"
+ at llvm.compiler.used = appending global [1 x ptr] [ptr @b], section "llvm.metadata"
 
 define void @use() {
-  ; CHECK: load i32, i32* @a
-  %x = load i32, i32* @a
-  ; CHECK: load i32, i32* @b
-  %y = load i32, i32* @b
-  ; CHECK: load i32, i32* getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 0)
-  %z1 = load i32, i32* @c
-  ; CHECK: load i32, i32* getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 1)
-  %z2 = load i32, i32* @d
+  ; CHECK: load i32, ptr @a
+  %x = load i32, ptr @a
+  ; CHECK: load i32, ptr @b
+  %y = load i32, ptr @b
+  ; CHECK: load i32, ptr @_MergedGlobals
+  %z1 = load i32, ptr @c
+  ; CHECK: load i32, ptr getelementptr inbounds (<{ i32, i32 }>, ptr @_MergedGlobals, i32 0, i32 1)
+  %z2 = load i32, ptr @d
   ret void
 }


        


More information about the llvm-commits mailing list