From 7dc1009d13765fe2f29d232d575e9c39328ac07b Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Sun, 27 Nov 2022 13:29:14 -0500 Subject: [PATCH] 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. --- llvm/test/tools/llvm-split/alias.ll | 16 ++++++++-------- llvm/test/tools/llvm-split/blockaddress.ll | 14 +++++++------- llvm/test/tools/llvm-split/global.ll | 12 ++++++------ llvm/test/tools/llvm-split/personality.ll | 4 ++-- llvm/test/tools/llvm-split/preserve-locals.ll | 18 +++++++++--------- llvm/test/tools/llvm-split/scc-alias.ll | 2 +- llvm/test/tools/llvm-split/scc-const-alias.ll | 14 +++++++------- llvm/test/tools/llvm-split/scc-constants.ll | 8 ++++---- llvm/test/tools/llvm-split/scc-global-alias.ll | 8 ++++---- llvm/test/tools/llvm-split/scc-global2global.ll | 18 +++++++++--------- 10 files changed, 57 insertions(+), 57 deletions(-) diff --git a/llvm/test/tools/llvm-split/alias.ll b/llvm/test/tools/llvm-split/alias.ll index 18e0e7f..4e10b41 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*] -@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] +@afoo = alias [2 x ptr], ptr @foo ; CHECK0-DAG: declare void @abar() -; CHECK1-DAG: @abar = alias void (), void ()* @bar -@abar = alias void (), void ()* @bar +; CHECK1-DAG: @abar = alias void (), ptr @bar +@abar = alias void (), ptr @bar -@foo = global [2 x i8*] [i8* bitcast (void ()* @bar to i8*), i8* bitcast (void ()* @abar to i8*)] +@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 2672f8f..a18fc27 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 -@xxx = global [2 x i8*] [i8* blockaddress(@f, %exit), i8* blockaddress(@g, %exit)] +@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 6d24256..0b379fe 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* -@foo = global i8* bitcast (i8** @bar to i8*) +; CHECK0: @foo = global ptr @bar +; CHECK1: @foo = external global ptr +@foo = global ptr @bar -; CHECK0: @bar = external global i8* -; CHECK1: @bar = global i8* bitcast -@bar = global i8* bitcast (i8** @foo to i8*) +; CHECK0: @bar = external global ptr +; CHECK1: @bar = global ptr @foo +@bar = global ptr @foo diff --git a/llvm/test/tools/llvm-split/personality.ll b/llvm/test/tools/llvm-split/personality.ll index 50a4fb2..bef5faf 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 070ff06..d128daa 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 49566ac..ecaea6a 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 -@funInternalAlias = internal alias i32 (), i32 ()* @funInternal +@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 cf6435a..20670af 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 -@g1Alias = internal alias i8, bitcast (i32* @g1 to i8*) -@c1Alias = internal alias i8, inttoptr (i64 42 to i8*) -@funExternalAlias = alias i8 (), i8 ()* @funExternal +@g1Alias = internal alias i8, ptr @g1 +@c1Alias = internal alias i8, inttoptr (i64 42 to ptr) +@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 f0fbea7..a5509af 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 1ca67e5..ee3b6a1 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 -@funInternalAlias = alias i32 (), i32 ()* @funInternal -@funExternalAlias = alias i32 (), i32 ()* @funExternal -@funInternal2Alias = alias i32 (), i32 ()* @funInternal2 -@funExternal2Alias = alias i32 (), i32 ()* @funExternal2 +@funInternalAlias = alias i32 (), ptr @funInternal +@funExternalAlias = alias i32 (), ptr @funExternal +@funInternal2Alias = alias i32 (), ptr @funInternal2 +@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 c6a9688..4bf6713 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 -@ptr = internal global i8* bitcast (%struct.anon* @bla to i8*), align 4 +@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 } -- 2.7.4