diff options
author | Nikita Popov <npopov@redhat.com> | 2022-12-13 15:41:17 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-12-13 15:42:52 +0100 |
commit | d4191beeb94874e688794b35850c7e5bf0df959e (patch) | |
tree | 1bb66d042614fba3c8ba9d24d3115e35eec24bd3 /llvm/test/Transforms/GlobalOpt | |
parent | 2f115fb4c1b193fdb8a836b2a37f0e0d017eeb37 (diff) | |
download | llvm-d4191beeb94874e688794b35850c7e5bf0df959e.zip llvm-d4191beeb94874e688794b35850c7e5bf0df959e.tar.gz llvm-d4191beeb94874e688794b35850c7e5bf0df959e.tar.bz2 |
[GlobalOpt] Convert remaining tests to opaque pointers (NFC)
Diffstat (limited to 'llvm/test/Transforms/GlobalOpt')
4 files changed, 109 insertions, 121 deletions
diff --git a/llvm/test/Transforms/GlobalOpt/fastcc.ll b/llvm/test/Transforms/GlobalOpt/fastcc.ll index e5af216..854357e 100644 --- a/llvm/test/Transforms/GlobalOpt/fastcc.ll +++ b/llvm/test/Transforms/GlobalOpt/fastcc.ll @@ -1,69 +1,68 @@ ; RUN: opt < %s -passes=globalopt -S | FileCheck %s declare token @llvm.call.preallocated.setup(i32) -declare i8* @llvm.call.preallocated.arg(token, i32) +declare ptr @llvm.call.preallocated.arg(token, i32) -define internal i32 @f(i32* %m) { +define internal i32 @f(ptr %m) { ; CHECK-LABEL: define internal fastcc i32 @f - %v = load i32, i32* %m + %v = load i32, ptr %m ret i32 %v } -define internal x86_thiscallcc i32 @g(i32* %m) { +define internal x86_thiscallcc i32 @g(ptr %m) { ; CHECK-LABEL: define internal fastcc i32 @g - %v = load i32, i32* %m + %v = load i32, ptr %m ret i32 %v } ; Leave this one alone, because the user went out of their way to request this ; convention. -define internal coldcc i32 @h(i32* %m) { +define internal coldcc i32 @h(ptr %m) { ; CHECK-LABEL: define internal coldcc i32 @h - %v = load i32, i32* %m + %v = load i32, ptr %m ret i32 %v } -define internal i32 @j(i32* %m) { +define internal i32 @j(ptr %m) { ; CHECK-LABEL: define internal i32 @j - %v = load i32, i32* %m + %v = load i32, ptr %m ret i32 %v } -define internal i32 @inalloca(i32* inalloca(i32) %p) { -; CHECK-LABEL: define internal fastcc i32 @inalloca(i32* %p) - %rv = load i32, i32* %p +define internal i32 @inalloca(ptr inalloca(i32) %p) { +; CHECK-LABEL: define internal fastcc i32 @inalloca(ptr %p) + %rv = load i32, ptr %p ret i32 %rv } -define i32 @inalloca2_caller(i32* inalloca(i32) %p) { - %rv = musttail call i32 @inalloca2(i32* inalloca(i32) %p) +define i32 @inalloca2_caller(ptr inalloca(i32) %p) { + %rv = musttail call i32 @inalloca2(ptr inalloca(i32) %p) ret i32 %rv } -define internal i32 @inalloca2(i32* inalloca(i32) %p) { +define internal i32 @inalloca2(ptr inalloca(i32) %p) { ; Because of the musttail caller, this inalloca cannot be dropped. -; CHECK-LABEL: define internal i32 @inalloca2(i32* inalloca(i32) %p) - %rv = load i32, i32* %p +; CHECK-LABEL: define internal i32 @inalloca2(ptr inalloca(i32) %p) + %rv = load i32, ptr %p ret i32 %rv } -define internal i32 @preallocated(i32* preallocated(i32) %p) { -; CHECK-LABEL: define internal fastcc i32 @preallocated(i32* %p) - %rv = load i32, i32* %p +define internal i32 @preallocated(ptr preallocated(i32) %p) { +; CHECK-LABEL: define internal fastcc i32 @preallocated(ptr %p) + %rv = load i32, ptr %p ret i32 %rv } define void @call_things() { %m = alloca i32 - call i32 @f(i32* %m) - call x86_thiscallcc i32 @g(i32* %m) - call coldcc i32 @h(i32* %m) - call i32 @j(i32* %m) + call i32 @f(ptr %m) + call x86_thiscallcc i32 @g(ptr %m) + call coldcc i32 @h(ptr %m) + call i32 @j(ptr %m) %args = alloca inalloca i32 - call i32 @inalloca(i32* inalloca(i32) %args) + call i32 @inalloca(ptr inalloca(i32) %args) %c = call token @llvm.call.preallocated.setup(i32 1) - %N = call i8* @llvm.call.preallocated.arg(token %c, i32 0) preallocated(i32) - %n = bitcast i8* %N to i32* - call i32 @preallocated(i32* preallocated(i32) %n) ["preallocated"(token %c)] + %N = call ptr @llvm.call.preallocated.arg(token %c, i32 0) preallocated(i32) + call i32 @preallocated(ptr preallocated(i32) %N) ["preallocated"(token %c)] ret void } ; CHECK-LABEL: define void @call_things() @@ -71,10 +70,10 @@ define void @call_things() { ; CHECK: call fastcc i32 @g ; CHECK: call coldcc i32 @h ; CHECK: call i32 @j -; CHECK: call fastcc i32 @inalloca(i32* %args) +; CHECK: call fastcc i32 @inalloca(ptr %args) ; CHECK-NOT: llvm.call.preallocated -; CHECK: call fastcc i32 @preallocated(i32* %n) +; CHECK: call fastcc i32 @preallocated(ptr %paarg) -@llvm.used = appending global [1 x i8*] [ - i8* bitcast (i32(i32*)* @j to i8*) +@llvm.used = appending global [1 x ptr] [ + ptr @j ], section "llvm.metadata" diff --git a/llvm/test/Transforms/GlobalOpt/null-check-is-use-pr35760.ll b/llvm/test/Transforms/GlobalOpt/null-check-is-use-pr35760.ll index 53b0d74..70923c5 100644 --- a/llvm/test/Transforms/GlobalOpt/null-check-is-use-pr35760.ll +++ b/llvm/test/Transforms/GlobalOpt/null-check-is-use-pr35760.ll @@ -4,19 +4,19 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" -@_ZL3g_i = internal global i32* null, align 8 +@_ZL3g_i = internal global ptr null, align 8 @.str = private unnamed_addr constant [2 x i8] c"0\00", align 1 @.str.1 = private unnamed_addr constant [2 x i8] c"1\00", align 1 define dso_local i32 @main() { ; CHECK-LABEL: define {{[^@]+}}@main() local_unnamed_addr { ; CHECK-NEXT: bb: -; CHECK-NEXT: store i32* null, i32** @_ZL3g_i, align 8 +; CHECK-NEXT: store ptr null, ptr @_ZL3g_i, align 8 ; CHECK-NEXT: call fastcc void @_ZL13PutsSomethingv() ; CHECK-NEXT: ret i32 0 ; bb: - store i32* null, i32** @_ZL3g_i, align 8 + store ptr null, ptr @_ZL3g_i, align 8 call void @_ZL13PutsSomethingv() ret i32 0 } @@ -24,35 +24,33 @@ bb: define internal void @_ZL13PutsSomethingv() { ; CHECK-LABEL: define {{[^@]+}}@_ZL13PutsSomethingv() unnamed_addr { ; CHECK-NEXT: bb: -; CHECK-NEXT: [[I:%.*]] = load i32*, i32** @_ZL3g_i, align 8 -; CHECK-NEXT: [[I1:%.*]] = icmp eq i32* [[I]], null +; CHECK-NEXT: [[I:%.*]] = load ptr, ptr @_ZL3g_i, align 8 +; CHECK-NEXT: [[I1:%.*]] = icmp eq ptr [[I]], null ; CHECK-NEXT: br i1 [[I1]], label [[BB2:%.*]], label [[BB6:%.*]] ; CHECK: bb2: -; CHECK-NEXT: [[I3:%.*]] = call noalias i8* @malloc(i64 4) -; CHECK-NEXT: [[I4:%.*]] = bitcast i8* [[I3]] to i32* -; CHECK-NEXT: store i32* [[I4]], i32** @_ZL3g_i, align 8 -; CHECK-NEXT: [[I5:%.*]] = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)) +; CHECK-NEXT: [[I3:%.*]] = call noalias ptr @malloc(i64 4) +; CHECK-NEXT: store ptr [[I3]], ptr @_ZL3g_i, align 8 +; CHECK-NEXT: [[I5:%.*]] = call i32 @puts(ptr @.str) ; CHECK-NEXT: br label [[BB8:%.*]] ; CHECK: bb6: -; CHECK-NEXT: [[I7:%.*]] = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)) +; CHECK-NEXT: [[I7:%.*]] = call i32 @puts(ptr @.str.1) ; CHECK-NEXT: br label [[BB8]] ; CHECK: bb8: ; CHECK-NEXT: ret void ; bb: - %i = load i32*, i32** @_ZL3g_i, align 8 - %i1 = icmp eq i32* %i, null + %i = load ptr, ptr @_ZL3g_i, align 8 + %i1 = icmp eq ptr %i, null br i1 %i1, label %bb2, label %bb6 bb2: ; preds = %bb - %i3 = call noalias i8* @malloc(i64 4) - %i4 = bitcast i8* %i3 to i32* - store i32* %i4, i32** @_ZL3g_i, align 8 - %i5 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)) + %i3 = call noalias ptr @malloc(i64 4) + store ptr %i3, ptr @_ZL3g_i, align 8 + %i5 = call i32 @puts(ptr @.str) br label %bb8 bb6: ; preds = %bb - %i7 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)) + %i7 = call i32 @puts(ptr @.str.1) br label %bb8 bb8: ; preds = %bb6, %bb2 @@ -60,6 +58,6 @@ bb8: ; preds = %bb6, %bb2 } ; Function Attrs: allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) -declare dso_local noalias i8* @malloc(i64) #0 +declare dso_local noalias ptr @malloc(i64) #0 -declare dso_local i32 @puts(i8* nocapture readonly) +declare dso_local i32 @puts(ptr nocapture readonly) diff --git a/llvm/test/Transforms/GlobalOpt/null-check-not-use-pr35760.ll b/llvm/test/Transforms/GlobalOpt/null-check-not-use-pr35760.ll index bccfc1d..a499fe1 100644 --- a/llvm/test/Transforms/GlobalOpt/null-check-not-use-pr35760.ll +++ b/llvm/test/Transforms/GlobalOpt/null-check-not-use-pr35760.ll @@ -6,20 +6,20 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" -@_ZL3g_i = internal global i32* null, align 8 -@_ZL3g_j = global i32* null, align 8 +@_ZL3g_i = internal global ptr null, align 8 +@_ZL3g_j = global ptr null, align 8 @.str = private unnamed_addr constant [2 x i8] c"0\00", align 1 @.str.1 = private unnamed_addr constant [2 x i8] c"1\00", align 1 define dso_local i32 @main() { ; CHECK-LABEL: define {{[^@]+}}@main() local_unnamed_addr { ; CHECK-NEXT: bb: -; CHECK-NEXT: store i32* null, i32** @_ZL3g_i, align 8 +; CHECK-NEXT: store ptr null, ptr @_ZL3g_i, align 8 ; CHECK-NEXT: call fastcc void @_ZL13PutsSomethingv() ; CHECK-NEXT: ret i32 0 ; bb: - store i32* null, i32** @_ZL3g_i, align 8 + store ptr null, ptr @_ZL3g_i, align 8 call void @_ZL13PutsSomethingv() ret i32 0 } @@ -27,43 +27,41 @@ bb: define internal void @_ZL13PutsSomethingv() { ; CHECK-LABEL: define {{[^@]+}}@_ZL13PutsSomethingv() unnamed_addr { ; CHECK-NEXT: bb: -; CHECK-NEXT: [[I:%.*]] = load i32*, i32** @_ZL3g_i, align 8 -; CHECK-NEXT: [[I1:%.*]] = load i32*, i32** @_ZL3g_j, align 8 -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32* [[I]], [[I1]] +; CHECK-NEXT: [[I:%.*]] = load ptr, ptr @_ZL3g_i, align 8 +; CHECK-NEXT: [[I1:%.*]] = load ptr, ptr @_ZL3g_j, align 8 +; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[I]], [[I1]] ; CHECK-NEXT: br i1 [[CMP]], label [[BB2:%.*]], label [[BB6:%.*]] ; CHECK: bb2: -; CHECK-NEXT: [[I3:%.*]] = call noalias i8* @malloc(i64 4) -; CHECK-NEXT: [[I4:%.*]] = bitcast i8* [[I3]] to i32* -; CHECK-NEXT: store i32* [[I4]], i32** @_ZL3g_i, align 8 -; CHECK-NEXT: [[I5:%.*]] = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)) +; CHECK-NEXT: [[I3:%.*]] = call noalias ptr @malloc(i64 4) +; CHECK-NEXT: store ptr [[I3]], ptr @_ZL3g_i, align 8 +; CHECK-NEXT: [[I5:%.*]] = call i32 @puts(ptr @.str) ; CHECK-NEXT: br label [[BB8:%.*]] ; CHECK: bb6: -; CHECK-NEXT: [[I7:%.*]] = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)) +; CHECK-NEXT: [[I7:%.*]] = call i32 @puts(ptr @.str.1) ; CHECK-NEXT: br label [[BB8]] ; CHECK: bb8: ; CHECK-NEXT: ret void ; bb: - %i = load i32*, i32** @_ZL3g_i, align 8 - %i1 = load i32*, i32** @_ZL3g_j, align 8 - %cmp = icmp eq i32* %i, %i1 + %i = load ptr, ptr @_ZL3g_i, align 8 + %i1 = load ptr, ptr @_ZL3g_j, align 8 + %cmp = icmp eq ptr %i, %i1 br i1 %cmp, label %bb2, label %bb6 bb2: ; preds = %bb - %i3 = call noalias i8* @malloc(i64 4) - %i4 = bitcast i8* %i3 to i32* - store i32* %i4, i32** @_ZL3g_i, align 8 - %i5 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)) + %i3 = call noalias ptr @malloc(i64 4) + store ptr %i3, ptr @_ZL3g_i, align 8 + %i5 = call i32 @puts(ptr @.str) br label %bb8 bb6: ; preds = %bb - %i7 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)) + %i7 = call i32 @puts(ptr @.str.1) br label %bb8 bb8: ; preds = %bb6, %bb2 ret void } -declare dso_local noalias i8* @malloc(i64) +declare dso_local noalias ptr @malloc(i64) -declare dso_local i32 @puts(i8* nocapture readonly) +declare dso_local i32 @puts(ptr nocapture readonly) diff --git a/llvm/test/Transforms/GlobalOpt/preallocated.ll b/llvm/test/Transforms/GlobalOpt/preallocated.ll index 72ad662..c09a7b5 100644 --- a/llvm/test/Transforms/GlobalOpt/preallocated.ll +++ b/llvm/test/Transforms/GlobalOpt/preallocated.ll @@ -2,100 +2,94 @@ ; RUN: opt < %s -passes=globalopt -S | FileCheck %s declare token @llvm.call.preallocated.setup(i32) -declare i8* @llvm.call.preallocated.arg(token, i32) +declare ptr @llvm.call.preallocated.arg(token, i32) declare i32 @__CxxFrameHandler3(...) ; Don't touch functions with any musttail calls -define internal i32 @preallocated_musttail(i32* preallocated(i32) %p) { +define internal i32 @preallocated_musttail(ptr preallocated(i32) %p) { ; CHECK-LABEL: define {{[^@]+}}@preallocated_musttail -; CHECK-SAME: (i32* preallocated(i32) [[P:%.*]]) unnamed_addr { -; CHECK-NEXT: [[RV:%.*]] = load i32, i32* [[P]], align 4 +; CHECK-SAME: (ptr preallocated(i32) [[P:%.*]]) unnamed_addr { +; CHECK-NEXT: [[RV:%.*]] = load i32, ptr [[P]], align 4 ; CHECK-NEXT: ret i32 [[RV]] ; - %rv = load i32, i32* %p + %rv = load i32, ptr %p ret i32 %rv } -define i32 @call_preallocated_musttail(i32* preallocated(i32) %a) { +define i32 @call_preallocated_musttail(ptr preallocated(i32) %a) { ; CHECK-LABEL: define {{[^@]+}}@call_preallocated_musttail -; CHECK-SAME: (i32* preallocated(i32) [[A:%.*]]) local_unnamed_addr { -; CHECK-NEXT: [[R:%.*]] = musttail call i32 @preallocated_musttail(i32* preallocated(i32) [[A]]) +; CHECK-SAME: (ptr preallocated(i32) [[A:%.*]]) local_unnamed_addr { +; CHECK-NEXT: [[R:%.*]] = musttail call i32 @preallocated_musttail(ptr preallocated(i32) [[A]]) ; CHECK-NEXT: ret i32 [[R]] ; - %r = musttail call i32 @preallocated_musttail(i32* preallocated(i32) %a) + %r = musttail call i32 @preallocated_musttail(ptr preallocated(i32) %a) ret i32 %r } define i32 @call_preallocated_musttail_without_musttail() { ; CHECK-LABEL: define {{[^@]+}}@call_preallocated_musttail_without_musttail() local_unnamed_addr { ; CHECK-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 1) -; CHECK-NEXT: [[N:%.*]] = call i8* @llvm.call.preallocated.arg(token [[C]], i32 0) #[[ATTR1:[0-9]+]] -; CHECK-NEXT: [[N2:%.*]] = bitcast i8* [[N]] to i32* -; CHECK-NEXT: [[R:%.*]] = call i32 @preallocated_musttail(i32* preallocated(i32) [[N2]]) [ "preallocated"(token [[C]]) ] +; CHECK-NEXT: [[N:%.*]] = call ptr @llvm.call.preallocated.arg(token [[C]], i32 0) #[[ATTR1:[0-9]+]] +; CHECK-NEXT: [[R:%.*]] = call i32 @preallocated_musttail(ptr preallocated(i32) [[N]]) [ "preallocated"(token [[C]]) ] ; CHECK-NEXT: ret i32 [[R]] ; %c = call token @llvm.call.preallocated.setup(i32 1) - %N = call i8* @llvm.call.preallocated.arg(token %c, i32 0) preallocated(i32) - %N2 = bitcast i8* %N to i32* - %r = call i32 @preallocated_musttail(i32* preallocated(i32) %N2) ["preallocated"(token %c)] + %N = call ptr @llvm.call.preallocated.arg(token %c, i32 0) preallocated(i32) + %r = call i32 @preallocated_musttail(ptr preallocated(i32) %N) ["preallocated"(token %c)] ret i32 %r } ; Check that only one alloca per preallocated arg -define internal i32 @preallocated(i32* preallocated(i32) %a) { +define internal i32 @preallocated(ptr preallocated(i32) %a) { ; CHECK-LABEL: define {{[^@]+}}@preallocated -; CHECK-SAME: (i32* [[A:%.*]]) unnamed_addr { -; CHECK-NEXT: [[RV:%.*]] = load i32, i32* [[A]], align 4 +; CHECK-SAME: (ptr [[A:%.*]]) unnamed_addr { +; CHECK-NEXT: [[RV:%.*]] = load i32, ptr [[A]], align 4 ; CHECK-NEXT: ret i32 [[RV]] ; - %rv = load i32, i32* %a + %rv = load i32, ptr %a ret i32 %rv } -declare void @foo(i8*) +declare void @foo(ptr) define i32 @call_preallocated_multiple_args() { ; CHECK-LABEL: define {{[^@]+}}@call_preallocated_multiple_args() local_unnamed_addr { -; CHECK-NEXT: [[TMP1:%.*]] = call i8* @llvm.stacksave() +; CHECK-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave() ; CHECK-NEXT: [[PAARG:%.*]] = alloca i32, align 4 -; CHECK-NEXT: [[A32:%.*]] = bitcast i32* [[PAARG]] to i8* -; CHECK-NEXT: call void @foo(i8* [[A32]]) -; CHECK-NEXT: call void @foo(i8* [[A32]]) -; CHECK-NEXT: call void @foo(i8* [[A32]]) -; CHECK-NEXT: [[B:%.*]] = bitcast i8* [[A32]] to i32* -; CHECK-NEXT: [[R:%.*]] = call fastcc i32 @preallocated(i32* [[B]]) -; CHECK-NEXT: call void @llvm.stackrestore(i8* [[TMP1]]) +; CHECK-NEXT: call void @foo(ptr [[PAARG]]) +; CHECK-NEXT: call void @foo(ptr [[PAARG]]) +; CHECK-NEXT: call void @foo(ptr [[PAARG]]) +; CHECK-NEXT: [[R:%.*]] = call fastcc i32 @preallocated(ptr [[PAARG]]) +; CHECK-NEXT: call void @llvm.stackrestore(ptr [[TMP1]]) ; CHECK-NEXT: ret i32 [[R]] ; %c = call token @llvm.call.preallocated.setup(i32 1) - %a1 = call i8* @llvm.call.preallocated.arg(token %c, i32 0) preallocated(i32) - call void @foo(i8* %a1) - %a2 = call i8* @llvm.call.preallocated.arg(token %c, i32 0) preallocated(i32) - call void @foo(i8* %a2) - %a3 = call i8* @llvm.call.preallocated.arg(token %c, i32 0) preallocated(i32) - call void @foo(i8* %a3) - %b = bitcast i8* %a3 to i32* - %r = call i32 @preallocated(i32* preallocated(i32) %b) ["preallocated"(token %c)] + %a1 = call ptr @llvm.call.preallocated.arg(token %c, i32 0) preallocated(i32) + call void @foo(ptr %a1) + %a2 = call ptr @llvm.call.preallocated.arg(token %c, i32 0) preallocated(i32) + call void @foo(ptr %a2) + %a3 = call ptr @llvm.call.preallocated.arg(token %c, i32 0) preallocated(i32) + call void @foo(ptr %a3) + %r = call i32 @preallocated(ptr preallocated(i32) %a3) ["preallocated"(token %c)] ret i32 %r } ; Don't touch functions with any invokes -define internal i32 @preallocated_invoke(i32* preallocated(i32) %p) { +define internal i32 @preallocated_invoke(ptr preallocated(i32) %p) { ; CHECK-LABEL: define {{[^@]+}}@preallocated_invoke -; CHECK-SAME: (i32* preallocated(i32) [[P:%.*]]) unnamed_addr { -; CHECK-NEXT: [[RV:%.*]] = load i32, i32* [[P]], align 4 +; CHECK-SAME: (ptr preallocated(i32) [[P:%.*]]) unnamed_addr { +; CHECK-NEXT: [[RV:%.*]] = load i32, ptr [[P]], align 4 ; CHECK-NEXT: ret i32 [[RV]] ; - %rv = load i32, i32* %p + %rv = load i32, ptr %p ret i32 %rv } -define i32 @call_preallocated_invoke() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { -; CHECK-LABEL: define {{[^@]+}}@call_preallocated_invoke() local_unnamed_addr personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { +define i32 @call_preallocated_invoke() personality ptr @__CxxFrameHandler3 { +; CHECK-LABEL: define {{[^@]+}}@call_preallocated_invoke() local_unnamed_addr personality ptr @__CxxFrameHandler3 { ; CHECK-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 1) -; CHECK-NEXT: [[A:%.*]] = call i8* @llvm.call.preallocated.arg(token [[C]], i32 0) #[[ATTR1]] -; CHECK-NEXT: [[B:%.*]] = bitcast i8* [[A]] to i32* -; CHECK-NEXT: [[R:%.*]] = invoke i32 @preallocated_invoke(i32* preallocated(i32) [[B]]) [ "preallocated"(token [[C]]) ] +; CHECK-NEXT: [[A:%.*]] = call ptr @llvm.call.preallocated.arg(token [[C]], i32 0) #[[ATTR1]] +; CHECK-NEXT: [[R:%.*]] = invoke i32 @preallocated_invoke(ptr preallocated(i32) [[A]]) [ "preallocated"(token [[C]]) ] ; CHECK-NEXT: to label [[CONTA:%.*]] unwind label [[CONTB:%.*]] ; CHECK: conta: ; CHECK-NEXT: ret i32 [[R]] @@ -108,9 +102,8 @@ define i32 @call_preallocated_invoke() personality i8* bitcast (i32 (...)* @__Cx ; CHECK-NEXT: ret i32 42 ; %c = call token @llvm.call.preallocated.setup(i32 1) - %a = call i8* @llvm.call.preallocated.arg(token %c, i32 0) preallocated(i32) - %b = bitcast i8* %a to i32* - %r = invoke i32 @preallocated_invoke(i32* preallocated(i32) %b) ["preallocated"(token %c)] + %a = call ptr @llvm.call.preallocated.arg(token %c, i32 0) preallocated(i32) + %r = invoke i32 @preallocated_invoke(ptr preallocated(i32) %a) ["preallocated"(token %c)] to label %conta unwind label %contb conta: ret i32 %r |