[llvm] 7dc1009 - llvm-split: Convert tests to opaque pointers
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 28 06:48:50 PST 2022
Author: Matt Arsenault
Date: 2022-11-28T09:48:21-05:00
New Revision: 7dc1009d13765fe2f29d232d575e9c39328ac07b
URL: https://github.com/llvm/llvm-project/commit/7dc1009d13765fe2f29d232d575e9c39328ac07b
DIFF: https://github.com/llvm/llvm-project/commit/7dc1009d13765fe2f29d232d575e9c39328ac07b.diff
LOG: llvm-split: Convert tests to opaque pointers
global.ll and scc-const-alias.ll needed some manual fixups; the script
seems to not correctly deal with constantexpr bitcasts.
Added:
Modified:
llvm/test/tools/llvm-split/alias.ll
llvm/test/tools/llvm-split/blockaddress.ll
llvm/test/tools/llvm-split/global.ll
llvm/test/tools/llvm-split/personality.ll
llvm/test/tools/llvm-split/preserve-locals.ll
llvm/test/tools/llvm-split/scc-alias.ll
llvm/test/tools/llvm-split/scc-const-alias.ll
llvm/test/tools/llvm-split/scc-constants.ll
llvm/test/tools/llvm-split/scc-global-alias.ll
llvm/test/tools/llvm-split/scc-global2global.ll
Removed:
################################################################################
diff --git a/llvm/test/tools/llvm-split/alias.ll b/llvm/test/tools/llvm-split/alias.ll
index 18e0e7f12d691..4e10b411a6367 100644
--- a/llvm/test/tools/llvm-split/alias.ll
+++ b/llvm/test/tools/llvm-split/alias.ll
@@ -2,18 +2,18 @@
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
-; CHECK0-DAG: @afoo = alias [2 x i8*], [2 x i8*]* @foo
-; CHECK1-DAG: @afoo = external global [2 x i8*]
- at afoo = alias [2 x i8*], [2 x i8*]* @foo
+; CHECK0-DAG: @afoo = alias [2 x ptr], ptr @foo
+; CHECK1-DAG: @afoo = external global [2 x ptr]
+ at afoo = alias [2 x ptr], ptr @foo
; CHECK0-DAG: declare void @abar()
-; CHECK1-DAG: @abar = alias void (), void ()* @bar
- at abar = alias void (), void ()* @bar
+; CHECK1-DAG: @abar = alias void (), ptr @bar
+ at abar = alias void (), ptr @bar
- at foo = global [2 x i8*] [i8* bitcast (void ()* @bar to i8*), i8* bitcast (void ()* @abar to i8*)]
+ at foo = global [2 x ptr] [ptr @bar, ptr @abar]
define void @bar() {
- store [2 x i8*] zeroinitializer, [2 x i8*]* @foo
- store [2 x i8*] zeroinitializer, [2 x i8*]* @afoo
+ store [2 x ptr] zeroinitializer, ptr @foo
+ store [2 x ptr] zeroinitializer, ptr @afoo
ret void
}
diff --git a/llvm/test/tools/llvm-split/blockaddress.ll b/llvm/test/tools/llvm-split/blockaddress.ll
index 2672f8f98490b..a18fc276e0e14 100644
--- a/llvm/test/tools/llvm-split/blockaddress.ll
+++ b/llvm/test/tools/llvm-split/blockaddress.ll
@@ -6,10 +6,10 @@
; RUN: llvm-dis -o - %t3 | FileCheck --check-prefix=CHECK1234 %s
; RUN: llvm-dis -o - %t4 | FileCheck --check-prefix=CHECK1234 %s
-; CHECK0: @xxx = global [2 x i8*] [i8* blockaddress(@f, %exit), i8* blockaddress(@g, %exit)]
-; CHECK1234: @xxx = external global [2 x i8*]
+; CHECK0: @xxx = global [2 x ptr] [ptr blockaddress(@f, %exit), ptr blockaddress(@g, %exit)]
+; CHECK1234: @xxx = external global [2 x ptr]
; CHECK1234-NOT: blockaddress
- at xxx = global [2 x i8*] [i8* blockaddress(@f, %exit), i8* blockaddress(@g, %exit)]
+ at xxx = global [2 x ptr] [ptr blockaddress(@f, %exit), ptr blockaddress(@g, %exit)]
; CHECK0: define i32 @f()
; CHECK1234: declare i32 @f()
@@ -29,9 +29,9 @@ exit:
ret i32 0
}
-; CHECK0: define i8* @h()
-; CHECK1234: declare i8* @h()
-define i8* @h(){
+; CHECK0: define ptr @h()
+; CHECK1234: declare ptr @h()
+define ptr @h(){
entry:
- ret i8* blockaddress(@f, %exit)
+ ret ptr blockaddress(@f, %exit)
}
diff --git a/llvm/test/tools/llvm-split/global.ll b/llvm/test/tools/llvm-split/global.ll
index 6d2425691e105..0b379fe8bb745 100644
--- a/llvm/test/tools/llvm-split/global.ll
+++ b/llvm/test/tools/llvm-split/global.ll
@@ -2,10 +2,10 @@
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
-; CHECK0: @foo = global i8* bitcast
-; CHECK1: @foo = external global i8*
- at foo = global i8* bitcast (i8** @bar to i8*)
+; CHECK0: @foo = global ptr @bar
+; CHECK1: @foo = external global ptr
+ at foo = global ptr @bar
-; CHECK0: @bar = external global i8*
-; CHECK1: @bar = global i8* bitcast
- at bar = global i8* bitcast (i8** @foo to i8*)
+; CHECK0: @bar = external global ptr
+; CHECK1: @bar = global ptr @foo
+ at bar = global ptr @foo
diff --git a/llvm/test/tools/llvm-split/personality.ll b/llvm/test/tools/llvm-split/personality.ll
index 50a4fb235b902..bef5faf2398cb 100644
--- a/llvm/test/tools/llvm-split/personality.ll
+++ b/llvm/test/tools/llvm-split/personality.ll
@@ -11,8 +11,8 @@ define void @foo() {
; CHECK0: declare void @bar()
; CHECK0-NOT: personality
-; CHECK1: define void @bar() personality i8* bitcast (void ()* @foo to i8*)
-define void @bar() personality i8* bitcast (void ()* @foo to i8*)
+; CHECK1: define void @bar() personality ptr @foo
+define void @bar() personality ptr @foo
{
ret void
}
diff --git a/llvm/test/tools/llvm-split/preserve-locals.ll b/llvm/test/tools/llvm-split/preserve-locals.ll
index 070ff065193bf..d128daaf35dd7 100644
--- a/llvm/test/tools/llvm-split/preserve-locals.ll
+++ b/llvm/test/tools/llvm-split/preserve-locals.ll
@@ -18,7 +18,7 @@
; Function Attrs: nounwind
define i32 @main(i32 %x) {
entry:
- %call = call fastcc i32 @foo(i32 %x, i32* nonnull @a)
+ %call = call fastcc i32 @foo(i32 %x, ptr nonnull @a)
%call1 = call fastcc i32 @baz(i32 %x)
%add = add nsw i32 %call, %call1
ret i32 %add
@@ -34,23 +34,23 @@ entry:
; Function Attrs: nounwind
define fastcc i32 @baz(i32 %x) {
entry:
- store i32 %x, i32* @global_storage, align 4
+ store i32 %x, ptr @global_storage, align 4
%shl = shl i32 %x, %x
ret i32 %shl
}
; Function Attrs: noinline nounwind
-define fastcc i32 @foo(i32 %a, i32* nocapture %b) {
+define fastcc i32 @foo(i32 %a, ptr nocapture %b) {
entry:
call fastcc void @local_func()
%call = call fastcc i32 @bar(i32 %a)
- %0 = load i32, i32* @global_storage, align 4
+ %0 = load i32, ptr @global_storage, align 4
%call1 = call fastcc i32 @baz(i32 %0)
%add = add nsw i32 %call, %call1
- store i32 %add, i32* %b, align 4
+ store i32 %add, ptr %b, align 4
%call.i = call fastcc i32 @baz(i32 %add) #2
%add.i = add nsw i32 %call.i, 2
- %1 = load volatile i32, i32* @local_var, align 4
+ %1 = load volatile i32, ptr @local_var, align 4
%add3 = add nsw i32 %add.i, %1
ret i32 %add3
}
@@ -58,8 +58,8 @@ entry:
; Function Attrs: noinline nounwind
define internal fastcc void @local_func() section ".text" {
entry:
- %0 = load i32, i32* @global_storage, align 4
- %call = call fastcc i32 @foo(i32 %0, i32* null)
- store volatile i32 %call, i32* @local_var, align 4
+ %0 = load i32, ptr @global_storage, align 4
+ %call = call fastcc i32 @foo(i32 %0, ptr null)
+ store volatile i32 %call, ptr @local_var, align 4
ret void
}
diff --git a/llvm/test/tools/llvm-split/scc-alias.ll b/llvm/test/tools/llvm-split/scc-alias.ll
index 49566acfc7ed3..ecaea6a127cda 100644
--- a/llvm/test/tools/llvm-split/scc-alias.ll
+++ b/llvm/test/tools/llvm-split/scc-alias.ll
@@ -17,7 +17,7 @@
; CHECK1: define i32 @funExternal2
- at funInternalAlias = internal alias i32 (), i32 ()* @funInternal
+ at funInternalAlias = internal alias i32 (), ptr @funInternal
define internal i32 @funInternal() {
entry:
diff --git a/llvm/test/tools/llvm-split/scc-const-alias.ll b/llvm/test/tools/llvm-split/scc-const-alias.ll
index cf6435a005bb1..20670af416c44 100755
--- a/llvm/test/tools/llvm-split/scc-const-alias.ll
+++ b/llvm/test/tools/llvm-split/scc-const-alias.ll
@@ -7,10 +7,10 @@
; Checks are not critical here - verifier will assert if we fail.
; CHECK0: @g1 = global i32 99
; CHECK0: @c1Alias = external global i8
-; CHECK0: @g1Alias = internal alias i8, bitcast (i32* @g1 to i8*)
+; CHECK0: @g1Alias = internal alias i8, ptr @g1
; CHECK1: @g1 = external global i32
-; CHECK1: @c1Alias = internal alias i8, inttoptr (i64 42 to i8*)
+; CHECK1: @c1Alias = internal alias i8, inttoptr (i64 42 to ptr)
; Third file is actually empty.
; CHECK2: @g1 = external global i32
@@ -19,19 +19,19 @@
@g1 = global i32 99
- at g1Alias = internal alias i8, bitcast (i32* @g1 to i8*)
- at c1Alias = internal alias i8, inttoptr (i64 42 to i8*)
- at funExternalAlias = alias i8 (), i8 ()* @funExternal
+ at g1Alias = internal alias i8, ptr @g1
+ at c1Alias = internal alias i8, inttoptr (i64 42 to ptr)
+ at funExternalAlias = alias i8 (), ptr @funExternal
define i8 @funExternal() {
entry:
- %x = load i8, i8* @g1Alias
+ %x = load i8, ptr @g1Alias
ret i8 %x
}
define i8 @funExternal2() {
entry:
- %x = load i8, i8* @c1Alias
+ %x = load i8, ptr @c1Alias
%y = call i8 @funExternalAlias()
%z = add i8 %x, %y
ret i8 %z
diff --git a/llvm/test/tools/llvm-split/scc-constants.ll b/llvm/test/tools/llvm-split/scc-constants.ll
index f0fbea7ef9e71..a5509af9e4427 100644
--- a/llvm/test/tools/llvm-split/scc-constants.ll
+++ b/llvm/test/tools/llvm-split/scc-constants.ll
@@ -24,15 +24,15 @@
define internal i32 @foo() {
entry:
- store i64 5, i64* getelementptr inbounds (%struct.anon, %struct.anon* @bla, i32 0, i32 0), align 8
- store i32 -1, i32* bitcast (i64* getelementptr inbounds (%struct.anon, %struct.anon* @bla2, i32 0, i32 1) to i32*), align 8
+ store i64 5, ptr @bla, align 8
+ store i32 -1, ptr getelementptr inbounds (%struct.anon, ptr @bla2, i32 0, i32 1), align 8
ret i32 0
}
define internal i32 @baz() {
entry:
- store i64 5, i64* getelementptr inbounds (%struct.anon, %struct.anon* @bla, i32 0, i32 0), align 8
- store i32 -1, i32* bitcast (i64* getelementptr inbounds (%struct.anon, %struct.anon* @bla2, i32 0, i32 1) to i32*), align 8
+ store i64 5, ptr @bla, align 8
+ store i32 -1, ptr getelementptr inbounds (%struct.anon, ptr @bla2, i32 0, i32 1), align 8
ret i32 0
}
diff --git a/llvm/test/tools/llvm-split/scc-global-alias.ll b/llvm/test/tools/llvm-split/scc-global-alias.ll
index 1ca67e5849c3a..ee3b6a1c1ce1a 100644
--- a/llvm/test/tools/llvm-split/scc-global-alias.ll
+++ b/llvm/test/tools/llvm-split/scc-global-alias.ll
@@ -16,10 +16,10 @@
; CHECK2: @funExternalAlias = alias
; CHECK2: define i32 @funExternal
- at funInternalAlias = alias i32 (), i32 ()* @funInternal
- at funExternalAlias = alias i32 (), i32 ()* @funExternal
- at funInternal2Alias = alias i32 (), i32 ()* @funInternal2
- at funExternal2Alias = alias i32 (), i32 ()* @funExternal2
+ at funInternalAlias = alias i32 (), ptr @funInternal
+ at funExternalAlias = alias i32 (), ptr @funExternal
+ at funInternal2Alias = alias i32 (), ptr @funInternal2
+ at funExternal2Alias = alias i32 (), ptr @funExternal2
define internal i32 @funInternal() {
entry:
diff --git a/llvm/test/tools/llvm-split/scc-global2global.ll b/llvm/test/tools/llvm-split/scc-global2global.ll
index c6a9688ad6df0..4bf6713038ce7 100644
--- a/llvm/test/tools/llvm-split/scc-global2global.ll
+++ b/llvm/test/tools/llvm-split/scc-global2global.ll
@@ -5,24 +5,24 @@
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s
-; CHECK0: declare dso_local %struct.anon* @local0
-; CHECK0: declare dso_local i8** @local1
+; CHECK0: declare dso_local ptr @local0
+; CHECK0: declare dso_local ptr @local1
; CHECK1: @bla
; CHECK1: @ptr
-; CHECK1: define internal %struct.anon* @local0
-; CHECK1: define internal i8** @local1
+; CHECK1: define internal ptr @local0
+; CHECK1: define internal ptr @local1
%struct.anon = type { i64, i64 }
@bla = internal global %struct.anon { i64 1, i64 2 }, align 8
- at ptr = internal global i8* bitcast (%struct.anon* @bla to i8*), align 4
+ at ptr = internal global ptr @bla, align 4
-define internal %struct.anon* @local0() {
- ret %struct.anon* @bla
+define internal ptr @local0() {
+ ret ptr @bla
}
-define internal i8** @local1() {
- ret i8** @ptr
+define internal ptr @local1() {
+ ret ptr @ptr
}
More information about the llvm-commits
mailing list