[llvm] 8dc14a3 - TailCallElim: Convert tests to opaque pointers
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 28 06:47:49 PST 2022
Author: Matt Arsenault
Date: 2022-11-28T09:34:26-05:00
New Revision: 8dc14a3bc05e50e86d7b26ac141364eccbceb134
URL: https://github.com/llvm/llvm-project/commit/8dc14a3bc05e50e86d7b26ac141364eccbceb134
DIFF: https://github.com/llvm/llvm-project/commit/8dc14a3bc05e50e86d7b26ac141364eccbceb134.diff
LOG: TailCallElim: Convert tests to opaque pointers
This was painless and all converted by the script fine.
Added:
Modified:
llvm/test/Transforms/TailCallElim/accum_recursion.ll
llvm/test/Transforms/TailCallElim/basic.ll
llvm/test/Transforms/TailCallElim/deopt-bundle.ll
llvm/test/Transforms/TailCallElim/dont_reorder_load.ll
llvm/test/Transforms/TailCallElim/kcfi-bundle.ll
llvm/test/Transforms/TailCallElim/ptrauth-bundle.ll
llvm/test/Transforms/TailCallElim/reorder_load.ll
llvm/test/Transforms/TailCallElim/setjmp.ll
llvm/test/Transforms/TailCallElim/tre-byval-parameter-2.ll
llvm/test/Transforms/TailCallElim/tre-byval-parameter.ll
llvm/test/Transforms/TailCallElim/tre-multiple-exits.ll
llvm/test/Transforms/TailCallElim/tre-noncapturing-alloca-calls.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/TailCallElim/accum_recursion.ll b/llvm/test/Transforms/TailCallElim/accum_recursion.ll
index 2a805fb82b942..b54fc10535f68 100644
--- a/llvm/test/Transforms/TailCallElim/accum_recursion.ll
+++ b/llvm/test/Transforms/TailCallElim/accum_recursion.ll
@@ -109,21 +109,21 @@ declare i32 @test4_helper()
; CHECK: %accumulator.ret.tr = add nsw i32 %accumulator.tr, %base
; CHECK: ret i32 %accumulator.ret.tr
-define i32 @test5_base_case_load(i32* nocapture %A, i32 %n) local_unnamed_addr {
+define i32 @test5_base_case_load(ptr nocapture %A, i32 %n) local_unnamed_addr {
entry:
%cmp = icmp eq i32 %n, 0
br i1 %cmp, label %if.then, label %if.end
if.then:
- %base = load i32, i32* %A, align 4
+ %base = load i32, ptr %A, align 4
ret i32 %base
if.end:
%idxprom = zext i32 %n to i64
- %arrayidx1 = getelementptr inbounds i32, i32* %A, i64 %idxprom
- %load = load i32, i32* %arrayidx1, align 4
+ %arrayidx1 = getelementptr inbounds i32, ptr %A, i64 %idxprom
+ %load = load i32, ptr %arrayidx1, align 4
%sub = add i32 %n, -1
- %recurse = tail call i32 @test5_base_case_load(i32* %A, i32 %sub)
+ %recurse = tail call i32 @test5_base_case_load(ptr %A, i32 %sub)
%accumulate = add i32 %recurse, %load
ret i32 %accumulate
}
diff --git a/llvm/test/Transforms/TailCallElim/basic.ll b/llvm/test/Transforms/TailCallElim/basic.ll
index 81c9dc837f7f6..5cbc1ae4ffaf5 100644
--- a/llvm/test/Transforms/TailCallElim/basic.ll
+++ b/llvm/test/Transforms/TailCallElim/basic.ll
@@ -1,9 +1,9 @@
; RUN: opt < %s -passes=tailcallelim -verify-dom-info -S | FileCheck %s
declare void @noarg()
-declare void @use(i32*)
-declare void @use_nocapture(i32* nocapture)
-declare void @use2_nocapture(i32* nocapture, i32* nocapture)
+declare void @use(ptr)
+declare void @use_nocapture(ptr nocapture)
+declare void @use2_nocapture(ptr nocapture, ptr nocapture)
; Trivial case. Mark @noarg with tail call.
define void @test0() {
@@ -17,9 +17,9 @@ define void @test0() {
define i32 @test1() {
; CHECK: i32 @test1()
; CHECK-NEXT: alloca
- %A = alloca i32 ; <i32*> [#uses=2]
- store i32 5, i32* %A
- call void @use(i32* %A)
+ %A = alloca i32 ; <ptr> [#uses=2]
+ store i32 5, ptr %A
+ call void @use(ptr %A)
; CHECK: call i32 @test1
%X = call i32 @test1() ; <i32> [#uses=1]
ret i32 %X
@@ -79,7 +79,7 @@ define void @test4() {
; CHECK: tail call void @noarg()
; CHECK: ret void
%a = alloca i32
- call void @use_nocapture(i32* %a)
+ call void @use_nocapture(ptr %a)
call void @noarg()
ret void
}
@@ -88,46 +88,44 @@ define void @test4() {
; bad codegen caused by PR962.
;
; rdar://14324281.
-define i32* @test5(i32* nocapture %A, i1 %cond) {
-; CHECK: i32* @test5
+define ptr @test5(ptr nocapture %A, i1 %cond) {
+; CHECK: ptr @test5
; CHECK-NOT: tailrecurse:
-; CHECK: ret i32* null
+; CHECK: ret ptr null
%B = alloca i32
br i1 %cond, label %cond_true, label %cond_false
cond_true:
- call i32* @test5(i32* %B, i1 false)
- ret i32* null
+ call ptr @test5(ptr %B, i1 false)
+ ret ptr null
cond_false:
- call void @use2_nocapture(i32* %A, i32* %B)
+ call void @use2_nocapture(ptr %A, ptr %B)
call void @noarg()
- ret i32* null
+ ret ptr null
}
; PR14143: Make sure that we do not mark functions with nocapture allocas with tail.
;
; rdar://14324281.
-define void @test6(i32* %a, i32* %b) {
+define void @test6(ptr %a, ptr %b) {
; CHECK-LABEL: @test6(
; CHECK-NOT: tail call
; CHECK: ret void
%c = alloca [100 x i8], align 16
- %tmp = bitcast [100 x i8]* %c to i32*
- call void @use2_nocapture(i32* %b, i32* %tmp)
+ call void @use2_nocapture(ptr %b, ptr %c)
ret void
}
; PR14143: Make sure that we do not mark functions with nocapture allocas with tail.
;
; rdar://14324281
-define void @test7(i32* %a, i32* %b) nounwind uwtable {
+define void @test7(ptr %a, ptr %b) nounwind uwtable {
entry:
; CHECK-LABEL: @test7(
; CHECK-NOT: tail call
; CHECK: ret void
%c = alloca [100 x i8], align 16
- %0 = bitcast [100 x i8]* %c to i32*
- call void @use2_nocapture(i32* %0, i32* %a)
- call void @use2_nocapture(i32* %b, i32* %0)
+ call void @use2_nocapture(ptr %c, ptr %a)
+ call void @use2_nocapture(ptr %b, ptr %c)
ret void
}
@@ -135,48 +133,48 @@ entry:
; not do anything including marking callsites with the tail call marker.
;
; rdar://14324281.
-define i32* @test8(i32* nocapture %A, i1 %cond) {
-; CHECK: i32* @test8
+define ptr @test8(ptr nocapture %A, i1 %cond) {
+; CHECK: ptr @test8
; CHECK-NOT: tailrecurse:
; CHECK-NOT: tail call
-; CHECK: ret i32* null
+; CHECK: ret ptr null
%B = alloca i32
%B2 = alloca i32
br i1 %cond, label %cond_true, label %cond_false
cond_true:
- call void @use(i32* %B2)
- call i32* @test8(i32* %B, i1 false)
- ret i32* null
+ call void @use(ptr %B2)
+ call ptr @test8(ptr %B, i1 false)
+ ret ptr null
cond_false:
- call void @use2_nocapture(i32* %A, i32* %B)
+ call void @use2_nocapture(ptr %A, ptr %B)
call void @noarg()
- ret i32* null
+ ret ptr null
}
; Don't tail call if a byval arg is captured.
-define void @test9(i32* byval(i32) %a) {
+define void @test9(ptr byval(i32) %a) {
; CHECK-LABEL: define void @test9(
; CHECK: {{^ *}}call void @use(
- call void @use(i32* %a)
+ call void @use(ptr %a)
ret void
}
-%struct.X = type { i8* }
+%struct.X = type { ptr }
-declare void @ctor(%struct.X*)
-define void @test10(%struct.X* noalias sret(%struct.X) %agg.result, i1 zeroext %b) {
+declare void @ctor(ptr)
+define void @test10(ptr noalias sret(%struct.X) %agg.result, i1 zeroext %b) {
; CHECK-LABEL: @test10
entry:
%x = alloca %struct.X, align 8
br i1 %b, label %if.then, label %if.end
if.then: ; preds = %entry
- call void @ctor(%struct.X* %agg.result)
+ call void @ctor(ptr %agg.result)
; CHECK: tail call void @ctor
br label %return
if.end:
- call void @ctor(%struct.X* %x)
+ call void @ctor(ptr %x)
; CHECK: call void @ctor
br label %return
@@ -184,16 +182,16 @@ return:
ret void
}
-declare void @test11_helper1(i8** nocapture, i8*)
-declare void @test11_helper2(i8*)
+declare void @test11_helper1(ptr nocapture, ptr)
+declare void @test11_helper2(ptr)
define void @test11() {
; CHECK-LABEL: @test11
; CHECK-NOT: tail
- %a = alloca i8*
+ %a = alloca ptr
%b = alloca i8
- call void @test11_helper1(i8** %a, i8* %b) ; a = &b
- %c = load i8*, i8** %a
- call void @test11_helper2(i8* %c)
+ call void @test11_helper1(ptr %a, ptr %b) ; a = &b
+ %c = load ptr, ptr %a
+ call void @test11_helper2(ptr %c)
; CHECK: call void @test11_helper2
ret void
}
@@ -202,9 +200,9 @@ define void @test11() {
define void @test12() {
entry:
; CHECK-LABEL: @test12
-; CHECK: {{^ *}} call void undef(i8* undef) [ "foo"(i8* %e) ]
+; CHECK: {{^ *}} call void undef(ptr undef) [ "foo"(ptr %e) ]
%e = alloca i8
- call void undef(i8* undef) [ "foo"(i8* %e) ]
+ call void undef(ptr undef) [ "foo"(ptr %e) ]
unreachable
}
@@ -214,37 +212,35 @@ entry:
; point, and both calls below can be marked tail.
define void @test13() {
; CHECK-LABEL: @test13
-; CHECK: tail call void @bar(%struct.foo* byval(%struct.foo) %f)
-; CHECK: tail call void @bar(%struct.foo* byval(%struct.foo) null)
+; CHECK: tail call void @bar(ptr byval(%struct.foo) %f)
+; CHECK: tail call void @bar(ptr byval(%struct.foo) null)
entry:
%f = alloca %struct.foo
- call void @bar(%struct.foo* byval(%struct.foo) %f)
- call void @bar(%struct.foo* byval(%struct.foo) null)
+ call void @bar(ptr byval(%struct.foo) %f)
+ call void @bar(ptr byval(%struct.foo) null)
ret void
}
; A call which passes a byval parameter using byval can be marked tail.
-define void @test14(%struct.foo* byval(%struct.foo) %f) {
+define void @test14(ptr byval(%struct.foo) %f) {
; CHECK-LABEL: @test14
; CHECK: tail call void @bar
entry:
- call void @bar(%struct.foo* byval(%struct.foo) %f)
+ call void @bar(ptr byval(%struct.foo) %f)
ret void
}
; If a byval parameter is copied into an alloca and passed byval the call can
; be marked tail.
-define void @test15(%struct.foo* byval(%struct.foo) %f) {
+define void @test15(ptr byval(%struct.foo) %f) {
; CHECK-LABEL: @test15
; CHECK: tail call void @bar
entry:
%agg.tmp = alloca %struct.foo
- %0 = bitcast %struct.foo* %agg.tmp to i8*
- %1 = bitcast %struct.foo* %f to i8*
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 40, i1 false)
- call void @bar(%struct.foo* byval(%struct.foo) %agg.tmp)
+ call void @llvm.memcpy.p0.p0.i64(ptr %agg.tmp, ptr %f, i64 40, i1 false)
+ call void @bar(ptr byval(%struct.foo) %agg.tmp)
ret void
}
-declare void @bar(%struct.foo* byval(%struct.foo))
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1)
+declare void @bar(ptr byval(%struct.foo))
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1)
diff --git a/llvm/test/Transforms/TailCallElim/deopt-bundle.ll b/llvm/test/Transforms/TailCallElim/deopt-bundle.ll
index 72186df3eef2a..c05fe5c820028 100644
--- a/llvm/test/Transforms/TailCallElim/deopt-bundle.ll
+++ b/llvm/test/Transforms/TailCallElim/deopt-bundle.ll
@@ -57,13 +57,13 @@ exit:
}
; CHECK-LABEL: @test_clang_arc_attachedcall(
-; CHECK: tail call i8* @getObj(
+; CHECK: tail call ptr @getObj(
-declare i8* @getObj()
+declare ptr @getObj()
-define i8* @test_clang_arc_attachedcall() {
- %r = call i8* @getObj() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
- ret i8* %r
+define ptr @test_clang_arc_attachedcall() {
+ %r = call ptr @getObj() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]
+ ret ptr %r
}
-declare i8* @llvm.objc.retainAutoreleasedReturnValue(i8*)
+declare ptr @llvm.objc.retainAutoreleasedReturnValue(ptr)
diff --git a/llvm/test/Transforms/TailCallElim/dont_reorder_load.ll b/llvm/test/Transforms/TailCallElim/dont_reorder_load.ll
index 782f98cf92366..f1ae14136df44 100644
--- a/llvm/test/Transforms/TailCallElim/dont_reorder_load.ll
+++ b/llvm/test/Transforms/TailCallElim/dont_reorder_load.ll
@@ -5,12 +5,12 @@
; call, and thus can't eliminate the tail recursion.
- at extern_weak_global = extern_weak global i32 ; <i32*> [#uses=1]
+ at extern_weak_global = extern_weak global i32 ; <ptr> [#uses=1]
; This load can't be safely moved above the call because the load is from an
; extern_weak global and may trap, but the call may unwind before that happens.
-define fastcc i32 @no_tailrecelim_1(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) readonly {
+define fastcc i32 @no_tailrecelim_1(ptr %a_arg, i32 %a_len_arg, i32 %start_arg) readonly {
entry:
%tmp2 = icmp sge i32 %start_arg, %a_len_arg ; <i1> [#uses=1]
br i1 %tmp2, label %if, label %else
@@ -20,34 +20,34 @@ if: ; preds = %entry
else: ; preds = %entry
%tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1]
- %tmp8 = call fastcc i32 @no_tailrecelim_1(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
- %tmp9 = load i32, i32* @extern_weak_global ; <i32> [#uses=1]
+ %tmp8 = call fastcc i32 @no_tailrecelim_1(ptr %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
+ %tmp9 = load i32, ptr @extern_weak_global ; <i32> [#uses=1]
%tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=1]
ret i32 %tmp10
}
; This load can't be safely moved above the call because function may write to the pointer.
-define fastcc i32 @no_tailrecelim_2(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind {
+define fastcc i32 @no_tailrecelim_2(ptr %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind {
entry:
%tmp2 = icmp sge i32 %start_arg, %a_len_arg ; <i1> [#uses=1]
br i1 %tmp2, label %if, label %else
if: ; preds = %entry
- store i32 1, i32* %a_arg
+ store i32 1, ptr %a_arg
ret i32 0
else: ; preds = %entry
%tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1]
- %tmp8 = call fastcc i32 @no_tailrecelim_2(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
- %tmp9 = load i32, i32* %a_arg ; <i32> [#uses=1]
+ %tmp8 = call fastcc i32 @no_tailrecelim_2(ptr %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
+ %tmp9 = load i32, ptr %a_arg ; <i32> [#uses=1]
%tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=1]
ret i32 %tmp10
}
; This load can't be safely moved above the call because that would change the
; order in which the load volatiles are performed.
-define fastcc i32 @no_tailrecelim_3(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind {
+define fastcc i32 @no_tailrecelim_3(ptr %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind {
entry:
%tmp2 = icmp sge i32 %start_arg, %a_len_arg ; <i1> [#uses=1]
br i1 %tmp2, label %if, label %else
@@ -57,15 +57,15 @@ if: ; preds = %entry
else: ; preds = %entry
%tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1]
- %tmp8 = call fastcc i32 @no_tailrecelim_3(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
- %tmp9 = load volatile i32, i32* %a_arg ; <i32> [#uses=1]
+ %tmp8 = call fastcc i32 @no_tailrecelim_3(ptr %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
+ %tmp9 = load volatile i32, ptr %a_arg ; <i32> [#uses=1]
%tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=1]
ret i32 %tmp10
}
; This load can NOT be moved above the call because the a_arg is not
; sufficiently dereferenceable.
-define fastcc i32 @no_tailrecelim_4(i32* dereferenceable(2) %a_arg, i32 %a_len_arg, i32 %start_arg) readonly {
+define fastcc i32 @no_tailrecelim_4(ptr dereferenceable(2) %a_arg, i32 %a_len_arg, i32 %start_arg) readonly {
entry:
%tmp2 = icmp sge i32 %start_arg, %a_len_arg ; <i1> [#uses=1]
br i1 %tmp2, label %if, label %else
@@ -75,8 +75,8 @@ if: ; preds = %entry
else: ; preds = %entry
%tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1]
- %tmp8 = call fastcc i32 @no_tailrecelim_4(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
- %tmp9 = load i32, i32* %a_arg ; <i32> [#uses=1]
+ %tmp8 = call fastcc i32 @no_tailrecelim_4(ptr %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
+ %tmp9 = load i32, ptr %a_arg ; <i32> [#uses=1]
%tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=1]
ret i32 %tmp10
}
diff --git a/llvm/test/Transforms/TailCallElim/kcfi-bundle.ll b/llvm/test/Transforms/TailCallElim/kcfi-bundle.ll
index f43b9fae0ab6b..2ba7caa4280c2 100644
--- a/llvm/test/Transforms/TailCallElim/kcfi-bundle.ll
+++ b/llvm/test/Transforms/TailCallElim/kcfi-bundle.ll
@@ -1,7 +1,7 @@
; RUN: opt < %s -tailcallelim -verify-dom-info -S | FileCheck %s
; Check that the "kcfi" operand bundle doesn't prevent tail calls.
-define i64 @f_1(i64 %x, i64(i64)* %f_0) {
+define i64 @f_1(i64 %x, ptr %f_0) {
; CHECK-LABEL: @f_1(
entry:
; CHECK: tail call i64 %f_0(i64 %x) [ "kcfi"(i32 42) ]
diff --git a/llvm/test/Transforms/TailCallElim/ptrauth-bundle.ll b/llvm/test/Transforms/TailCallElim/ptrauth-bundle.ll
index f07ba93043580..18608e0b37f2d 100644
--- a/llvm/test/Transforms/TailCallElim/ptrauth-bundle.ll
+++ b/llvm/test/Transforms/TailCallElim/ptrauth-bundle.ll
@@ -1,7 +1,7 @@
; RUN: opt < %s -tailcallelim -verify-dom-info -S | FileCheck %s
; Check that the "ptrauth" operand bundle doesn't prevent tail calls.
-define i64 @f_1(i64 %x, i64(i64)* %f_0) {
+define i64 @f_1(i64 %x, ptr %f_0) {
; CHECK-LABEL: @f_1(
entry:
; CHECK: tail call i64 %f_0(i64 %x) [ "ptrauth"(i32 42, i64 %x) ]
diff --git a/llvm/test/Transforms/TailCallElim/reorder_load.ll b/llvm/test/Transforms/TailCallElim/reorder_load.ll
index 068232577da6f..93541a32c98c9 100644
--- a/llvm/test/Transforms/TailCallElim/reorder_load.ll
+++ b/llvm/test/Transforms/TailCallElim/reorder_load.ll
@@ -9,13 +9,13 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
- at global = external global i32 ; <i32*> [#uses=1]
- at extern_weak_global = extern_weak global i32 ; <i32*> [#uses=1]
+ at global = external global i32 ; <ptr> [#uses=1]
+ at extern_weak_global = extern_weak global i32 ; <ptr> [#uses=1]
; This load can be moved above the call because the function won't write to it
; and the call has no side effects.
-define fastcc i32 @raise_load_1(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly willreturn {
+define fastcc i32 @raise_load_1(ptr %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly willreturn {
; CHECK-LABEL: @raise_load_1(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[TAILRECURSE:%.*]]
@@ -29,7 +29,7 @@ define fastcc i32 @raise_load_1(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nou
; CHECK-NEXT: ret i32 [[ACCUMULATOR_RET_TR]]
; CHECK: else:
; CHECK-NEXT: [[TMP7]] = add i32 [[START_ARG_TR]], 1
-; CHECK-NEXT: [[TMP9:%.*]] = load i32, i32* [[A_ARG:%.*]], align 4
+; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[A_ARG:%.*]], align 4
; CHECK-NEXT: [[TMP10]] = add i32 [[TMP9]], [[ACCUMULATOR_TR]]
; CHECK-NEXT: br label [[TAILRECURSE]]
;
@@ -42,8 +42,8 @@ if: ; preds = %entry
else: ; preds = %entry
%tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1]
- %tmp8 = call fastcc i32 @raise_load_1(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
- %tmp9 = load i32, i32* %a_arg ; <i32> [#uses=1]
+ %tmp8 = call fastcc i32 @raise_load_1(ptr %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
+ %tmp9 = load i32, ptr %a_arg ; <i32> [#uses=1]
%tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=1]
ret i32 %tmp10
}
@@ -51,7 +51,7 @@ else: ; preds = %entry
; This load can be moved above the call because the function won't write to it
; and the load provably can't trap.
-define fastcc i32 @raise_load_2(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) readonly {
+define fastcc i32 @raise_load_2(ptr %a_arg, i32 %a_len_arg, i32 %start_arg) readonly {
; CHECK-LABEL: @raise_load_2(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[TAILRECURSE:%.*]]
@@ -64,13 +64,13 @@ define fastcc i32 @raise_load_2(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) rea
; CHECK-NEXT: [[ACCUMULATOR_RET_TR:%.*]] = add i32 0, [[ACCUMULATOR_TR]]
; CHECK-NEXT: ret i32 [[ACCUMULATOR_RET_TR]]
; CHECK: else:
-; CHECK-NEXT: [[NULLCHECK:%.*]] = icmp eq i32* [[A_ARG:%.*]], null
+; CHECK-NEXT: [[NULLCHECK:%.*]] = icmp eq ptr [[A_ARG:%.*]], null
; CHECK-NEXT: br i1 [[NULLCHECK]], label [[UNWIND:%.*]], label [[RECURSE]]
; CHECK: unwind:
; CHECK-NEXT: unreachable
; CHECK: recurse:
; CHECK-NEXT: [[TMP7]] = add i32 [[START_ARG_TR]], 1
-; CHECK-NEXT: [[TMP9:%.*]] = load i32, i32* @global, align 4
+; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr @global, align 4
; CHECK-NEXT: [[TMP10]] = add i32 [[TMP9]], [[ACCUMULATOR_TR]]
; CHECK-NEXT: br label [[TAILRECURSE]]
;
@@ -82,7 +82,7 @@ if: ; preds = %entry
ret i32 0
else: ; preds = %entry
- %nullcheck = icmp eq i32* %a_arg, null ; <i1> [#uses=1]
+ %nullcheck = icmp eq ptr %a_arg, null ; <i1> [#uses=1]
br i1 %nullcheck, label %unwind, label %recurse
unwind: ; preds = %else
@@ -90,8 +90,8 @@ unwind: ; preds = %else
recurse: ; preds = %else
%tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1]
- %tmp8 = call fastcc i32 @raise_load_2(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
- %tmp9 = load i32, i32* @global ; <i32> [#uses=1]
+ %tmp8 = call fastcc i32 @raise_load_2(ptr %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
+ %tmp9 = load i32, ptr @global ; <i32> [#uses=1]
%tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=1]
ret i32 %tmp10
}
@@ -99,7 +99,7 @@ recurse: ; preds = %else
; This load can be safely moved above the call (even though it's from an
; extern_weak global) because the call has no side effects.
-define fastcc i32 @raise_load_3(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly willreturn {
+define fastcc i32 @raise_load_3(ptr %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly willreturn {
; CHECK-LABEL: @raise_load_3(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[TAILRECURSE:%.*]]
@@ -113,7 +113,7 @@ define fastcc i32 @raise_load_3(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nou
; CHECK-NEXT: ret i32 [[ACCUMULATOR_RET_TR]]
; CHECK: else:
; CHECK-NEXT: [[TMP7]] = add i32 [[START_ARG_TR]], 1
-; CHECK-NEXT: [[TMP9:%.*]] = load i32, i32* @extern_weak_global, align 4
+; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr @extern_weak_global, align 4
; CHECK-NEXT: [[TMP10]] = add i32 [[TMP9]], [[ACCUMULATOR_TR]]
; CHECK-NEXT: br label [[TAILRECURSE]]
;
@@ -126,8 +126,8 @@ if: ; preds = %entry
else: ; preds = %entry
%tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1]
- %tmp8 = call fastcc i32 @raise_load_3(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
- %tmp9 = load i32, i32* @extern_weak_global ; <i32> [#uses=1]
+ %tmp8 = call fastcc i32 @raise_load_3(ptr %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
+ %tmp9 = load i32, ptr @extern_weak_global ; <i32> [#uses=1]
%tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=1]
ret i32 %tmp10
}
@@ -136,7 +136,7 @@ else: ; preds = %entry
; The second load can be safely moved above the call even though it's from an
; unknown pointer (which normally means it might trap) because the first load
; proves it doesn't trap.
-define fastcc i32 @raise_load_4(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) readonly {
+define fastcc i32 @raise_load_4(ptr %a_arg, i32 %a_len_arg, i32 %start_arg) readonly {
; CHECK-LABEL: @raise_load_4(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[TAILRECURSE:%.*]]
@@ -150,14 +150,14 @@ define fastcc i32 @raise_load_4(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) rea
; CHECK-NEXT: [[ACCUMULATOR_RET_TR:%.*]] = add i32 0, [[ACCUMULATOR_TR]]
; CHECK-NEXT: ret i32 [[ACCUMULATOR_RET_TR]]
; CHECK: else:
-; CHECK-NEXT: [[NULLCHECK:%.*]] = icmp eq i32* [[A_ARG:%.*]], null
+; CHECK-NEXT: [[NULLCHECK:%.*]] = icmp eq ptr [[A_ARG:%.*]], null
; CHECK-NEXT: br i1 [[NULLCHECK]], label [[UNWIND:%.*]], label [[RECURSE]]
; CHECK: unwind:
; CHECK-NEXT: unreachable
; CHECK: recurse:
; CHECK-NEXT: [[TMP7]] = add i32 [[START_ARG_TR]], 1
-; CHECK-NEXT: [[FIRST]] = load i32, i32* [[A_ARG]], align 4
-; CHECK-NEXT: [[SECOND:%.*]] = load i32, i32* [[A_ARG]], align 4
+; CHECK-NEXT: [[FIRST]] = load i32, ptr [[A_ARG]], align 4
+; CHECK-NEXT: [[SECOND:%.*]] = load i32, ptr [[A_ARG]], align 4
; CHECK-NEXT: [[TMP10]] = add i32 [[SECOND]], [[ACCUMULATOR_TR]]
; CHECK-NEXT: br label [[TAILRECURSE]]
;
@@ -169,7 +169,7 @@ if: ; preds = %entry
ret i32 0
else: ; preds = %entry
- %nullcheck = icmp eq i32* %a_arg, null ; <i1> [#uses=1]
+ %nullcheck = icmp eq ptr %a_arg, null ; <i1> [#uses=1]
br i1 %nullcheck, label %unwind, label %recurse
unwind: ; preds = %else
@@ -177,16 +177,16 @@ unwind: ; preds = %else
recurse: ; preds = %else
%tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1]
- %first = load i32, i32* %a_arg ; <i32> [#uses=1]
- %tmp8 = call fastcc i32 @raise_load_4(i32* %a_arg, i32 %first, i32 %tmp7) ; <i32> [#uses=1]
- %second = load i32, i32* %a_arg ; <i32> [#uses=1]
+ %first = load i32, ptr %a_arg ; <i32> [#uses=1]
+ %tmp8 = call fastcc i32 @raise_load_4(ptr %a_arg, i32 %first, i32 %tmp7) ; <i32> [#uses=1]
+ %second = load i32, ptr %a_arg ; <i32> [#uses=1]
%tmp10 = add i32 %second, %tmp8 ; <i32> [#uses=1]
ret i32 %tmp10
}
; This load can be moved above the call because the function won't write to it
; and the a_arg is dereferenceable.
-define fastcc i32 @raise_load_5(i32* dereferenceable(4) align 4 %a_arg, i32 %a_len_arg, i32 %start_arg) readonly nofree nosync {
+define fastcc i32 @raise_load_5(ptr dereferenceable(4) align 4 %a_arg, i32 %a_len_arg, i32 %start_arg) readonly nofree nosync {
; CHECK-LABEL: @raise_load_5(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[TAILRECURSE:%.*]]
@@ -200,7 +200,7 @@ define fastcc i32 @raise_load_5(i32* dereferenceable(4) align 4 %a_arg, i32 %a_l
; CHECK-NEXT: ret i32 [[ACCUMULATOR_RET_TR]]
; CHECK: else:
; CHECK-NEXT: [[TMP7]] = add i32 [[START_ARG_TR]], 1
-; CHECK-NEXT: [[TMP9:%.*]] = load i32, i32* [[A_ARG:%.*]], align 4
+; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[A_ARG:%.*]], align 4
; CHECK-NEXT: [[TMP10]] = add i32 [[TMP9]], [[ACCUMULATOR_TR]]
; CHECK-NEXT: br label [[TAILRECURSE]]
;
@@ -213,15 +213,15 @@ if: ; preds = %entry
else: ; preds = %entry
%tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1]
- %tmp8 = call fastcc i32 @raise_load_5(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
- %tmp9 = load i32, i32* %a_arg ; <i32> [#uses=1]
+ %tmp8 = call fastcc i32 @raise_load_5(ptr %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
+ %tmp9 = load i32, ptr %a_arg ; <i32> [#uses=1]
%tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=1]
ret i32 %tmp10
}
; This load can be moved above the call because the function call does not write to the memory the load
; is accessing and the load is safe to speculate.
-define fastcc i32 @raise_load_6(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind {
+define fastcc i32 @raise_load_6(ptr %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind {
; CHECK-LABEL: @raise_load_6(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[S:%.*]] = alloca i32, align 4
@@ -229,33 +229,33 @@ define fastcc i32 @raise_load_6(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nou
; CHECK: tailrecurse:
; CHECK-NEXT: [[ACCUMULATOR_TR:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP10:%.*]], [[ELSE:%.*]] ]
; CHECK-NEXT: [[START_ARG_TR:%.*]] = phi i32 [ [[START_ARG:%.*]], [[ENTRY]] ], [ [[TMP7:%.*]], [[ELSE]] ]
-; CHECK-NEXT: store i32 4, i32* [[S]], align 4
+; CHECK-NEXT: store i32 4, ptr [[S]], align 4
; CHECK-NEXT: [[TMP2:%.*]] = icmp sge i32 [[START_ARG_TR]], [[A_LEN_ARG:%.*]]
; CHECK-NEXT: br i1 [[TMP2]], label [[IF:%.*]], label [[ELSE]]
; CHECK: if:
-; CHECK-NEXT: store i32 1, i32* [[A_ARG:%.*]], align 4
+; CHECK-NEXT: store i32 1, ptr [[A_ARG:%.*]], align 4
; CHECK-NEXT: [[ACCUMULATOR_RET_TR:%.*]] = add i32 0, [[ACCUMULATOR_TR]]
; CHECK-NEXT: ret i32 [[ACCUMULATOR_RET_TR]]
; CHECK: else:
; CHECK-NEXT: [[TMP7]] = add i32 [[START_ARG_TR]], 1
-; CHECK-NEXT: [[TMP9:%.*]] = load i32, i32* [[S]], align 4
+; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[S]], align 4
; CHECK-NEXT: [[TMP10]] = add i32 [[TMP9]], [[ACCUMULATOR_TR]]
; CHECK-NEXT: br label [[TAILRECURSE]]
;
entry:
%s = alloca i32
- store i32 4, i32* %s
+ store i32 4, ptr %s
%tmp2 = icmp sge i32 %start_arg, %a_len_arg ; <i1> [#uses=1]
br i1 %tmp2, label %if, label %else
if: ; preds = %entry
- store i32 1, i32* %a_arg
+ store i32 1, ptr %a_arg
ret i32 0
else: ; preds = %entry
%tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1]
- %tmp8 = call fastcc i32 @raise_load_6(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
- %tmp9 = load i32, i32* %s ; <i32> [#uses=1]
+ %tmp8 = call fastcc i32 @raise_load_6(ptr %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1]
+ %tmp9 = load i32, ptr %s ; <i32> [#uses=1]
%tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=1]
ret i32 %tmp10
}
diff --git a/llvm/test/Transforms/TailCallElim/setjmp.ll b/llvm/test/Transforms/TailCallElim/setjmp.ll
index ee082c85c25a1..d5373cd8c2316 100644
--- a/llvm/test/Transforms/TailCallElim/setjmp.ll
+++ b/llvm/test/Transforms/TailCallElim/setjmp.ll
@@ -8,22 +8,22 @@ declare void @bar()
; CHECK: foo1
; CHECK-NOT: tail call void @bar()
-define void @foo1(i32* %x) {
+define void @foo1(ptr %x) {
bb:
- %tmp75 = tail call i32 @setjmp(i32* %x)
+ %tmp75 = tail call i32 @setjmp(ptr %x)
call void @bar()
ret void
}
-declare i32 @setjmp(i32*) returns_twice
+declare i32 @setjmp(ptr) returns_twice
; CHECK: foo2
; CHECK-NOT: tail call void @bar()
-define void @foo2(i32* %x) {
+define void @foo2(ptr %x) {
bb:
- %tmp75 = tail call i32 @zed2(i32* %x)
+ %tmp75 = tail call i32 @zed2(ptr %x)
call void @bar()
ret void
}
-declare i32 @zed2(i32*) returns_twice
+declare i32 @zed2(ptr) returns_twice
diff --git a/llvm/test/Transforms/TailCallElim/tre-byval-parameter-2.ll b/llvm/test/Transforms/TailCallElim/tre-byval-parameter-2.ll
index ab74c23d2fe8a..cd1583d73b26c 100644
--- a/llvm/test/Transforms/TailCallElim/tre-byval-parameter-2.ll
+++ b/llvm/test/Transforms/TailCallElim/tre-byval-parameter-2.ll
@@ -23,7 +23,7 @@
@.str = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1
; Function Attrs: noinline nounwind uwtable
-define dso_local void @_Z7dostuff1AS_i(%struct.A* nocapture byval(%struct.A) align 8 %a, %struct.A* nocapture readonly byval(%struct.A) align 8 %b, i32 %i) local_unnamed_addr #0 {
+define dso_local void @_Z7dostuff1AS_i(ptr nocapture byval(%struct.A) align 8 %a, ptr nocapture readonly byval(%struct.A) align 8 %b, i32 %i) local_unnamed_addr #0 {
; CHECK-LABEL: @_Z7dostuff1AS_i(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[AGG_TMP52:%.*]] = alloca [[STRUCT_A:%.*]], align 8
@@ -36,36 +36,24 @@ define dso_local void @_Z7dostuff1AS_i(%struct.A* nocapture byval(%struct.A) ali
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[I_TR]], 10
; CHECK-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[IF_END]]
; CHECK: if.end:
-; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_A]], %struct.A* [[A:%.*]], i64 0, i32 0, i64 5
-; CHECK-NEXT: [[TMP0:%.*]] = load i64, i64* [[ARRAYIDX]], align 8
+; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_A]], ptr [[A:%.*]], i64 0, i32 0, i64 5
+; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[ARRAYIDX]], align 8
; CHECK-NEXT: [[INC:%.*]] = add nsw i64 [[TMP0]], 1
-; CHECK-NEXT: store i64 [[INC]], i64* [[ARRAYIDX]], align 8
-; CHECK-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds [[STRUCT_A]], %struct.A* [[B:%.*]], i64 0, i32 0, i64 5
-; CHECK-NEXT: [[TMP1:%.*]] = load i64, i64* [[ARRAYIDX4]], align 8
-; CHECK-NEXT: [[CALL:%.*]] = tail call i32 (i8*, ...) @printf(i8* nonnull dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 [[INC]], i64 [[TMP1]])
-; CHECK-NEXT: [[TMP2:%.*]] = bitcast %struct.A* [[AGG_TMP]] to i8*
-; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 80, i8* nonnull [[TMP2]])
-; CHECK-NEXT: [[TMP3:%.*]] = bitcast %struct.A* [[B]] to i8*
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(80) [[TMP2]], i8* nonnull align 8 dereferenceable(80) [[TMP3]], i64 80, i1 false)
-; CHECK-NEXT: [[TMP4:%.*]] = bitcast %struct.A* [[AGG_TMP5]] to i8*
-; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 80, i8* nonnull [[TMP4]])
-; CHECK-NEXT: [[TMP5:%.*]] = bitcast %struct.A* [[A]] to i8*
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(80) [[TMP4]], i8* nonnull align 8 dereferenceable(80) [[TMP5]], i64 80, i1 false)
+; CHECK-NEXT: store i64 [[INC]], ptr [[ARRAYIDX]], align 8
+; CHECK-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds [[STRUCT_A]], ptr [[B:%.*]], i64 0, i32 0, i64 5
+; CHECK-NEXT: [[TMP1:%.*]] = load i64, ptr [[ARRAYIDX4]], align 8
+; CHECK-NEXT: [[CALL:%.*]] = tail call i32 (ptr, ...) @printf(ptr nonnull dereferenceable(1) @.str, i64 [[INC]], i64 [[TMP1]])
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 80, ptr nonnull [[AGG_TMP]])
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 dereferenceable(80) [[AGG_TMP]], ptr nonnull align 8 dereferenceable(80) [[B]], i64 80, i1 false)
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 80, ptr nonnull [[AGG_TMP5]])
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 dereferenceable(80) [[AGG_TMP5]], ptr nonnull align 8 dereferenceable(80) [[A]], i64 80, i1 false)
; CHECK-NEXT: [[ADD]] = add nsw i32 [[I_TR]], 1
-; CHECK-NEXT: [[TMP6:%.*]] = bitcast %struct.A* [[AGG_TMP1]] to i8*
-; CHECK-NEXT: [[TMP7:%.*]] = bitcast %struct.A* [[AGG_TMP]] to i8*
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[TMP6]], i8* align 8 [[TMP7]], i64 80, i1 false)
-; CHECK-NEXT: [[TMP8:%.*]] = bitcast %struct.A* [[AGG_TMP52]] to i8*
-; CHECK-NEXT: [[TMP9:%.*]] = bitcast %struct.A* [[AGG_TMP5]] to i8*
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[TMP8]], i8* align 8 [[TMP9]], i64 80, i1 false)
-; CHECK-NEXT: [[TMP10:%.*]] = bitcast %struct.A* [[A]] to i8*
-; CHECK-NEXT: [[TMP11:%.*]] = bitcast %struct.A* [[AGG_TMP1]] to i8*
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[TMP10]], i8* align 8 [[TMP11]], i64 80, i1 false)
-; CHECK-NEXT: [[TMP12:%.*]] = bitcast %struct.A* [[B]] to i8*
-; CHECK-NEXT: [[TMP13:%.*]] = bitcast %struct.A* [[AGG_TMP52]] to i8*
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[TMP12]], i8* align 8 [[TMP13]], i64 80, i1 false)
-; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 80, i8* nonnull [[TMP2]])
-; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 80, i8* nonnull [[TMP4]])
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[AGG_TMP1]], ptr align 8 [[AGG_TMP]], i64 80, i1 false)
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[AGG_TMP52]], ptr align 8 [[AGG_TMP5]], i64 80, i1 false)
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[A]], ptr align 8 [[AGG_TMP1]], i64 80, i1 false)
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[B]], ptr align 8 [[AGG_TMP52]], i64 80, i1 false)
+; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 80, ptr nonnull [[AGG_TMP]])
+; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 80, ptr nonnull [[AGG_TMP5]])
; CHECK-NEXT: br label [[TAILRECURSE]]
; CHECK: return:
; CHECK-NEXT: ret void
@@ -77,26 +65,22 @@ entry:
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
- %arrayidx = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 0, i64 5
- %0 = load i64, i64* %arrayidx, align 8
+ %arrayidx = getelementptr inbounds %struct.A, ptr %a, i64 0, i32 0, i64 5
+ %0 = load i64, ptr %arrayidx, align 8
%inc = add nsw i64 %0, 1
- store i64 %inc, i64* %arrayidx, align 8
- %arrayidx4 = getelementptr inbounds %struct.A, %struct.A* %b, i64 0, i32 0, i64 5
- %1 = load i64, i64* %arrayidx4, align 8
- %call = call i32 (i8*, ...) @printf(i8* nonnull dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str
-, i64 0, i64 0), i64 %inc, i64 %1)
- %2 = bitcast %struct.A* %agg.tmp to i8*
- call void @llvm.lifetime.start.p0i8(i64 80, i8* nonnull %2)
- %3 = bitcast %struct.A* %b to i8*
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(80) %2, i8* nonnull align 8 dereferenceable(80) %3, i64 80, i1 false)
- %4 = bitcast %struct.A* %agg.tmp5 to i8*
- call void @llvm.lifetime.start.p0i8(i64 80, i8* nonnull %4)
- %5 = bitcast %struct.A* %a to i8*
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(80) %4, i8* nonnull align 8 dereferenceable(80) %5, i64 80, i1 false)
+ store i64 %inc, ptr %arrayidx, align 8
+ %arrayidx4 = getelementptr inbounds %struct.A, ptr %b, i64 0, i32 0, i64 5
+ %1 = load i64, ptr %arrayidx4, align 8
+ %call = call i32 (ptr, ...) @printf(ptr nonnull dereferenceable(1) @.str
+, i64 %inc, i64 %1)
+ call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %agg.tmp)
+ call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 dereferenceable(80) %agg.tmp, ptr nonnull align 8 dereferenceable(80) %b, i64 80, i1 false)
+ call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %agg.tmp5)
+ call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 dereferenceable(80) %agg.tmp5, ptr nonnull align 8 dereferenceable(80) %a, i64 80, i1 false)
%add = add nsw i32 %i, 1
- call void @_Z7dostuff1AS_i(%struct.A* nonnull byval(%struct.A) align 8 %agg.tmp, %struct.A* nonnull byval(%struct.A) align 8 %agg.tmp5, i32 %add)
- call void @llvm.lifetime.end.p0i8(i64 80, i8* nonnull %2)
- call void @llvm.lifetime.end.p0i8(i64 80, i8* nonnull %4)
+ call void @_Z7dostuff1AS_i(ptr nonnull byval(%struct.A) align 8 %agg.tmp, ptr nonnull byval(%struct.A) align 8 %agg.tmp5, i32 %add)
+ call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %agg.tmp)
+ call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %agg.tmp5)
br label %return
return: ; preds = %entry, %if.end
@@ -104,16 +88,16 @@ return: ; preds = %entry, %if.end
}
; Function Attrs: nofree nounwind
-declare dso_local noundef i32 @printf(i8* nocapture noundef readonly, ...) local_unnamed_addr #1
+declare dso_local noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #2
+declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #2
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #2
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: noinline norecurse nounwind optnone uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
@@ -121,21 +105,17 @@ define dso_local i32 @main() local_unnamed_addr #3 {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[AGG_TMP:%.*]] = alloca [[STRUCT_A:%.*]], align 8
; CHECK-NEXT: [[AGG_TMP1:%.*]] = alloca [[STRUCT_A]], align 8
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast %struct.A* [[AGG_TMP]] to i8*
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[TMP0]], i8* align 8 bitcast (%struct.A* @global to i8*), i64 80, i1 false)
-; CHECK-NEXT: [[TMP1:%.*]] = bitcast %struct.A* [[AGG_TMP1]] to i8*
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[TMP1]], i8* align 8 bitcast (%struct.A* @global to i8*), i64 80, i1 false)
-; CHECK-NEXT: tail call void @_Z7dostuff1AS_i(%struct.A* byval(%struct.A) align 8 [[AGG_TMP]], %struct.A* byval(%struct.A) align 8 [[AGG_TMP1]], i32 0)
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[AGG_TMP]], ptr align 8 @global, i64 80, i1 false)
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[AGG_TMP1]], ptr align 8 @global, i64 80, i1 false)
+; CHECK-NEXT: tail call void @_Z7dostuff1AS_i(ptr byval(%struct.A) align 8 [[AGG_TMP]], ptr byval(%struct.A) align 8 [[AGG_TMP1]], i32 0)
; CHECK-NEXT: ret i32 0
;
entry:
%agg.tmp = alloca %struct.A, align 8
%agg.tmp1 = alloca %struct.A, align 8
- %0 = bitcast %struct.A* %agg.tmp to i8*
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %0, i8* align 8 bitcast (%struct.A* @global to i8*), i64 80, i1 false)
- %1 = bitcast %struct.A* %agg.tmp1 to i8*
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %1, i8* align 8 bitcast (%struct.A* @global to i8*), i64 80, i1 false)
- call void @_Z7dostuff1AS_i(%struct.A* byval(%struct.A) align 8 %agg.tmp, %struct.A* byval(%struct.A) align 8 %agg.tmp1, i32 0)
+ call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp, ptr align 8 @global, i64 80, i1 false)
+ call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp1, ptr align 8 @global, i64 80, i1 false)
+ call void @_Z7dostuff1AS_i(ptr byval(%struct.A) align 8 %agg.tmp, ptr byval(%struct.A) align 8 %agg.tmp1, i32 0)
ret i32 0
}
diff --git a/llvm/test/Transforms/TailCallElim/tre-byval-parameter.ll b/llvm/test/Transforms/TailCallElim/tre-byval-parameter.ll
index dedac6ac52864..b385baf8c570b 100644
--- a/llvm/test/Transforms/TailCallElim/tre-byval-parameter.ll
+++ b/llvm/test/Transforms/TailCallElim/tre-byval-parameter.ll
@@ -23,7 +23,7 @@
%struct.B = type { i32, float }
; Function Attrs: uwtable
-define dso_local i32 @_Z3fooi1S(i32 %count, %struct.S* nocapture readonly byval(%struct.S) align 8 %p1) local_unnamed_addr #0 {
+define dso_local i32 @_Z3fooi1S(i32 %count, ptr nocapture readonly byval(%struct.S) align 8 %p1) local_unnamed_addr #0 {
; CHECK-LABEL: @_Z3fooi1S(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[AGG_TMP_I1:%.*]] = alloca [[STRUCT_S:%.*]], align 8
@@ -37,30 +37,20 @@ define dso_local i32 @_Z3fooi1S(i32 %count, %struct.S* nocapture readonly byval(
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[COUNT_TR]], 10
; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END]]
; CHECK: if.then:
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast %struct.S* [[AGG_TMP]] to i8*
-; CHECK-NEXT: [[TMP1:%.*]] = bitcast %struct.S* [[P1:%.*]] to i8*
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(20) [[TMP0]], i8* nonnull align 8 dereferenceable(20) [[TMP1]], i64 20, i1 false)
-; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z3zoo1S(%struct.S* nonnull byval(%struct.S) align 8 [[AGG_TMP]])
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 dereferenceable(20) [[AGG_TMP]], ptr nonnull align 8 dereferenceable(20) [[P1:%.*]], i64 20, i1 false)
+; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z3zoo1S(ptr nonnull byval(%struct.S) align 8 [[AGG_TMP]])
; CHECK-NEXT: br label [[RETURN:%.*]]
; CHECK: if.end:
; CHECK-NEXT: [[ADD]] = add nsw i32 [[COUNT_TR]], 1
-; CHECK-NEXT: [[TMP2:%.*]] = bitcast %struct.S* [[AGG_TMP1]] to i8*
-; CHECK-NEXT: [[TMP3:%.*]] = bitcast %struct.S* [[P1]] to i8*
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(20) [[TMP2]], i8* nonnull align 8 dereferenceable(20) [[TMP3]], i64 20, i1 false)
-; CHECK-NEXT: [[AGG_TMP14_0__SROA_CAST:%.*]] = bitcast %struct.S* [[AGG_TMP14]] to i8*
-; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 20, i8* nonnull [[AGG_TMP14_0__SROA_CAST]])
-; CHECK-NEXT: [[TMP4:%.*]] = bitcast %struct.S* [[AGG_TMP_I]] to i8*
-; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 20, i8* nonnull [[TMP4]])
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(20) [[AGG_TMP14_0__SROA_CAST]], i8* nonnull align 8 dereferenceable(20) [[TMP2]], i64 20, i1 false)
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(20) [[TMP4]], i8* nonnull align 8 dereferenceable(20) [[AGG_TMP14_0__SROA_CAST]], i64 20, i1 false)
-; CHECK-NEXT: [[TMP5:%.*]] = bitcast %struct.S* [[AGG_TMP_I1]] to i8*
-; CHECK-NEXT: [[TMP6:%.*]] = bitcast %struct.S* [[AGG_TMP_I]] to i8*
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[TMP5]], i8* align 8 [[TMP6]], i64 20, i1 false)
-; CHECK-NEXT: [[TMP7:%.*]] = bitcast %struct.S* [[P1]] to i8*
-; CHECK-NEXT: [[TMP8:%.*]] = bitcast %struct.S* [[AGG_TMP_I1]] to i8*
-; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[TMP7]], i8* align 8 [[TMP8]], i64 20, i1 false)
-; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 20, i8* nonnull [[AGG_TMP14_0__SROA_CAST]])
-; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 20, i8* nonnull [[TMP4]])
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 dereferenceable(20) [[AGG_TMP1]], ptr nonnull align 8 dereferenceable(20) [[P1]], i64 20, i1 false)
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 20, ptr nonnull [[AGG_TMP14]])
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 20, ptr nonnull [[AGG_TMP_I]])
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 dereferenceable(20) [[AGG_TMP14]], ptr nonnull align 8 dereferenceable(20) [[AGG_TMP1]], i64 20, i1 false)
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 dereferenceable(20) [[AGG_TMP_I]], ptr nonnull align 8 dereferenceable(20) [[AGG_TMP14]], i64 20, i1 false)
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[AGG_TMP_I1]], ptr align 8 [[AGG_TMP_I]], i64 20, i1 false)
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[P1]], ptr align 8 [[AGG_TMP_I1]], i64 20, i1 false)
+; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 20, ptr nonnull [[AGG_TMP14]])
+; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 20, ptr nonnull [[AGG_TMP_I]])
; CHECK-NEXT: br label [[TAILRECURSE]]
; CHECK: return:
; CHECK-NEXT: ret i32 [[CALL]]
@@ -74,26 +64,20 @@ entry:
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
- %0 = bitcast %struct.S* %agg.tmp to i8*
- %1 = bitcast %struct.S* %p1 to i8*
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(20) %0, i8* nonnull align 8 dereferenceable(20) %1, i64 20, i1 false)
- %call = call i32 @_Z3zoo1S(%struct.S* nonnull byval(%struct.S) align 8 %agg.tmp)
+ call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 dereferenceable(20) %agg.tmp, ptr nonnull align 8 dereferenceable(20) %p1, i64 20, i1 false)
+ %call = call i32 @_Z3zoo1S(ptr nonnull byval(%struct.S) align 8 %agg.tmp)
br label %return
if.end: ; preds = %entry
%add = add nsw i32 %count, 1
- %2 = bitcast %struct.S* %agg.tmp1 to i8*
- %3 = bitcast %struct.S* %p1 to i8*
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(20) %2, i8* nonnull align 8 dereferenceable(20) %3, i64 20, i1 false)
- %agg.tmp14.0..sroa_cast = bitcast %struct.S* %agg.tmp14 to i8*
- call void @llvm.lifetime.start.p0i8(i64 20, i8* nonnull %agg.tmp14.0..sroa_cast)
- %4 = bitcast %struct.S* %agg.tmp.i to i8*
- call void @llvm.lifetime.start.p0i8(i64 20, i8* nonnull %4)
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(20) %agg.tmp14.0..sroa_cast, i8* nonnull align 8 dereferenceable(20) %2, i64 20, i1 false)
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(20) %4, i8* nonnull align 8 dereferenceable(20) %agg.tmp14.0..sroa_cast, i64 20, i1 false)
- %call.i = call i32 @_Z3fooi1S(i32 %add, %struct.S* nonnull byval(%struct.S) align 8 %agg.tmp.i)
- call void @llvm.lifetime.end.p0i8(i64 20, i8* nonnull %agg.tmp14.0..sroa_cast)
- call void @llvm.lifetime.end.p0i8(i64 20, i8* nonnull %4)
+ call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 dereferenceable(20) %agg.tmp1, ptr nonnull align 8 dereferenceable(20) %p1, i64 20, i1 false)
+ call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %agg.tmp14)
+ call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %agg.tmp.i)
+ call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 dereferenceable(20) %agg.tmp14, ptr nonnull align 8 dereferenceable(20) %agg.tmp1, i64 20, i1 false)
+ call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 dereferenceable(20) %agg.tmp.i, ptr nonnull align 8 dereferenceable(20) %agg.tmp14, i64 20, i1 false)
+ %call.i = call i32 @_Z3fooi1S(i32 %add, ptr nonnull byval(%struct.S) align 8 %agg.tmp.i)
+ call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %agg.tmp14)
+ call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %agg.tmp.i)
br label %return
return: ; preds = %if.end, %if.then
@@ -101,16 +85,16 @@ return: ; preds = %if.end, %if.then
ret i32 %retval.0
}
-declare dso_local i32 @_Z3zoo1S(%struct.S* byval(%struct.S) align 8) local_unnamed_addr #1
+declare dso_local i32 @_Z3zoo1S(ptr byval(%struct.S) align 8) local_unnamed_addr #1
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #2
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #2
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #2
+declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2
attributes #0 = { uwtable }
attributes #1 = { uwtable }
diff --git a/llvm/test/Transforms/TailCallElim/tre-multiple-exits.ll b/llvm/test/Transforms/TailCallElim/tre-multiple-exits.ll
index ba3a4862046e4..293deca00f7fa 100644
--- a/llvm/test/Transforms/TailCallElim/tre-multiple-exits.ll
+++ b/llvm/test/Transforms/TailCallElim/tre-multiple-exits.ll
@@ -33,7 +33,7 @@
; }
; Function Attrs: noinline optnone uwtable
-declare void @_Z11capture_argPi(i32* %param) #0
+declare void @_Z11capture_argPi(ptr %param) #0
; Function Attrs: noinline optnone uwtable
declare void @_Z4funcv() #0
@@ -49,12 +49,11 @@ define dso_local void @_Z19test_multiple_exitsi(i32 %param) local_unnamed_addr #
; CHECK-NEXT: [[TMP0:%.*]] = icmp ult i32 [[PARAM_TR]], 10
; CHECK-NEXT: br i1 [[TMP0]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: [[TMP1:%.*]] = bitcast i32* [[TEMP]] to i8*
-; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull [[TMP1]]) #1
-; CHECK-NEXT: call void @_Z11capture_argPi(i32* nonnull [[TEMP]])
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr nonnull [[TEMP]]) #1
+; CHECK-NEXT: call void @_Z11capture_argPi(ptr nonnull [[TEMP]])
; CHECK-NEXT: [[ADD:%.*]] = add nuw nsw i32 [[PARAM_TR]], 1
; CHECK-NEXT: call void @_Z19test_multiple_exitsi(i32 [[ADD]])
-; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull [[TMP1]]) #1
+; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 4, ptr nonnull [[TEMP]]) #1
; CHECK-NEXT: br label [[IF_END14:%.*]]
; CHECK: if.else:
; CHECK-NEXT: [[PARAM_OFF:%.*]] = add i32 [[PARAM_TR]], -10
@@ -81,18 +80,17 @@ entry:
br i1 %0, label %if.then, label %if.else
if.then: ; preds = %entry
- %1 = bitcast i32* %temp to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %1) #2
- call void @_Z11capture_argPi(i32* nonnull %temp)
+ call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #2
+ call void @_Z11capture_argPi(ptr nonnull %temp)
%add = add nuw nsw i32 %param, 1
call void @_Z19test_multiple_exitsi(i32 %add)
- call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %1) #2
+ call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #2
br label %if.end14
if.else: ; preds = %entry
%param.off = add i32 %param, -10
- %2 = icmp ult i32 %param.off, 10
- br i1 %2, label %if.then5, label %if.else7
+ %1 = icmp ult i32 %param.off, 10
+ br i1 %1, label %if.then5, label %if.else7
if.then5: ; preds = %if.else
%add6 = add nuw nsw i32 %param, 1
@@ -100,9 +98,9 @@ if.then5: ; preds = %if.else
br label %if.end14
if.else7: ; preds = %if.else
- %3 = and i32 %param, -2
- %4 = icmp eq i32 %3, 20
- br i1 %4, label %if.then11, label %if.end14
+ %2 = and i32 %param, -2
+ %3 = icmp eq i32 %2, 20
+ br i1 %3, label %if.then11, label %if.end14
if.then11: ; preds = %if.else7
%add12 = add nsw i32 %param, 1
@@ -115,10 +113,10 @@ if.end14: ; preds = %if.then5, %if.then1
}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #2
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #2
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree noinline norecurse nounwind uwtable }
attributes #1 = { nounwind uwtable }
diff --git a/llvm/test/Transforms/TailCallElim/tre-noncapturing-alloca-calls.ll b/llvm/test/Transforms/TailCallElim/tre-noncapturing-alloca-calls.ll
index 406ce4f247d2c..c9ac9a5d480f2 100644
--- a/llvm/test/Transforms/TailCallElim/tre-noncapturing-alloca-calls.ll
+++ b/llvm/test/Transforms/TailCallElim/tre-noncapturing-alloca-calls.ll
@@ -18,7 +18,7 @@
@count = dso_local local_unnamed_addr global i32 0, align 4
; Function Attrs: nofree noinline norecurse nounwind uwtable
-declare void @_Z15globalIncrementPKi(i32* nocapture readonly %param) #0
+declare void @_Z15globalIncrementPKi(ptr nocapture readonly %param) #0
; Test that TRE could be done for recursive tail routine containing
; call to function receiving a pointer to local stack.
@@ -34,12 +34,11 @@ define dso_local void @_Z4testi(i32 %recurseCount) local_unnamed_addr #1 {
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[RECURSECOUNT_TR]], 0
; CHECK-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[IF_END]]
; CHECK: if.end:
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[TEMP]] to i8*
-; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull [[TMP0]])
-; CHECK-NEXT: store i32 10, i32* [[TEMP]], align 4
-; CHECK-NEXT: call void @_Z15globalIncrementPKi(i32* nonnull [[TEMP]])
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr nonnull [[TEMP]])
+; CHECK-NEXT: store i32 10, ptr [[TEMP]], align 4
+; CHECK-NEXT: call void @_Z15globalIncrementPKi(ptr nonnull [[TEMP]])
; CHECK-NEXT: [[SUB]] = add nsw i32 [[RECURSECOUNT_TR]], -1
-; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull [[TMP0]])
+; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 4, ptr nonnull [[TEMP]])
; CHECK-NEXT: br label [[TAILRECURSE]]
; CHECK: return:
; CHECK-NEXT: ret void
@@ -50,13 +49,12 @@ entry:
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
- %0 = bitcast i32* %temp to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %0) #6
- store i32 10, i32* %temp, align 4
- call void @_Z15globalIncrementPKi(i32* nonnull %temp)
+ call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #6
+ store i32 10, ptr %temp, align 4
+ call void @_Z15globalIncrementPKi(ptr nonnull %temp)
%sub = add nsw i32 %recurseCount, -1
call void @_Z4testi(i32 %sub)
- call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %0) #6
+ call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #6
br label %return
return: ; preds = %entry, %if.end
@@ -64,10 +62,10 @@ return: ; preds = %entry, %if.end
}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #2
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #2
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree noinline norecurse nounwind uwtable }
attributes #1 = { nounwind uwtable }
More information about the llvm-commits
mailing list