diff --git a/llvm/test/Transforms/SimplifyCFG/1elt-ptr-vec-alignment-crash.ll b/llvm/test/Transforms/SimplifyCFG/1elt-ptr-vec-alignment-crash.ll index 23f9d10d5da133..1c586b872e892d 100644 --- a/llvm/test/Transforms/SimplifyCFG/1elt-ptr-vec-alignment-crash.ll +++ b/llvm/test/Transforms/SimplifyCFG/1elt-ptr-vec-alignment-crash.ll @@ -7,15 +7,14 @@ @x = external dso_local local_unnamed_addr global i32, align 4 -define dso_local void @_ZN2ap2aqEv(%struct.ap* %this, i1 %c, i32 %v2) { +define dso_local void @_ZN2ap2aqEv(ptr %this, i1 %c, i32 %v2) { ; CHECK-LABEL: @_ZN2ap2aqEv( _ZN1yIN1z2aiE2aaIS1_EE2ahEv.exit: br i1 %c, label %if.end, label %land.rhs land.rhs: ; preds = %_ZN1yIN1z2aiE2aaIS1_EE2ahEv.exit - %0 = bitcast <1 x %"struct.z::ai"*> zeroinitializer to %"struct.z::ai"* - %retval.sroa.0.0..sroa_idx.i = getelementptr inbounds %"struct.z::ai", %"struct.z::ai"* %0, i64 0, i32 0 - %retval.sroa.0.0.copyload.i = load i32, i32* %retval.sroa.0.0..sroa_idx.i, align 4 + %0 = bitcast <1 x ptr> zeroinitializer to ptr + %retval.sroa.0.0.copyload.i = load i32, ptr %0, align 4 %tobool5 = icmp eq i32 %retval.sroa.0.0.copyload.i, 0 %spec.select = select i1 %tobool5, i32 %v2, i32 0 br label %if.end diff --git a/llvm/test/Transforms/SimplifyCFG/2003-03-07-DominateProblem.ll b/llvm/test/Transforms/SimplifyCFG/2003-03-07-DominateProblem.ll index 53b281421ab72f..f053022f30d69d 100644 --- a/llvm/test/Transforms/SimplifyCFG/2003-03-07-DominateProblem.ll +++ b/llvm/test/Transforms/SimplifyCFG/2003-03-07-DominateProblem.ll @@ -1,15 +1,15 @@ ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -disable-output -define void @test(i32* %ldo, i1 %c, i1 %d) { +define void @test(ptr %ldo, i1 %c, i1 %d) { bb9: br i1 %c, label %bb11, label %bb10 bb10: ; preds = %bb9 br label %bb11 bb11: ; preds = %bb10, %bb9 - %reg330 = phi i32* [ null, %bb10 ], [ %ldo, %bb9 ] ; [#uses=1] + %reg330 = phi ptr [ null, %bb10 ], [ %ldo, %bb9 ] ; [#uses=1] br label %bb20 bb20: ; preds = %bb20, %bb11 - store i32* %reg330, i32** null + store ptr %reg330, ptr null br i1 %d, label %bb20, label %done done: ; preds = %bb20 ret void diff --git a/llvm/test/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll b/llvm/test/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll index 219fc40bfc69c2..3d330b92c16c14 100644 --- a/llvm/test/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll +++ b/llvm/test/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll @@ -2,14 +2,14 @@ ; ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -disable-output -define i32 @test() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define i32 @test() personality ptr @__gxx_personality_v0 { %A = invoke i32 @test( ) to label %Ret unwind label %Ret2 ; [#uses=1] Ret: ; preds = %0 ret i32 %A Ret2: ; preds = %0 - %val = landingpad { i8*, i32 } - catch i8* null + %val = landingpad { ptr, i32 } + catch ptr null ret i32 undef } diff --git a/llvm/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch-dbg.ll b/llvm/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch-dbg.ll index 9270266536b328..0424a75e1027cf 100644 --- a/llvm/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch-dbg.ll +++ b/llvm/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch-dbg.ll @@ -2,22 +2,22 @@ ; CHECK-NOT: switch %llvm.dbg.anchor.type = type { i32, i32 } - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8* } + %llvm.dbg.compile_unit.type = type { i32, ptr, i32, ptr, ptr, ptr, i1, i1, ptr } @llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" -@.str = internal constant [4 x i8] c"a.c\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] -@.str1 = internal constant [6 x i8] c"/tmp/\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] -@.str2 = internal constant [55 x i8] c"4.2.1 (Based on Apple Inc. build 5636) (LLVM build 00)\00", section "llvm.metadata" ; <[55 x i8]*> [#uses=1] -@llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6 x i8], [6 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([55 x i8], [55 x i8]* @.str2, i32 0, i32 0), i1 true, i1 false, i8* null }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] +@.str = internal constant [4 x i8] c"a.c\00", section "llvm.metadata" ; [#uses=1] +@.str1 = internal constant [6 x i8] c"/tmp/\00", section "llvm.metadata" ; [#uses=1] +@.str2 = internal constant [55 x i8] c"4.2.1 (Based on Apple Inc. build 5636) (LLVM build 00)\00", section "llvm.metadata" ; [#uses=1] +@llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, ptr @llvm.dbg.compile_units, i32 1, ptr @.str, ptr @.str1, ptr @.str2, i1 true, i1 false, ptr null }, section "llvm.metadata" ; [#uses=1] -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind +declare void @llvm.dbg.stoppoint(i32, i32, ptr) nounwind ; Test folding all to same dest define i32 @test3(i1 %C) { br i1 %C, label %Start, label %TheDest Start: ; preds = %0 -call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) +call void @llvm.dbg.stoppoint(i32 5, i32 0, ptr @llvm.dbg.compile_unit) switch i32 3, label %TheDest [ i32 0, label %TheDest i32 1, label %TheDest @@ -34,10 +34,10 @@ define i32 @test4(i32 %C) { i32 0, label %L2 ] L1: ; preds = %0 -call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) +call void @llvm.dbg.stoppoint(i32 5, i32 0, ptr @llvm.dbg.compile_unit) ret i32 0 L2: ; preds = %0 -call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) +call void @llvm.dbg.stoppoint(i32 5, i32 0, ptr @llvm.dbg.compile_unit) ret i32 1 } @@ -48,10 +48,10 @@ define i32 @test5(i32 %C) { i32 123, label %L1 ] L1: ; preds = %0, %0 -call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) +call void @llvm.dbg.stoppoint(i32 5, i32 0, ptr @llvm.dbg.compile_unit) ret i32 0 L2: ; preds = %0 -call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) +call void @llvm.dbg.stoppoint(i32 5, i32 0, ptr @llvm.dbg.compile_unit) ret i32 1 } diff --git a/llvm/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll b/llvm/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll index a7806e958856b4..d77b8c04ec1a55 100644 --- a/llvm/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll +++ b/llvm/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll @@ -1,8 +1,8 @@ ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -disable-output ; PR584 -@g_38098584 = external global i32 ; [#uses=1] -@g_60187400 = external global i32 ; [#uses=1] -@g_59182229 = external global i32 ; [#uses=2] +@g_38098584 = external global i32 ; [#uses=1] +@g_60187400 = external global i32 ; [#uses=1] +@g_59182229 = external global i32 ; [#uses=2] define i32 @_Z13func_26556482h(i8 %l_88173906) { entry: @@ -30,7 +30,7 @@ endif.0: ; preds = %loopentry.0 %tmp.14 = sext i8 %tmp.1 to i32 ; [#uses=1] %tmp.16 = zext i8 %l_88173906 to i32 ; [#uses=1] %tmp.17 = icmp sgt i32 %tmp.14, %tmp.16 ; [#uses=1] - %tmp.19 = load i32, i32* @g_59182229 ; [#uses=2] + %tmp.19 = load i32, ptr @g_59182229 ; [#uses=2] br i1 %tmp.17, label %cond_true, label %cond_false cond_true: ; preds = %endif.0 %tmp.20 = icmp ne i32 %tmp.19, 1 ; [#uses=1] @@ -53,7 +53,7 @@ loopentry.1: ; preds = %endif.3, %else.2 %tmp.29 = icmp sgt i32 %i.1.1, 99 ; [#uses=1] br i1 %tmp.29, label %endif.2, label %no_exit.1 no_exit.1: ; preds = %loopentry.1 - %tmp.30 = load i32, i32* @g_38098584 ; [#uses=1] + %tmp.30 = load i32, ptr @g_38098584 ; [#uses=1] %tmp.31 = icmp eq i32 %tmp.30, 0 ; [#uses=1] br i1 %tmp.31, label %else.3, label %then.3 then.3: ; preds = %no_exit.1 @@ -65,7 +65,7 @@ then.4: ; preds = %else.3 else.4: ; preds = %else.3 br i1 false, label %else.5, label %then.5 then.5: ; preds = %else.4 - store i32 -1004318825, i32* @g_59182229 + store i32 -1004318825, ptr @g_59182229 br label %return else.5: ; preds = %else.4 br label %loopentry.3 @@ -77,7 +77,7 @@ no_exit.3: ; preds = %loopentry.3 %tmp.57 = icmp eq i8 %l_88173906_addr.1, 0 ; [#uses=1] br i1 %tmp.57, label %else.7, label %then.7 then.7: ; preds = %no_exit.3 - store i32 16239, i32* @g_60187400 + store i32 16239, ptr @g_60187400 %inc.2 = add i32 %i.3.3, 1 ; [#uses=1] br label %loopentry.3 else.7: ; preds = %no_exit.3 diff --git a/llvm/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll b/llvm/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll index ff44358ea63f66..da839f25a80516 100644 --- a/llvm/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll +++ b/llvm/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll @@ -6,12 +6,12 @@ entry: %tmp.14.i19 = icmp eq i32 0, 2 ; [#uses=1] br i1 %tmp.14.i19, label %endif.1.i20, label %read_min.exit endif.1.i20: ; preds = %entry - %tmp.9.i.i = icmp eq i8* null, null ; [#uses=1] + %tmp.9.i.i = icmp eq ptr null, null ; [#uses=1] br i1 %tmp.9.i.i, label %then.i12.i, label %then.i.i then.i.i: ; preds = %endif.1.i20 ret void then.i12.i: ; preds = %endif.1.i20 - %tmp.9.i4.i = icmp eq i8* null, null ; [#uses=1] + %tmp.9.i4.i = icmp eq ptr null, null ; [#uses=1] br i1 %tmp.9.i4.i, label %endif.2.i33, label %then.i5.i then.i5.i: ; preds = %then.i12.i ret void @@ -58,7 +58,7 @@ then.2.i: ; preds = %endif.1.i, %then.1.i getfree.exit: ; preds = %endif.1.i, %then.1.i ret void endif.1: ; preds = %read_min.exit - %tmp.27.i = getelementptr i32, i32* null, i32 0 ; [#uses=0] + %tmp.27.i = getelementptr i32, ptr null, i32 0 ; [#uses=0] br i1 false, label %loopexit.0.i15, label %no_exit.0.i14 no_exit.0.i14: ; preds = %endif.1 ret void diff --git a/llvm/test/Transforms/SimplifyCFG/2005-10-02-InvokeSimplify.ll b/llvm/test/Transforms/SimplifyCFG/2005-10-02-InvokeSimplify.ll index a17b1d714ace32..ac78d4866bb246 100644 --- a/llvm/test/Transforms/SimplifyCFG/2005-10-02-InvokeSimplify.ll +++ b/llvm/test/Transforms/SimplifyCFG/2005-10-02-InvokeSimplify.ll @@ -1,11 +1,11 @@ ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -disable-output -define i1 @foo() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define i1 @foo() personality ptr @__gxx_personality_v0 { %X = invoke i1 @foo( ) to label %N unwind label %F ; [#uses=1] F: ; preds = %0 - %val = landingpad { i8*, i32 } - catch i8* null + %val = landingpad { ptr, i32 } + catch ptr null ret i1 false N: ; preds = %0 br i1 %X, label %A, label %B diff --git a/llvm/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll b/llvm/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll index d71b969d56bfe4..3db0a04b2a9ae7 100644 --- a/llvm/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll +++ b/llvm/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll @@ -3,42 +3,42 @@ ; RUN: opt < %s -passes=simplifycfg,instsimplify,simplifycfg -simplifycfg-require-and-preserve-domtree=1 | llvm-dis | FileCheck %s %struct.anon = type { i32, i32, i32, i32, [1024 x i8] } -@_zero_ = external global %struct.anon* ; <%struct.anon**> [#uses=2] -@_one_ = external global %struct.anon* ; <%struct.anon**> [#uses=4] -@str = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=0] +@_zero_ = external global ptr ; [#uses=2] +@_one_ = external global ptr ; [#uses=4] +@str = internal constant [4 x i8] c"%d\0A\00" ; [#uses=0] -declare i32 @bc_compare(%struct.anon*, %struct.anon*) +declare i32 @bc_compare(ptr, ptr) -declare void @free_num(%struct.anon**) +declare void @free_num(ptr) -declare %struct.anon* @copy_num(%struct.anon*) +declare ptr @copy_num(ptr) -declare void @init_num(%struct.anon**) +declare void @init_num(ptr) -declare %struct.anon* @new_num(i32, i32) +declare ptr @new_num(i32, i32) -declare void @int2num(%struct.anon**, i32) +declare void @int2num(ptr, i32) -declare void @bc_multiply(%struct.anon*, %struct.anon*, %struct.anon**, i32) +declare void @bc_multiply(ptr, ptr, ptr, i32) -declare void @bc_raise(%struct.anon*, %struct.anon*, %struct.anon**, i32) +declare void @bc_raise(ptr, ptr, ptr, i32) -declare i32 @bc_divide(%struct.anon*, %struct.anon*, %struct.anon**, i32) +declare i32 @bc_divide(ptr, ptr, ptr, i32) -declare void @bc_add(%struct.anon*, %struct.anon*, %struct.anon**) +declare void @bc_add(ptr, ptr, ptr) -declare i32 @_do_compare(%struct.anon*, %struct.anon*, i32, i32) +declare i32 @_do_compare(ptr, ptr, i32, i32) -declare i32 @printf(i8*, ...) +declare i32 @printf(ptr, ...) -define i32 @bc_sqrt(%struct.anon** %num, i32 %scale) { +define i32 @bc_sqrt(ptr %num, i32 %scale) { entry: - %guess = alloca %struct.anon* ; <%struct.anon**> [#uses=7] - %guess1 = alloca %struct.anon* ; <%struct.anon**> [#uses=7] - %point5 = alloca %struct.anon* ; <%struct.anon**> [#uses=3] - %tmp = load %struct.anon*, %struct.anon** %num ; <%struct.anon*> [#uses=1] - %tmp1 = load %struct.anon*, %struct.anon** @_zero_ ; <%struct.anon*> [#uses=1] - %tmp.upgrd.1 = call i32 @bc_compare( %struct.anon* %tmp, %struct.anon* %tmp1 ) ; [#uses=2] + %guess = alloca ptr ; [#uses=7] + %guess1 = alloca ptr ; [#uses=7] + %point5 = alloca ptr ; [#uses=3] + %tmp = load ptr, ptr %num ; [#uses=1] + %tmp1 = load ptr, ptr @_zero_ ; [#uses=1] + %tmp.upgrd.1 = call i32 @bc_compare( ptr %tmp, ptr %tmp1 ) ; [#uses=2] %tmp.upgrd.2 = icmp slt i32 %tmp.upgrd.1, 0 ; [#uses=1] br i1 %tmp.upgrd.2, label %cond_true, label %cond_false cond_true: ; preds = %entry @@ -47,58 +47,58 @@ cond_false: ; preds = %entry %tmp5 = icmp eq i32 %tmp.upgrd.1, 0 ; [#uses=1] br i1 %tmp5, label %cond_true6, label %cond_next13 cond_true6: ; preds = %cond_false - call void @free_num( %struct.anon** %num ) - %tmp8 = load %struct.anon*, %struct.anon** @_zero_ ; <%struct.anon*> [#uses=1] - %tmp9 = call %struct.anon* @copy_num( %struct.anon* %tmp8 ) ; <%struct.anon*> [#uses=1] - store %struct.anon* %tmp9, %struct.anon** %num + call void @free_num( ptr %num ) + %tmp8 = load ptr, ptr @_zero_ ; [#uses=1] + %tmp9 = call ptr @copy_num( ptr %tmp8 ) ; [#uses=1] + store ptr %tmp9, ptr %num ret i32 1 cond_next13: ; preds = %cond_false - %tmp15 = load %struct.anon*, %struct.anon** %num ; <%struct.anon*> [#uses=1] - %tmp16 = load %struct.anon*, %struct.anon** @_one_ ; <%struct.anon*> [#uses=1] - %tmp17 = call i32 @bc_compare( %struct.anon* %tmp15, %struct.anon* %tmp16 ) ; [#uses=2] + %tmp15 = load ptr, ptr %num ; [#uses=1] + %tmp16 = load ptr, ptr @_one_ ; [#uses=1] + %tmp17 = call i32 @bc_compare( ptr %tmp15, ptr %tmp16 ) ; [#uses=2] %tmp19 = icmp eq i32 %tmp17, 0 ; [#uses=1] br i1 %tmp19, label %cond_true20, label %cond_next27 cond_true20: ; preds = %cond_next13 - call void @free_num( %struct.anon** %num ) - %tmp22 = load %struct.anon*, %struct.anon** @_one_ ; <%struct.anon*> [#uses=1] - %tmp23 = call %struct.anon* @copy_num( %struct.anon* %tmp22 ) ; <%struct.anon*> [#uses=1] - store %struct.anon* %tmp23, %struct.anon** %num + call void @free_num( ptr %num ) + %tmp22 = load ptr, ptr @_one_ ; [#uses=1] + %tmp23 = call ptr @copy_num( ptr %tmp22 ) ; [#uses=1] + store ptr %tmp23, ptr %num ret i32 1 cond_next27: ; preds = %cond_next13 - %tmp29 = load %struct.anon*, %struct.anon** %num ; <%struct.anon*> [#uses=1] - %tmp30 = getelementptr %struct.anon, %struct.anon* %tmp29, i32 0, i32 2 ; [#uses=1] - %tmp31 = load i32, i32* %tmp30 ; [#uses=2] + %tmp29 = load ptr, ptr %num ; [#uses=1] + %tmp30 = getelementptr %struct.anon, ptr %tmp29, i32 0, i32 2 ; [#uses=1] + %tmp31 = load i32, ptr %tmp30 ; [#uses=2] %tmp33 = icmp sge i32 %tmp31, %scale ; [#uses=1] %max = select i1 %tmp33, i32 %tmp31, i32 %scale ; [#uses=4] %tmp35 = add i32 %max, 2 ; [#uses=0] - call void @init_num( %struct.anon** %guess ) - call void @init_num( %struct.anon** %guess1 ) - %tmp36 = call %struct.anon* @new_num( i32 1, i32 1 ) ; <%struct.anon*> [#uses=2] - store %struct.anon* %tmp36, %struct.anon** %point5 - %tmp.upgrd.3 = getelementptr %struct.anon, %struct.anon* %tmp36, i32 0, i32 4, i32 1 ; [#uses=1] - store i8 5, i8* %tmp.upgrd.3 + call void @init_num( ptr %guess ) + call void @init_num( ptr %guess1 ) + %tmp36 = call ptr @new_num( i32 1, i32 1 ) ; [#uses=2] + store ptr %tmp36, ptr %point5 + %tmp.upgrd.3 = getelementptr %struct.anon, ptr %tmp36, i32 0, i32 4, i32 1 ; [#uses=1] + store i8 5, ptr %tmp.upgrd.3 %tmp39 = icmp slt i32 %tmp17, 0 ; [#uses=1] br i1 %tmp39, label %cond_true40, label %cond_false43 cond_true40: ; preds = %cond_next27 - %tmp41 = load %struct.anon*, %struct.anon** @_one_ ; <%struct.anon*> [#uses=1] - %tmp42 = call %struct.anon* @copy_num( %struct.anon* %tmp41 ) ; <%struct.anon*> [#uses=1] - store %struct.anon* %tmp42, %struct.anon** %guess + %tmp41 = load ptr, ptr @_one_ ; [#uses=1] + %tmp42 = call ptr @copy_num( ptr %tmp41 ) ; [#uses=1] + store ptr %tmp42, ptr %guess br label %bb80.outer cond_false43: ; preds = %cond_next27 - call void @int2num( %struct.anon** %guess, i32 10 ) - %tmp45 = load %struct.anon*, %struct.anon** %num ; <%struct.anon*> [#uses=1] - %tmp46 = getelementptr %struct.anon, %struct.anon* %tmp45, i32 0, i32 1 ; [#uses=1] - %tmp47 = load i32, i32* %tmp46 ; [#uses=1] - call void @int2num( %struct.anon** %guess1, i32 %tmp47 ) - %tmp48 = load %struct.anon*, %struct.anon** %guess1 ; <%struct.anon*> [#uses=1] - %tmp49 = load %struct.anon*, %struct.anon** %point5 ; <%struct.anon*> [#uses=1] - call void @bc_multiply( %struct.anon* %tmp48, %struct.anon* %tmp49, %struct.anon** %guess1, i32 %max ) - %tmp51 = load %struct.anon*, %struct.anon** %guess1 ; <%struct.anon*> [#uses=1] - %tmp52 = getelementptr %struct.anon, %struct.anon* %tmp51, i32 0, i32 2 ; [#uses=1] - store i32 0, i32* %tmp52 - %tmp53 = load %struct.anon*, %struct.anon** %guess ; <%struct.anon*> [#uses=1] - %tmp54 = load %struct.anon*, %struct.anon** %guess1 ; <%struct.anon*> [#uses=1] - call void @bc_raise( %struct.anon* %tmp53, %struct.anon* %tmp54, %struct.anon** %guess, i32 %max ) + call void @int2num( ptr %guess, i32 10 ) + %tmp45 = load ptr, ptr %num ; [#uses=1] + %tmp46 = getelementptr %struct.anon, ptr %tmp45, i32 0, i32 1 ; [#uses=1] + %tmp47 = load i32, ptr %tmp46 ; [#uses=1] + call void @int2num( ptr %guess1, i32 %tmp47 ) + %tmp48 = load ptr, ptr %guess1 ; [#uses=1] + %tmp49 = load ptr, ptr %point5 ; [#uses=1] + call void @bc_multiply( ptr %tmp48, ptr %tmp49, ptr %guess1, i32 %max ) + %tmp51 = load ptr, ptr %guess1 ; [#uses=1] + %tmp52 = getelementptr %struct.anon, ptr %tmp51, i32 0, i32 2 ; [#uses=1] + store i32 0, ptr %tmp52 + %tmp53 = load ptr, ptr %guess ; [#uses=1] + %tmp54 = load ptr, ptr %guess1 ; [#uses=1] + call void @bc_raise( ptr %tmp53, ptr %tmp54, ptr %guess, i32 %max ) br label %bb80.outer bb80.outer: ; preds = %cond_true83, %cond_false43, %cond_true40 %done.1.ph = phi i32 [ 1, %cond_true83 ], [ 0, %cond_true40 ], [ 0, %cond_false43 ] ; [#uses=1] @@ -107,17 +107,17 @@ bb80: ; preds = %cond_true83, %bb80.outer %tmp82 = icmp eq i32 %done.1.ph, 0 ; [#uses=1] br i1 %tmp82, label %cond_true83, label %bb86 cond_true83: ; preds = %bb80 - %tmp71 = call i32 @_do_compare( %struct.anon* null, %struct.anon* null, i32 0, i32 1 ) ; [#uses=1] + %tmp71 = call i32 @_do_compare( ptr null, ptr null, i32 0, i32 1 ) ; [#uses=1] %tmp76 = icmp eq i32 %tmp71, 0 ; [#uses=1] br i1 %tmp76, label %bb80.outer, label %bb80 ; CHECK: bb86 bb86: ; preds = %bb80 - call void @free_num( %struct.anon** %num ) - %tmp88 = load %struct.anon*, %struct.anon** %guess ; <%struct.anon*> [#uses=1] - %tmp89 = load %struct.anon*, %struct.anon** @_one_ ; <%struct.anon*> [#uses=1] - %tmp92 = call i32 @bc_divide( %struct.anon* %tmp88, %struct.anon* %tmp89, %struct.anon** %num, i32 %max ) ; [#uses=0] - call void @free_num( %struct.anon** %guess ) - call void @free_num( %struct.anon** %guess1 ) - call void @free_num( %struct.anon** %point5 ) + call void @free_num( ptr %num ) + %tmp88 = load ptr, ptr %guess ; [#uses=1] + %tmp89 = load ptr, ptr @_one_ ; [#uses=1] + %tmp92 = call i32 @bc_divide( ptr %tmp88, ptr %tmp89, ptr %num, i32 %max ) ; [#uses=0] + call void @free_num( ptr %guess ) + call void @free_num( ptr %guess1 ) + call void @free_num( ptr %point5 ) ret i32 1 } diff --git a/llvm/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll b/llvm/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll index 2958a9e0445f0c..28fc98ab55b7b5 100644 --- a/llvm/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll +++ b/llvm/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll @@ -5,36 +5,36 @@ target datalayout = "E-p:32:32" target triple = "powerpc-unknown-linux-gnu" %struct.CUMULATIVE_ARGS = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 } %struct.eh_status = type opaque - %struct.emit_status = type { i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack*, i32, %struct.location_t, i32, i8*, %struct.rtx_def** } - %struct.expr_status = type { i32, i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def* } - %struct.function = type { %struct.eh_status*, %struct.expr_status*, %struct.emit_status*, %struct.varasm_status*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.function*, i32, i32, i32, i32, %struct.rtx_def*, %struct.CUMULATIVE_ARGS, %struct.rtx_def*, %struct.rtx_def*, %struct.initial_value_struct*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, i8, i32, i64, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.varray_head_tag*, %struct.temp_slot*, i32, %struct.var_refs_queue*, i32, i32, %struct.rtvec_def*, %struct.tree_node*, i32, i32, i32, %struct.machine_function*, i32, i32, i8, i8, %struct.language_function*, %struct.rtx_def*, i32, i32, i32, i32, %struct.location_t, %struct.varray_head_tag*, %struct.tree_node*, i8, i8, i8 } + %struct.emit_status = type { i32, i32, ptr, ptr, ptr, i32, %struct.location_t, i32, ptr, ptr } + %struct.expr_status = type { i32, i32, i32, ptr, ptr, ptr } + %struct.function = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, ptr, %struct.CUMULATIVE_ARGS, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, ptr, i32, i32, ptr, ptr, i32, i32, i32, ptr, i32, i32, i8, i8, ptr, ptr, i32, i32, i32, i32, %struct.location_t, ptr, ptr, i8, i8, i8 } %struct.initial_value_struct = type opaque %struct.lang_decl = type opaque %struct.lang_type = type opaque %struct.language_function = type opaque - %struct.location_t = type { i8*, i32 } - %struct.machine_function = type { i32, i32, i8*, i32, i32 } + %struct.location_t = type { ptr, i32 } + %struct.machine_function = type { i32, i32, ptr, i32, i32 } %struct.rtunion = type { i32 } - %struct.rtvec_def = type { i32, [1 x %struct.rtx_def*] } + %struct.rtvec_def = type { i32, [1 x ptr] } %struct.rtx_def = type { i16, i8, i8, %struct.u } - %struct.sequence_stack = type { %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack* } + %struct.sequence_stack = type { ptr, ptr, ptr } %struct.temp_slot = type opaque - %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %union.tree_ann_d*, i8, i8, i8, i8, i8 } - %struct.tree_decl = type { %struct.tree_common, %struct.location_t, i32, %struct.tree_node*, i8, i8, i8, i8, i8, i8, i8, i8, i32, %struct.tree_decl_u1, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.tree_decl_u2, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_decl* } + %struct.tree_common = type { ptr, ptr, ptr, i8, i8, i8, i8, i8 } + %struct.tree_decl = type { %struct.tree_common, %struct.location_t, i32, ptr, i8, i8, i8, i8, i8, i8, i8, i8, i32, %struct.tree_decl_u1, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.tree_decl_u2, ptr, ptr, i64, ptr } %struct.tree_decl_u1 = type { i64 } - %struct.tree_decl_u2 = type { %struct.function* } + %struct.tree_decl_u2 = type { ptr } %struct.tree_node = type { %struct.tree_decl } - %struct.tree_type = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i32, i16, i8, i8, i32, %struct.tree_node*, %struct.tree_node*, %struct.rtunion, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_type* } + %struct.tree_type = type { %struct.tree_common, ptr, ptr, ptr, ptr, i32, i16, i8, i8, i32, ptr, ptr, %struct.rtunion, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr } %struct.u = type { [1 x i64] } - %struct.var_refs_queue = type { %struct.rtx_def*, i32, i32, %struct.var_refs_queue* } + %struct.var_refs_queue = type { ptr, i32, i32, ptr } %struct.varasm_status = type opaque - %struct.varray_head_tag = type { i32, i32, i32, i8*, %struct.u } + %struct.varray_head_tag = type { i32, i32, i32, ptr, %struct.u } %union.tree_ann_d = type opaque -@mode_class = external global [35 x i8] ; <[35 x i8]*> [#uses=3] +@mode_class = external global [35 x i8] ; [#uses=3] define void @fold_builtin_classify() { entry: - %tmp63 = load i32, i32* null ; [#uses=1] + %tmp63 = load i32, ptr null ; [#uses=1] switch i32 %tmp63, label %bb276 [ i32 414, label %bb145 i32 417, label %bb @@ -42,54 +42,48 @@ entry: bb: ; preds = %entry ret void bb145: ; preds = %entry - %tmp146 = load %struct.tree_node*, %struct.tree_node** null ; <%struct.tree_node*> [#uses=1] - %tmp148 = getelementptr %struct.tree_node, %struct.tree_node* %tmp146, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1] - %tmp149 = load %struct.tree_node*, %struct.tree_node** %tmp148 ; <%struct.tree_node*> [#uses=1] - %tmp150 = bitcast %struct.tree_node* %tmp149 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1] - %tmp151 = getelementptr %struct.tree_type, %struct.tree_type* %tmp150, i32 0, i32 6 ; [#uses=1] - %tmp151.upgrd.1 = bitcast i16* %tmp151 to i32* ; [#uses=1] - %tmp152 = load i32, i32* %tmp151.upgrd.1 ; [#uses=1] + %tmp146 = load ptr, ptr null ; [#uses=1] + %tmp148 = getelementptr %struct.tree_node, ptr %tmp146, i32 0, i32 0, i32 0, i32 1 ; [#uses=1] + %tmp149 = load ptr, ptr %tmp148 ; [#uses=1] + %tmp151 = getelementptr %struct.tree_type, ptr %tmp149, i32 0, i32 6 ; [#uses=1] + %tmp152 = load i32, ptr %tmp151 ; [#uses=1] %tmp154 = lshr i32 %tmp152, 16 ; [#uses=1] %tmp154.mask = and i32 %tmp154, 127 ; [#uses=1] %gep.upgrd.2 = zext i32 %tmp154.mask to i64 ; [#uses=1] - %tmp155 = getelementptr [35 x i8], [35 x i8]* @mode_class, i32 0, i64 %gep.upgrd.2 ; [#uses=1] - %tmp156 = load i8, i8* %tmp155 ; [#uses=1] + %tmp155 = getelementptr [35 x i8], ptr @mode_class, i32 0, i64 %gep.upgrd.2 ; [#uses=1] + %tmp156 = load i8, ptr %tmp155 ; [#uses=1] %tmp157 = icmp eq i8 %tmp156, 4 ; [#uses=1] br i1 %tmp157, label %cond_next241, label %cond_true158 cond_true158: ; preds = %bb145 - %tmp172 = load %struct.tree_node*, %struct.tree_node** null ; <%struct.tree_node*> [#uses=1] - %tmp174 = getelementptr %struct.tree_node, %struct.tree_node* %tmp172, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1] - %tmp175 = load %struct.tree_node*, %struct.tree_node** %tmp174 ; <%struct.tree_node*> [#uses=1] - %tmp176 = bitcast %struct.tree_node* %tmp175 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1] - %tmp177 = getelementptr %struct.tree_type, %struct.tree_type* %tmp176, i32 0, i32 6 ; [#uses=1] - %tmp177.upgrd.3 = bitcast i16* %tmp177 to i32* ; [#uses=1] - %tmp178 = load i32, i32* %tmp177.upgrd.3 ; [#uses=1] + %tmp172 = load ptr, ptr null ; [#uses=1] + %tmp174 = getelementptr %struct.tree_node, ptr %tmp172, i32 0, i32 0, i32 0, i32 1 ; [#uses=1] + %tmp175 = load ptr, ptr %tmp174 ; [#uses=1] + %tmp177 = getelementptr %struct.tree_type, ptr %tmp175, i32 0, i32 6 ; [#uses=1] + %tmp178 = load i32, ptr %tmp177 ; [#uses=1] %tmp180 = lshr i32 %tmp178, 16 ; [#uses=1] %tmp180.mask = and i32 %tmp180, 127 ; [#uses=1] %gep.upgrd.4 = zext i32 %tmp180.mask to i64 ; [#uses=1] - %tmp181 = getelementptr [35 x i8], [35 x i8]* @mode_class, i32 0, i64 %gep.upgrd.4 ; [#uses=1] - %tmp182 = load i8, i8* %tmp181 ; [#uses=1] + %tmp181 = getelementptr [35 x i8], ptr @mode_class, i32 0, i64 %gep.upgrd.4 ; [#uses=1] + %tmp182 = load i8, ptr %tmp181 ; [#uses=1] %tmp183 = icmp eq i8 %tmp182, 8 ; [#uses=1] br i1 %tmp183, label %cond_next241, label %cond_true184 cond_true184: ; preds = %cond_true158 - %tmp185 = load %struct.tree_node*, %struct.tree_node** null ; <%struct.tree_node*> [#uses=1] - %tmp187 = getelementptr %struct.tree_node, %struct.tree_node* %tmp185, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1] - %tmp188 = load %struct.tree_node*, %struct.tree_node** %tmp187 ; <%struct.tree_node*> [#uses=1] - %tmp189 = bitcast %struct.tree_node* %tmp188 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1] - %tmp190 = getelementptr %struct.tree_type, %struct.tree_type* %tmp189, i32 0, i32 6 ; [#uses=1] - %tmp190.upgrd.5 = bitcast i16* %tmp190 to i32* ; [#uses=1] - %tmp191 = load i32, i32* %tmp190.upgrd.5 ; [#uses=1] + %tmp185 = load ptr, ptr null ; [#uses=1] + %tmp187 = getelementptr %struct.tree_node, ptr %tmp185, i32 0, i32 0, i32 0, i32 1 ; [#uses=1] + %tmp188 = load ptr, ptr %tmp187 ; [#uses=1] + %tmp190 = getelementptr %struct.tree_type, ptr %tmp188, i32 0, i32 6 ; [#uses=1] + %tmp191 = load i32, ptr %tmp190 ; [#uses=1] %tmp193 = lshr i32 %tmp191, 16 ; [#uses=1] %tmp193.mask = and i32 %tmp193, 127 ; [#uses=1] %gep.upgrd.6 = zext i32 %tmp193.mask to i64 ; [#uses=1] - %tmp194 = getelementptr [35 x i8], [35 x i8]* @mode_class, i32 0, i64 %gep.upgrd.6 ; [#uses=1] - %tmp195 = load i8, i8* %tmp194 ; [#uses=1] + %tmp194 = getelementptr [35 x i8], ptr @mode_class, i32 0, i64 %gep.upgrd.6 ; [#uses=1] + %tmp195 = load i8, ptr %tmp194 ; [#uses=1] %tmp196 = icmp eq i8 %tmp195, 4 ; [#uses=1] br i1 %tmp196, label %cond_next241, label %cond_true197 cond_true197: ; preds = %cond_true184 ret void cond_next241: ; preds = %cond_true184, %cond_true158, %bb145 - %tmp245 = load i32, i32* null ; [#uses=0] + %tmp245 = load i32, ptr null ; [#uses=0] ret void bb276: ; preds = %entry ret void diff --git a/llvm/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll b/llvm/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll index 7ee31a4d807d57..360a5e54faa0a1 100644 --- a/llvm/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll +++ b/llvm/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll @@ -4,114 +4,114 @@ ; ModuleID = '2006-12-08-Ptr-ICmp-Branch.ll' target datalayout = "e-p:32:32" target triple = "i686-pc-linux-gnu" - %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] } - %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] } - %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 } - %struct.charsequence = type { i8*, i32, i32 } - %struct.trie_s = type { [26 x %struct.trie_s*], i32 } -@str = external global [14 x i8] ; <[14 x i8]*> [#uses=0] -@str.upgrd.1 = external global [32 x i8] ; <[32 x i8]*> [#uses=0] -@str.upgrd.2 = external global [12 x i8] ; <[12 x i8]*> [#uses=0] -@C.0.2294 = external global %struct.charsequence ; <%struct.charsequence*> [#uses=3] -@t = external global %struct.trie_s* ; <%struct.trie_s**> [#uses=0] -@str.upgrd.3 = external global [3 x i8] ; <[3 x i8]*> [#uses=0] -@str.upgrd.4 = external global [26 x i8] ; <[26 x i8]*> [#uses=0] + %struct.FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i32, i32, [40 x i8] } + %struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i32, i32, [40 x i8] } + %struct._IO_marker = type { ptr, ptr, i32 } + %struct.charsequence = type { ptr, i32, i32 } + %struct.trie_s = type { [26 x ptr], i32 } +@str = external global [14 x i8] ; [#uses=0] +@str.upgrd.1 = external global [32 x i8] ; [#uses=0] +@str.upgrd.2 = external global [12 x i8] ; [#uses=0] +@C.0.2294 = external global %struct.charsequence ; [#uses=3] +@t = external global ptr ; [#uses=0] +@str.upgrd.3 = external global [3 x i8] ; [#uses=0] +@str.upgrd.4 = external global [26 x i8] ; [#uses=0] -declare void @charsequence_reset(%struct.charsequence*) +declare void @charsequence_reset(ptr) -declare void @free(i8*) +declare void @free(ptr) -declare void @charsequence_push(%struct.charsequence*, i8) +declare void @charsequence_push(ptr, i8) -declare i8* @charsequence_val(%struct.charsequence*) +declare ptr @charsequence_val(ptr) -declare i32 @_IO_getc(%struct.FILE*) +declare i32 @_IO_getc(ptr) declare i32 @tolower(i32) -declare %struct.trie_s* @trie_insert(%struct.trie_s*, i8*) +declare ptr @trie_insert(ptr, ptr) -declare i32 @feof(%struct.FILE*) +declare i32 @feof(ptr) -define void @addfile(%struct.trie_s* %t, %struct.FILE* %f) { +define void @addfile(ptr %t, ptr %f) { entry: - %t_addr = alloca %struct.trie_s* ; <%struct.trie_s**> [#uses=2] - %f_addr = alloca %struct.FILE* ; <%struct.FILE**> [#uses=3] - %c = alloca i8, align 1 ; [#uses=7] - %wstate = alloca i32, align 4 ; [#uses=4] - %cs = alloca %struct.charsequence, align 16 ; <%struct.charsequence*> [#uses=7] - %str = alloca i8*, align 4 ; [#uses=3] + %t_addr = alloca ptr ; [#uses=2] + %f_addr = alloca ptr ; [#uses=3] + %c = alloca i8, align 1 ; [#uses=7] + %wstate = alloca i32, align 4 ; [#uses=4] + %cs = alloca %struct.charsequence, align 16 ; [#uses=7] + %str = alloca ptr, align 4 ; [#uses=3] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - store %struct.trie_s* %t, %struct.trie_s** %t_addr - store %struct.FILE* %f, %struct.FILE** %f_addr - store i32 0, i32* %wstate - %tmp = getelementptr %struct.charsequence, %struct.charsequence* %cs, i64 0, i32 0 ; [#uses=1] - %tmp1 = getelementptr %struct.charsequence, %struct.charsequence* @C.0.2294, i64 0, i32 0 ; [#uses=1] - %tmp.upgrd.5 = load i8*, i8** %tmp1 ; [#uses=1] - store i8* %tmp.upgrd.5, i8** %tmp - %tmp.upgrd.6 = getelementptr %struct.charsequence, %struct.charsequence* %cs, i64 0, i32 1 ; [#uses=1] - %tmp2 = getelementptr %struct.charsequence, %struct.charsequence* @C.0.2294, i64 0, i32 1 ; [#uses=1] - %tmp.upgrd.7 = load i32, i32* %tmp2 ; [#uses=1] - store i32 %tmp.upgrd.7, i32* %tmp.upgrd.6 - %tmp3 = getelementptr %struct.charsequence, %struct.charsequence* %cs, i64 0, i32 2 ; [#uses=1] - %tmp4 = getelementptr %struct.charsequence, %struct.charsequence* @C.0.2294, i64 0, i32 2 ; [#uses=1] - %tmp5 = load i32, i32* %tmp4 ; [#uses=1] - store i32 %tmp5, i32* %tmp3 + store ptr %t, ptr %t_addr + store ptr %f, ptr %f_addr + store i32 0, ptr %wstate + %tmp = getelementptr %struct.charsequence, ptr %cs, i64 0, i32 0 ; [#uses=1] + %tmp1 = getelementptr %struct.charsequence, ptr @C.0.2294, i64 0, i32 0 ; [#uses=1] + %tmp.upgrd.5 = load ptr, ptr %tmp1 ; [#uses=1] + store ptr %tmp.upgrd.5, ptr %tmp + %tmp.upgrd.6 = getelementptr %struct.charsequence, ptr %cs, i64 0, i32 1 ; [#uses=1] + %tmp2 = getelementptr %struct.charsequence, ptr @C.0.2294, i64 0, i32 1 ; [#uses=1] + %tmp.upgrd.7 = load i32, ptr %tmp2 ; [#uses=1] + store i32 %tmp.upgrd.7, ptr %tmp.upgrd.6 + %tmp3 = getelementptr %struct.charsequence, ptr %cs, i64 0, i32 2 ; [#uses=1] + %tmp4 = getelementptr %struct.charsequence, ptr @C.0.2294, i64 0, i32 2 ; [#uses=1] + %tmp5 = load i32, ptr %tmp4 ; [#uses=1] + store i32 %tmp5, ptr %tmp3 br label %bb33 bb: ; preds = %bb33 - %tmp.upgrd.8 = load %struct.FILE*, %struct.FILE** %f_addr ; <%struct.FILE*> [#uses=1] - %tmp.upgrd.9 = call i32 @_IO_getc( %struct.FILE* %tmp.upgrd.8 ) ; [#uses=1] + %tmp.upgrd.8 = load ptr, ptr %f_addr ; [#uses=1] + %tmp.upgrd.9 = call i32 @_IO_getc( ptr %tmp.upgrd.8 ) ; [#uses=1] %tmp6 = call i32 @tolower( i32 %tmp.upgrd.9 ) ; [#uses=1] %tmp6.upgrd.10 = trunc i32 %tmp6 to i8 ; [#uses=1] - store i8 %tmp6.upgrd.10, i8* %c - %tmp7 = load i32, i32* %wstate ; [#uses=1] + store i8 %tmp6.upgrd.10, ptr %c + %tmp7 = load i32, ptr %wstate ; [#uses=1] %tmp.upgrd.11 = icmp ne i32 %tmp7, 0 ; [#uses=1] br i1 %tmp.upgrd.11, label %cond_true, label %cond_false cond_true: ; preds = %bb - %tmp.upgrd.12 = load i8, i8* %c ; [#uses=1] + %tmp.upgrd.12 = load i8, ptr %c ; [#uses=1] %tmp8 = icmp sle i8 %tmp.upgrd.12, 96 ; [#uses=1] br i1 %tmp8, label %cond_true9, label %cond_next cond_true9: ; preds = %cond_true br label %bb16 cond_next: ; preds = %cond_true - %tmp10 = load i8, i8* %c ; [#uses=1] + %tmp10 = load i8, ptr %c ; [#uses=1] %tmp11 = icmp sgt i8 %tmp10, 122 ; [#uses=1] br i1 %tmp11, label %cond_true12, label %cond_next13 cond_true12: ; preds = %cond_next br label %bb16 cond_next13: ; preds = %cond_next - %tmp14 = load i8, i8* %c ; [#uses=1] + %tmp14 = load i8, ptr %c ; [#uses=1] %tmp14.upgrd.13 = sext i8 %tmp14 to i32 ; [#uses=1] %tmp1415 = trunc i32 %tmp14.upgrd.13 to i8 ; [#uses=1] - call void @charsequence_push( %struct.charsequence* %cs, i8 %tmp1415 ) + call void @charsequence_push( ptr %cs, i8 %tmp1415 ) br label %bb21 bb16: ; preds = %cond_true12, %cond_true9 - %tmp17 = call i8* @charsequence_val( %struct.charsequence* %cs ) ; [#uses=1] - store i8* %tmp17, i8** %str - %tmp.upgrd.14 = load %struct.trie_s*, %struct.trie_s** %t_addr ; <%struct.trie_s*> [#uses=1] - %tmp18 = load i8*, i8** %str ; [#uses=1] - %tmp19 = call %struct.trie_s* @trie_insert( %struct.trie_s* %tmp.upgrd.14, i8* %tmp18 ) ; <%struct.trie_s*> [#uses=0] - %tmp20 = load i8*, i8** %str ; [#uses=1] - call void @free( i8* %tmp20 ) - store i32 0, i32* %wstate + %tmp17 = call ptr @charsequence_val( ptr %cs ) ; [#uses=1] + store ptr %tmp17, ptr %str + %tmp.upgrd.14 = load ptr, ptr %t_addr ; [#uses=1] + %tmp18 = load ptr, ptr %str ; [#uses=1] + %tmp19 = call ptr @trie_insert( ptr %tmp.upgrd.14, ptr %tmp18 ) ; [#uses=0] + %tmp20 = load ptr, ptr %str ; [#uses=1] + call void @free( ptr %tmp20 ) + store i32 0, ptr %wstate br label %bb21 bb21: ; preds = %bb16, %cond_next13 br label %cond_next32 cond_false: ; preds = %bb - %tmp22 = load i8, i8* %c ; [#uses=1] + %tmp22 = load i8, ptr %c ; [#uses=1] %tmp23 = icmp sgt i8 %tmp22, 96 ; [#uses=1] br i1 %tmp23, label %cond_true24, label %cond_next31 cond_true24: ; preds = %cond_false - %tmp25 = load i8, i8* %c ; [#uses=1] + %tmp25 = load i8, ptr %c ; [#uses=1] %tmp26 = icmp sle i8 %tmp25, 122 ; [#uses=1] br i1 %tmp26, label %cond_true27, label %cond_next30 cond_true27: ; preds = %cond_true24 - call void @charsequence_reset( %struct.charsequence* %cs ) - %tmp28 = load i8, i8* %c ; [#uses=1] + call void @charsequence_reset( ptr %cs ) + %tmp28 = load i8, ptr %c ; [#uses=1] %tmp28.upgrd.15 = sext i8 %tmp28 to i32 ; [#uses=1] %tmp2829 = trunc i32 %tmp28.upgrd.15 to i8 ; [#uses=1] - call void @charsequence_push( %struct.charsequence* %cs, i8 %tmp2829 ) - store i32 1, i32* %wstate + call void @charsequence_push( ptr %cs, i8 %tmp2829 ) + store i32 1, ptr %wstate br label %cond_next30 cond_next30: ; preds = %cond_true27, %cond_true24 br label %cond_next31 @@ -120,8 +120,8 @@ cond_next31: ; preds = %cond_next30, %cond_false cond_next32: ; preds = %cond_next31, %bb21 br label %bb33 bb33: ; preds = %cond_next32, %entry - %tmp34 = load %struct.FILE*, %struct.FILE** %f_addr ; <%struct.FILE*> [#uses=1] - %tmp35 = call i32 @feof( %struct.FILE* %tmp34 ) ; [#uses=1] + %tmp34 = load ptr, ptr %f_addr ; [#uses=1] + %tmp35 = call i32 @feof( ptr %tmp34 ) ; [#uses=1] %tmp36 = icmp eq i32 %tmp35, 0 ; [#uses=1] br i1 %tmp36, label %bb, label %bb37 bb37: ; preds = %bb33 diff --git a/llvm/test/Transforms/SimplifyCFG/2007-11-22-InvokeNoUnwind.ll b/llvm/test/Transforms/SimplifyCFG/2007-11-22-InvokeNoUnwind.ll index 5edf8f9e46c230..fd209f8619ceed 100644 --- a/llvm/test/Transforms/SimplifyCFG/2007-11-22-InvokeNoUnwind.ll +++ b/llvm/test/Transforms/SimplifyCFG/2007-11-22-InvokeNoUnwind.ll @@ -2,18 +2,18 @@ ; CHECK-NOT: invoke -declare i32 @func(i8*) nounwind +declare i32 @func(ptr) nounwind -define i32 @test() personality i32 (...)* @__gxx_personality_v0 { - invoke i32 @func( i8* null ) +define i32 @test() personality ptr @__gxx_personality_v0 { + invoke i32 @func( ptr null ) to label %Cont unwind label %Other ; :1 [#uses=0] Cont: ; preds = %0 ret i32 0 Other: ; preds = %0 - landingpad { i8*, i32 } - catch i8* null + landingpad { ptr, i32 } + catch ptr null ret i32 1 } diff --git a/llvm/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll b/llvm/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll index 631c25e33deca8..e09cf7dd33b182 100644 --- a/llvm/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll +++ b/llvm/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll @@ -3,12 +3,12 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i686-apple-darwin8" -@G = weak global i32 0, align 8 ; [#uses=2] +@G = weak global i32 0, align 8 ; [#uses=2] define void @test(i32 %X, i32 %Y, i32 %Z) { entry: %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - %tmp = load i32, i32* @G, align 8 ; [#uses=2] + %tmp = load i32, ptr @G, align 8 ; [#uses=2] %tmp3 = icmp eq i32 %X, %Y ; [#uses=1] %tmp34 = zext i1 %tmp3 to i8 ; [#uses=1] %toBool = icmp ne i8 %tmp34, 0 ; [#uses=1] @@ -21,7 +21,7 @@ cond_true: ; preds = %entry cond_next: ; preds = %cond_true, %entry ; CHECK: = phi i32 %F.0 = phi i32 [ %tmp, %entry ], [ %tmp7, %cond_true ] ; [#uses=1] - store i32 %F.0, i32* @G, align 8 + store i32 %F.0, ptr @G, align 8 ret void } diff --git a/llvm/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll b/llvm/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll index f953b426f6e313..345e96e2e745e1 100644 --- a/llvm/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll +++ b/llvm/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll @@ -5,13 +5,13 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" target triple = "i386-pc-linux-gnu" -@g_37 = common global i32 0 ; [#uses=1] -@.str = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] +@g_37 = common global i32 0 ; [#uses=1] +@.str = internal constant [4 x i8] c"%d\0A\00" ; [#uses=1] define i32 @main() nounwind { ; CHECK-LABEL: @main( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[L:%.*]] = load i32, i32* @g_37, align 4 +; CHECK-NEXT: [[L:%.*]] = load i32, ptr @g_37, align 4 ; CHECK-NEXT: [[CMPA:%.*]] = icmp ne i32 [[L]], 0 ; CHECK-NEXT: [[CMPB:%.*]] = icmp eq i1 [[CMPA]], false ; CHECK-NEXT: [[OUTVAL_SEL:%.*]] = select i1 [[CMPA]], i32 1, i32 0 @@ -20,13 +20,13 @@ define i32 @main() nounwind { ; CHECK-NEXT: [[OUTVAL_SEL_MUX:%.*]] = select i1 [[OR_COND]], i32 [[OUTVAL_SEL]], i32 2 ; CHECK-NEXT: br i1 [[BRMERGE]], label [[FUNC_1_EXIT:%.*]], label [[INFLOOP:%.*]] ; CHECK: func_1.exit: -; CHECK-NEXT: [[POUT:%.*]] = tail call i32 (i8*, ...) @printf(i8* noalias getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 [[OUTVAL_SEL_MUX]]) #[[ATTR0:[0-9]+]] +; CHECK-NEXT: [[POUT:%.*]] = tail call i32 (ptr, ...) @printf(ptr noalias @.str, i32 [[OUTVAL_SEL_MUX]]) #[[ATTR0:[0-9]+]] ; CHECK-NEXT: ret i32 0 ; CHECK: infloop: ; CHECK-NEXT: br label [[INFLOOP]] ; entry: - %l = load i32, i32* @g_37, align 4 ; [#uses=1] + %l = load i32, ptr @g_37, align 4 ; [#uses=1] %cmpa = icmp ne i32 %l, 0 ; [#uses=3] br i1 %cmpa, label %func_1.exit, label %mooseblock @@ -46,9 +46,9 @@ cowblock: ; preds = %beeblock, %monkeyblock func_1.exit: ; preds = %cowblock, %entry %outval = phi i32 [ %cowval, %cowblock ], [ 1, %entry ] ; [#uses=1] - %pout = tail call i32 (i8*, ...) @printf( i8* noalias getelementptr ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %outval ) nounwind ; [#uses=0] + %pout = tail call i32 (ptr, ...) @printf( ptr noalias @.str, i32 %outval ) nounwind ; [#uses=0] ret i32 0 } -declare i32 @printf(i8*, ...) nounwind +declare i32 @printf(ptr, ...) nounwind diff --git a/llvm/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll b/llvm/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll index 5ed61dd23f844a..aaa1303b9d614e 100644 --- a/llvm/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll +++ b/llvm/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll @@ -1,10 +1,10 @@ ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -disable-output ; PR 2777 -@g_103 = common global i32 0 ; [#uses=1] +@g_103 = common global i32 0 ; [#uses=1] define i32 @func_127(i32 %p_129) nounwind { entry: - load i32, i32* @g_103, align 4 ; :0 [#uses=1] + load i32, ptr @g_103, align 4 ; :0 [#uses=1] icmp eq i32 %0, 0 ; :1 [#uses=2] br i1 %1, label %bb6.preheader, label %entry.return_crit_edge diff --git a/llvm/test/Transforms/SimplifyCFG/2008-10-03-SpeculativelyExecuteBeforePHI.ll b/llvm/test/Transforms/SimplifyCFG/2008-10-03-SpeculativelyExecuteBeforePHI.ll index 068ab13f54f635..ea632506dcc40c 100644 --- a/llvm/test/Transforms/SimplifyCFG/2008-10-03-SpeculativelyExecuteBeforePHI.ll +++ b/llvm/test/Transforms/SimplifyCFG/2008-10-03-SpeculativelyExecuteBeforePHI.ll @@ -1,7 +1,7 @@ ; RUN: opt < %s -passes=simplifycfg ; PR2855 -define i32 @_Z1fPii(i32* %b, i32 %f) nounwind { +define i32 @_Z1fPii(ptr %b, i32 %f) nounwind { entry: br label %bb diff --git a/llvm/test/Transforms/SimplifyCFG/2009-05-12-externweak.ll b/llvm/test/Transforms/SimplifyCFG/2009-05-12-externweak.ll index 602db474588621..3bc5c14e458600 100644 --- a/llvm/test/Transforms/SimplifyCFG/2009-05-12-externweak.ll +++ b/llvm/test/Transforms/SimplifyCFG/2009-05-12-externweak.ll @@ -7,22 +7,22 @@ module asm ".globl _foo" module asm "_foo: ret" module asm ".globl _i" module asm ".set _i, 0" -@i = extern_weak global i32 ; [#uses=2] -@j = common global i32 0 ; [#uses=1] -@ed = common global double 0.000000e+00, align 8 ; [#uses=1] +@i = extern_weak global i32 ; [#uses=2] +@j = common global i32 0 ; [#uses=1] +@ed = common global double 0.000000e+00, align 8 ; [#uses=1] define i32 @main() nounwind ssp { ; CHECK-LABEL: @main( ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[BB4:%.*]] ; CHECK: bb: -; CHECK-NEXT: br i1 icmp ne (i32* @i, i32* null), label [[BB1:%.*]], label [[BB3:%.*]] +; CHECK-NEXT: br i1 icmp ne (ptr @i, ptr null), label [[BB1:%.*]], label [[BB3:%.*]] ; CHECK: bb1: -; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @i, align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr @i, align 4 ; CHECK-NEXT: br label [[BB3]] ; CHECK: bb3: ; CHECK-NEXT: [[STOREMERGE:%.*]] = phi i32 [ [[TMP0]], [[BB1]] ], [ 0, [[BB:%.*]] ] -; CHECK-NEXT: store i32 [[STOREMERGE]], i32* @j, align 4 +; CHECK-NEXT: store i32 [[STOREMERGE]], ptr @j, align 4 ; CHECK-NEXT: [[TMP1:%.*]] = sitofp i32 [[STOREMERGE]] to double ; CHECK-NEXT: [[TMP2:%.*]] = call double @sin(double [[TMP1]]) #[[ATTR1:[0-9]+]] ; CHECK-NEXT: [[TMP3:%.*]] = fadd double [[TMP2]], [[D_0:%.*]] @@ -34,17 +34,17 @@ define i32 @main() nounwind ssp { ; CHECK-NEXT: [[TMP5:%.*]] = icmp sgt i32 [[L_0]], 99 ; CHECK-NEXT: br i1 [[TMP5]], label [[BB5:%.*]], label [[BB]] ; CHECK: bb5: -; CHECK-NEXT: store double [[D_0]], double* @ed, align 8 +; CHECK-NEXT: store double [[D_0]], ptr @ed, align 8 ; CHECK-NEXT: ret i32 0 ; entry: br label %bb4 bb: ; preds = %bb4 - br i1 icmp ne (i32* @i, i32* null), label %bb1, label %bb2 + br i1 icmp ne (ptr @i, ptr null), label %bb1, label %bb2 bb1: ; preds = %bb - %0 = load i32, i32* @i, align 4 ; [#uses=1] + %0 = load i32, ptr @i, align 4 ; [#uses=1] br label %bb3 bb2: ; preds = %bb @@ -52,7 +52,7 @@ bb2: ; preds = %bb bb3: ; preds = %bb2, %bb1 %storemerge = phi i32 [ %0, %bb1 ], [ 0, %bb2 ] ; [#uses=2] - store i32 %storemerge, i32* @j + store i32 %storemerge, ptr @j %1 = sitofp i32 %storemerge to double ; [#uses=1] %2 = call double @sin(double %1) nounwind readonly ; [#uses=1] %3 = fadd double %2, %d.0 ; [#uses=1] @@ -66,7 +66,7 @@ bb4: ; preds = %bb3, %entry br i1 %5, label %bb5, label %bb bb5: ; preds = %bb4 - store double %d.0, double* @ed, align 8 + store double %d.0, ptr @ed, align 8 ret i32 0 } diff --git a/llvm/test/Transforms/SimplifyCFG/2011-03-08-UnreachableUse.ll b/llvm/test/Transforms/SimplifyCFG/2011-03-08-UnreachableUse.ll index af3765e5b0b831..9cd8434e61a8fa 100644 --- a/llvm/test/Transforms/SimplifyCFG/2011-03-08-UnreachableUse.ll +++ b/llvm/test/Transforms/SimplifyCFG/2011-03-08-UnreachableUse.ll @@ -5,7 +5,7 @@ ; the transformations done by SimplifyCFG, so this test is likely to rot ; quickly. -define noalias i8* @func_29() nounwind { +define noalias ptr @func_29() nounwind { ; CHECK: entry: ; CHECK-NEXT: unreachable entry: diff --git a/llvm/test/Transforms/SimplifyCFG/2011-09-05-TrivialLPad.ll b/llvm/test/Transforms/SimplifyCFG/2011-09-05-TrivialLPad.ll index 26318bbe131b0d..b0373c69605cba 100644 --- a/llvm/test/Transforms/SimplifyCFG/2011-09-05-TrivialLPad.ll +++ b/llvm/test/Transforms/SimplifyCFG/2011-09-05-TrivialLPad.ll @@ -5,7 +5,7 @@ declare void @bar() -define i32 @foo() personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 { +define i32 @foo() personality ptr @__gxx_personality_v0 { entry: invoke void @bar() to label %return unwind label %lpad @@ -14,9 +14,9 @@ return: ret i32 0 lpad: - %lp = landingpad { i8*, i32 } + %lp = landingpad { ptr, i32 } cleanup - resume { i8*, i32 } %lp + resume { ptr, i32 } %lp } -declare i32 @__gxx_personality_v0(i32, i64, i8*, i8*) +declare i32 @__gxx_personality_v0(i32, i64, ptr, ptr) diff --git a/llvm/test/Transforms/SimplifyCFG/AArch64/prefer-fma.ll b/llvm/test/Transforms/SimplifyCFG/AArch64/prefer-fma.ll index dc72af31d0bb3c..0f18dc2132ec53 100644 --- a/llvm/test/Transforms/SimplifyCFG/AArch64/prefer-fma.ll +++ b/llvm/test/Transforms/SimplifyCFG/AArch64/prefer-fma.ll @@ -3,11 +3,11 @@ ; ModuleID = 't.cc' ; Function Attrs: nounwind -define double @_Z3fooRdS_S_S_(double* dereferenceable(8) %x, double* dereferenceable(8) %y, double* dereferenceable(8) %a) #0 { +define double @_Z3fooRdS_S_S_(ptr dereferenceable(8) %x, ptr dereferenceable(8) %y, ptr dereferenceable(8) %a) #0 { entry: - %0 = load double, double* %y, align 8 + %0 = load double, ptr %y, align 8 %cmp = fcmp oeq double %0, 0.000000e+00 - %1 = load double, double* %x, align 8 + %1 = load double, ptr %x, align 8 br i1 %cmp, label %if.then, label %if.else ; fadd (const, (fmul x, y)) @@ -15,10 +15,10 @@ if.then: ; preds = %entry ; CHECK-LABEL: if.then: ; CHECK: %3 = fmul fast double %1, %2 ; CHECK-NEXT: %mul = fadd fast double 1.000000e+00, %3 - %2 = load double, double* %a, align 8 + %2 = load double, ptr %a, align 8 %3 = fmul fast double %1, %2 %mul = fadd fast double 1.000000e+00, %3 - store double %mul, double* %y, align 8 + store double %mul, ptr %y, align 8 br label %if.end ; fsub ((fmul x, y), z) @@ -26,17 +26,17 @@ if.else: ; preds = %entry ; CHECK-LABEL: if.else: ; CHECK: %mul1 = fmul fast double %1, %2 ; CHECK-NEXT: %sub1 = fsub fast double %mul1, %0 - %4 = load double, double* %a, align 8 + %4 = load double, ptr %a, align 8 %mul1 = fmul fast double %1, %4 %sub1 = fsub fast double %mul1, %0 - %gep1 = getelementptr double, double* %y, i32 1 - store double %sub1, double* %gep1, align 8 + %gep1 = getelementptr double, ptr %y, i32 1 + store double %sub1, ptr %gep1, align 8 br label %if.end if.end: ; preds = %if.else, %if.then - %5 = load double, double* %y, align 8 + %5 = load double, ptr %y, align 8 %cmp2 = fcmp oeq double %5, 2.000000e+00 - %6 = load double, double* %x, align 8 + %6 = load double, ptr %x, align 8 br i1 %cmp2, label %if.then2, label %if.else2 ; fsub (x, (fmul y, z)) @@ -44,10 +44,10 @@ if.then2: ; preds = %entry ; CHECK-LABEL: if.then2: ; CHECK: %7 = fmul fast double %5, 3.000000e+00 ; CHECK-NEXT: %mul2 = fsub fast double %6, %7 - %7 = load double, double* %a, align 8 + %7 = load double, ptr %a, align 8 %8 = fmul fast double %6, 3.0000000e+00 %mul2 = fsub fast double %7, %8 - store double %mul2, double* %y, align 8 + store double %mul2, ptr %y, align 8 br label %if.end2 ; fsub (fneg((fmul x, y)), const) @@ -59,14 +59,14 @@ if.else2: ; preds = %entry %mul3 = fmul fast double %6, 3.0000000e+00 %neg = fsub fast double 0.0000000e+00, %mul3 %sub2 = fsub fast double %neg, 3.0000000e+00 - store double %sub2, double* %y, align 8 + store double %sub2, ptr %y, align 8 br label %if.end2 if.end2: ; preds = %if.else, %if.then - %9 = load double, double* %x, align 8 - %10 = load double, double* %y, align 8 + %9 = load double, ptr %x, align 8 + %10 = load double, ptr %y, align 8 %add = fadd fast double %9, %10 - %11 = load double, double* %a, align 8 + %11 = load double, ptr %a, align 8 %add2 = fadd fast double %add, %11 ret double %add2 } diff --git a/llvm/test/Transforms/SimplifyCFG/ARM/branch-fold-threshold.ll b/llvm/test/Transforms/SimplifyCFG/ARM/branch-fold-threshold.ll index fc96134e12f931..f823bdc4aa5710 100644 --- a/llvm/test/Transforms/SimplifyCFG/ARM/branch-fold-threshold.ll +++ b/llvm/test/Transforms/SimplifyCFG/ARM/branch-fold-threshold.ll @@ -3,7 +3,7 @@ ; RUN: opt -mtriple=thumbv8a %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s --check-prefix=CHECK --check-prefix=THUMB ; RUN: opt -mtriple=armv8a %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s --check-prefix=CHECK --check-prefix=ARM -define i32 @foo(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input) { +define i32 @foo(i32 %a, i32 %b, i32 %c, i32 %d, ptr %input) { ; CHECK-LABEL: @foo( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CMP:%.*]] = icmp sle i32 [[D:%.*]], 3 @@ -12,7 +12,7 @@ define i32 @foo(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input) { ; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[CMP]], i1 [[CMP1]], i1 false ; CHECK-NEXT: br i1 [[OR_COND]], label [[COND_FALSE:%.*]], label [[COND_END:%.*]] ; CHECK: cond.false: -; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[INPUT:%.*]], align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[INPUT:%.*]], align 4 ; CHECK-NEXT: br label [[COND_END]] ; CHECK: cond.end: ; CHECK-NEXT: [[COND:%.*]] = phi i32 [ [[TMP0]], [[COND_FALSE]] ], [ 0, [[ENTRY:%.*]] ] @@ -28,7 +28,7 @@ lor.lhs.false: br i1 %cmp1, label %cond.false, label %cond.end cond.false: - %0 = load i32, i32* %input, align 4 + %0 = load i32, ptr %input, align 4 br label %cond.end cond.end: @@ -36,7 +36,7 @@ cond.end: ret i32 %cond } -define i32 @foo_minsize(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input) #0 { +define i32 @foo_minsize(i32 %a, i32 %b, i32 %c, i32 %d, ptr %input) #0 { ; CHECK-LABEL: @foo_minsize( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CMP:%.*]] = icmp sle i32 [[D:%.*]], 3 @@ -45,7 +45,7 @@ define i32 @foo_minsize(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input) #0 { ; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[CMP]], i1 [[CMP1]], i1 false ; CHECK-NEXT: br i1 [[OR_COND]], label [[COND_FALSE:%.*]], label [[COND_END:%.*]] ; CHECK: cond.false: -; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[INPUT:%.*]], align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[INPUT:%.*]], align 4 ; CHECK-NEXT: br label [[COND_END]] ; CHECK: cond.end: ; CHECK-NEXT: [[COND:%.*]] = phi i32 [ [[TMP0]], [[COND_FALSE]] ], [ 0, [[ENTRY:%.*]] ] @@ -61,7 +61,7 @@ lor.lhs.false: br i1 %cmp1, label %cond.false, label %cond.end cond.false: - %0 = load i32, i32* %input, align 4 + %0 = load i32, ptr %input, align 4 br label %cond.end cond.end: @@ -69,7 +69,7 @@ cond.end: ret i32 %cond } -define i32 @foo_minsize_i64(i64 %a, i64 %b, i64 %c, i64 %d, i32* %input) #0 { +define i32 @foo_minsize_i64(i64 %a, i64 %b, i64 %c, i64 %d, ptr %input) #0 { ; CHECK-LABEL: @foo_minsize_i64( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CMP:%.*]] = icmp sle i64 [[D:%.*]], 3 @@ -78,7 +78,7 @@ define i32 @foo_minsize_i64(i64 %a, i64 %b, i64 %c, i64 %d, i32* %input) #0 { ; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[CMP]], i1 [[CMP1]], i1 false ; CHECK-NEXT: br i1 [[OR_COND]], label [[COND_FALSE:%.*]], label [[COND_END:%.*]] ; CHECK: cond.false: -; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[INPUT:%.*]], align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[INPUT:%.*]], align 4 ; CHECK-NEXT: br label [[COND_END]] ; CHECK: cond.end: ; CHECK-NEXT: [[COND:%.*]] = phi i32 [ [[TMP0]], [[COND_FALSE]] ], [ 0, [[ENTRY:%.*]] ] @@ -94,7 +94,7 @@ lor.lhs.false: br i1 %cmp1, label %cond.false, label %cond.end cond.false: - %0 = load i32, i32* %input, align 4 + %0 = load i32, ptr %input, align 4 br label %cond.end cond.end: @@ -102,7 +102,7 @@ cond.end: ret i32 %cond } -define i32 @or_predicate(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input) { +define i32 @or_predicate(i32 %a, i32 %b, i32 %c, i32 %d, ptr %input) { ; CHECK-LABEL: @or_predicate( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[D:%.*]], 3 @@ -111,7 +111,7 @@ define i32 @or_predicate(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input) { ; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[CMP]], i1 true, i1 [[CMP1]] ; CHECK-NEXT: br i1 [[OR_COND]], label [[COND_END:%.*]], label [[COND_FALSE:%.*]] ; CHECK: cond.false: -; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[INPUT:%.*]], align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[INPUT:%.*]], align 4 ; CHECK-NEXT: br label [[COND_END]] ; CHECK: cond.end: ; CHECK-NEXT: [[COND:%.*]] = phi i32 [ [[TMP0]], [[COND_FALSE]] ], [ 0, [[ENTRY:%.*]] ] @@ -127,7 +127,7 @@ lor.lhs.false: br i1 %cmp1, label %cond.end, label %cond.false cond.false: - %0 = load i32, i32* %input, align 4 + %0 = load i32, ptr %input, align 4 br label %cond.end cond.end: @@ -135,7 +135,7 @@ cond.end: ret i32 %cond } -define i32 @or_invert_predicate(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input) { +define i32 @or_invert_predicate(i32 %a, i32 %b, i32 %c, i32 %d, ptr %input) { ; CHECK-LABEL: @or_invert_predicate( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CMP:%.*]] = icmp sle i32 [[D:%.*]], 3 @@ -144,7 +144,7 @@ define i32 @or_invert_predicate(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input) { ; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[CMP]], i1 true, i1 [[CMP1]] ; CHECK-NEXT: br i1 [[OR_COND]], label [[COND_END:%.*]], label [[COND_FALSE:%.*]] ; CHECK: cond.false: -; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[INPUT:%.*]], align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[INPUT:%.*]], align 4 ; CHECK-NEXT: br label [[COND_END]] ; CHECK: cond.end: ; CHECK-NEXT: [[COND:%.*]] = phi i32 [ [[TMP0]], [[COND_FALSE]] ], [ 0, [[ENTRY:%.*]] ] @@ -160,7 +160,7 @@ lor.lhs.false: br i1 %cmp1, label %cond.end, label %cond.false cond.false: - %0 = load i32, i32* %input, align 4 + %0 = load i32, ptr %input, align 4 br label %cond.end cond.end: @@ -168,7 +168,7 @@ cond.end: ret i32 %cond } -define i32 @or_predicate_minsize(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input) #0 { +define i32 @or_predicate_minsize(i32 %a, i32 %b, i32 %c, i32 %d, ptr %input) #0 { ; THUMB-LABEL: @or_predicate_minsize( ; THUMB-NEXT: entry: ; THUMB-NEXT: [[CMP:%.*]] = icmp sgt i32 [[D:%.*]], 3 @@ -178,7 +178,7 @@ define i32 @or_predicate_minsize(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input) #0 ; THUMB-NEXT: [[CMP1:%.*]] = icmp slt i32 [[ADD]], [[B:%.*]] ; THUMB-NEXT: br i1 [[CMP1]], label [[COND_END]], label [[COND_FALSE:%.*]] ; THUMB: cond.false: -; THUMB-NEXT: [[TMP0:%.*]] = load i32, i32* [[INPUT:%.*]], align 4 +; THUMB-NEXT: [[TMP0:%.*]] = load i32, ptr [[INPUT:%.*]], align 4 ; THUMB-NEXT: br label [[COND_END]] ; THUMB: cond.end: ; THUMB-NEXT: [[COND:%.*]] = phi i32 [ [[TMP0]], [[COND_FALSE]] ], [ 0, [[LOR_LHS_FALSE]] ], [ 0, [[ENTRY:%.*]] ] @@ -192,7 +192,7 @@ define i32 @or_predicate_minsize(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input) #0 ; ARM-NEXT: [[OR_COND:%.*]] = select i1 [[CMP]], i1 true, i1 [[CMP1]] ; ARM-NEXT: br i1 [[OR_COND]], label [[COND_END:%.*]], label [[COND_FALSE:%.*]] ; ARM: cond.false: -; ARM-NEXT: [[TMP0:%.*]] = load i32, i32* [[INPUT:%.*]], align 4 +; ARM-NEXT: [[TMP0:%.*]] = load i32, ptr [[INPUT:%.*]], align 4 ; ARM-NEXT: br label [[COND_END]] ; ARM: cond.end: ; ARM-NEXT: [[COND:%.*]] = phi i32 [ [[TMP0]], [[COND_FALSE]] ], [ 0, [[ENTRY:%.*]] ] @@ -208,7 +208,7 @@ lor.lhs.false: br i1 %cmp1, label %cond.end, label %cond.false cond.false: - %0 = load i32, i32* %input, align 4 + %0 = load i32, ptr %input, align 4 br label %cond.end cond.end: @@ -216,7 +216,7 @@ cond.end: ret i32 %cond } -define i32 @or_invert_predicate_minsize(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input) #0 { +define i32 @or_invert_predicate_minsize(i32 %a, i32 %b, i32 %c, i32 %d, ptr %input) #0 { ; THUMB-LABEL: @or_invert_predicate_minsize( ; THUMB-NEXT: entry: ; THUMB-NEXT: [[CMP:%.*]] = icmp sgt i32 [[D:%.*]], 3 @@ -226,7 +226,7 @@ define i32 @or_invert_predicate_minsize(i32 %a, i32 %b, i32 %c, i32 %d, i32* %in ; THUMB-NEXT: [[CMP1:%.*]] = icmp slt i32 [[ADD]], [[B:%.*]] ; THUMB-NEXT: br i1 [[CMP1]], label [[COND_END]], label [[COND_FALSE:%.*]] ; THUMB: cond.false: -; THUMB-NEXT: [[TMP0:%.*]] = load i32, i32* [[INPUT:%.*]], align 4 +; THUMB-NEXT: [[TMP0:%.*]] = load i32, ptr [[INPUT:%.*]], align 4 ; THUMB-NEXT: br label [[COND_END]] ; THUMB: cond.end: ; THUMB-NEXT: [[COND:%.*]] = phi i32 [ [[TMP0]], [[COND_FALSE]] ], [ 0, [[LOR_LHS_FALSE]] ], [ 0, [[ENTRY:%.*]] ] @@ -240,7 +240,7 @@ define i32 @or_invert_predicate_minsize(i32 %a, i32 %b, i32 %c, i32 %d, i32* %in ; ARM-NEXT: [[OR_COND:%.*]] = select i1 [[CMP]], i1 true, i1 [[CMP1]] ; ARM-NEXT: br i1 [[OR_COND]], label [[COND_END:%.*]], label [[COND_FALSE:%.*]] ; ARM: cond.false: -; ARM-NEXT: [[TMP0:%.*]] = load i32, i32* [[INPUT:%.*]], align 4 +; ARM-NEXT: [[TMP0:%.*]] = load i32, ptr [[INPUT:%.*]], align 4 ; ARM-NEXT: br label [[COND_END]] ; ARM: cond.end: ; ARM-NEXT: [[COND:%.*]] = phi i32 [ [[TMP0]], [[COND_FALSE]] ], [ 0, [[ENTRY:%.*]] ] @@ -256,7 +256,7 @@ lor.lhs.false: br i1 %cmp1, label %cond.end, label %cond.false cond.false: - %0 = load i32, i32* %input, align 4 + %0 = load i32, ptr %input, align 4 br label %cond.end cond.end: @@ -264,7 +264,7 @@ cond.end: ret i32 %cond } -define i32 @or_xor_predicate(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input, i1 %cmp) { +define i32 @or_xor_predicate(i32 %a, i32 %b, i32 %c, i32 %d, ptr %input, i1 %cmp) { ; CHECK-LABEL: @or_xor_predicate( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CMP_NOT:%.*]] = xor i1 [[CMP:%.*]], true @@ -273,7 +273,7 @@ define i32 @or_xor_predicate(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input, i1 %cm ; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[CMP_NOT]], i1 true, i1 [[CMP1]] ; CHECK-NEXT: br i1 [[OR_COND]], label [[COND_END:%.*]], label [[COND_FALSE:%.*]] ; CHECK: cond.false: -; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[INPUT:%.*]], align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[INPUT:%.*]], align 4 ; CHECK-NEXT: br label [[COND_END]] ; CHECK: cond.end: ; CHECK-NEXT: [[COND:%.*]] = phi i32 [ [[TMP0]], [[COND_FALSE]] ], [ 0, [[ENTRY:%.*]] ] @@ -288,7 +288,7 @@ lor.lhs.false: br i1 %cmp1, label %cond.end, label %cond.false cond.false: - %0 = load i32, i32* %input, align 4 + %0 = load i32, ptr %input, align 4 br label %cond.end cond.end: @@ -296,7 +296,7 @@ cond.end: ret i32 %cond } -define i32 @or_xor_predicate_minsize(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input, i1 %cmp) #0 { +define i32 @or_xor_predicate_minsize(i32 %a, i32 %b, i32 %c, i32 %d, ptr %input, i1 %cmp) #0 { ; THUMB-LABEL: @or_xor_predicate_minsize( ; THUMB-NEXT: entry: ; THUMB-NEXT: br i1 [[CMP:%.*]], label [[LOR_LHS_FALSE:%.*]], label [[COND_END:%.*]] @@ -305,7 +305,7 @@ define i32 @or_xor_predicate_minsize(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input ; THUMB-NEXT: [[CMP1:%.*]] = icmp slt i32 [[ADD]], [[B:%.*]] ; THUMB-NEXT: br i1 [[CMP1]], label [[COND_END]], label [[COND_FALSE:%.*]] ; THUMB: cond.false: -; THUMB-NEXT: [[TMP0:%.*]] = load i32, i32* [[INPUT:%.*]], align 4 +; THUMB-NEXT: [[TMP0:%.*]] = load i32, ptr [[INPUT:%.*]], align 4 ; THUMB-NEXT: br label [[COND_END]] ; THUMB: cond.end: ; THUMB-NEXT: [[COND:%.*]] = phi i32 [ [[TMP0]], [[COND_FALSE]] ], [ 0, [[LOR_LHS_FALSE]] ], [ 0, [[ENTRY:%.*]] ] @@ -319,7 +319,7 @@ define i32 @or_xor_predicate_minsize(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input ; ARM-NEXT: [[OR_COND:%.*]] = select i1 [[CMP_NOT]], i1 true, i1 [[CMP1]] ; ARM-NEXT: br i1 [[OR_COND]], label [[COND_END:%.*]], label [[COND_FALSE:%.*]] ; ARM: cond.false: -; ARM-NEXT: [[TMP0:%.*]] = load i32, i32* [[INPUT:%.*]], align 4 +; ARM-NEXT: [[TMP0:%.*]] = load i32, ptr [[INPUT:%.*]], align 4 ; ARM-NEXT: br label [[COND_END]] ; ARM: cond.end: ; ARM-NEXT: [[COND:%.*]] = phi i32 [ [[TMP0]], [[COND_FALSE]] ], [ 0, [[ENTRY:%.*]] ] @@ -334,7 +334,7 @@ lor.lhs.false: br i1 %cmp1, label %cond.end, label %cond.false cond.false: - %0 = load i32, i32* %input, align 4 + %0 = load i32, ptr %input, align 4 br label %cond.end cond.end: @@ -342,7 +342,7 @@ cond.end: ret i32 %cond } -define i32 @and_xor(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input, i1 %cmp) { +define i32 @and_xor(i32 %a, i32 %b, i32 %c, i32 %d, ptr %input, i1 %cmp) { ; CHECK-LABEL: @and_xor( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CMP_NOT:%.*]] = xor i1 [[CMP:%.*]], true @@ -351,7 +351,7 @@ define i32 @and_xor(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input, i1 %cmp) { ; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[CMP_NOT]], i1 [[CMP1]], i1 false ; CHECK-NEXT: br i1 [[OR_COND]], label [[COND_FALSE:%.*]], label [[COND_END:%.*]] ; CHECK: cond.false: -; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[INPUT:%.*]], align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[INPUT:%.*]], align 4 ; CHECK-NEXT: br label [[COND_END]] ; CHECK: cond.end: ; CHECK-NEXT: [[COND:%.*]] = phi i32 [ [[TMP0]], [[COND_FALSE]] ], [ 0, [[ENTRY:%.*]] ] @@ -366,7 +366,7 @@ lor.lhs.false: br i1 %cmp1, label %cond.false, label %cond.end cond.false: - %0 = load i32, i32* %input, align 4 + %0 = load i32, ptr %input, align 4 br label %cond.end cond.end: @@ -374,7 +374,7 @@ cond.end: ret i32 %cond } -define i32 @and_xor_minsize(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input, i1 %cmp) #0 { +define i32 @and_xor_minsize(i32 %a, i32 %b, i32 %c, i32 %d, ptr %input, i1 %cmp) #0 { ; THUMB-LABEL: @and_xor_minsize( ; THUMB-NEXT: entry: ; THUMB-NEXT: br i1 [[CMP:%.*]], label [[COND_END:%.*]], label [[LOR_LHS_FALSE:%.*]] @@ -383,7 +383,7 @@ define i32 @and_xor_minsize(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input, i1 %cmp ; THUMB-NEXT: [[CMP1:%.*]] = icmp slt i32 [[ADD]], [[B:%.*]] ; THUMB-NEXT: br i1 [[CMP1]], label [[COND_FALSE:%.*]], label [[COND_END]] ; THUMB: cond.false: -; THUMB-NEXT: [[TMP0:%.*]] = load i32, i32* [[INPUT:%.*]], align 4 +; THUMB-NEXT: [[TMP0:%.*]] = load i32, ptr [[INPUT:%.*]], align 4 ; THUMB-NEXT: br label [[COND_END]] ; THUMB: cond.end: ; THUMB-NEXT: [[COND:%.*]] = phi i32 [ [[TMP0]], [[COND_FALSE]] ], [ 0, [[LOR_LHS_FALSE]] ], [ 0, [[ENTRY:%.*]] ] @@ -397,7 +397,7 @@ define i32 @and_xor_minsize(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input, i1 %cmp ; ARM-NEXT: [[OR_COND:%.*]] = select i1 [[CMP_NOT]], i1 [[CMP1]], i1 false ; ARM-NEXT: br i1 [[OR_COND]], label [[COND_FALSE:%.*]], label [[COND_END:%.*]] ; ARM: cond.false: -; ARM-NEXT: [[TMP0:%.*]] = load i32, i32* [[INPUT:%.*]], align 4 +; ARM-NEXT: [[TMP0:%.*]] = load i32, ptr [[INPUT:%.*]], align 4 ; ARM-NEXT: br label [[COND_END]] ; ARM: cond.end: ; ARM-NEXT: [[COND:%.*]] = phi i32 [ [[TMP0]], [[COND_FALSE]] ], [ 0, [[ENTRY:%.*]] ] @@ -412,7 +412,7 @@ lor.lhs.false: br i1 %cmp1, label %cond.false, label %cond.end cond.false: - %0 = load i32, i32* %input, align 4 + %0 = load i32, ptr %input, align 4 br label %cond.end cond.end: diff --git a/llvm/test/Transforms/SimplifyCFG/ARM/select-costs.ll b/llvm/test/Transforms/SimplifyCFG/ARM/select-costs.ll index 2285952e134750..21801b9c2f83dd 100644 --- a/llvm/test/Transforms/SimplifyCFG/ARM/select-costs.ll +++ b/llvm/test/Transforms/SimplifyCFG/ARM/select-costs.ll @@ -7,11 +7,11 @@ ; Test that the phis from for.inc.preheader aren't hoisted into sw.bb92 because ; the cost is too great - we can make a better decision later on. ; FIXME: The Arm cost model needs to be updated for SizeAndLatency. -define i32 @multiple_spec_select_costs(i8* %a, i32* %idx, i8 %in) { +define i32 @multiple_spec_select_costs(ptr %a, ptr %idx, i8 %in) { ; V8M-LABEL: @multiple_spec_select_costs( ; V8M-NEXT: entry: -; V8M-NEXT: [[GEP_A_2:%.*]] = getelementptr inbounds i8, i8* [[A:%.*]], i32 2 -; V8M-NEXT: [[INCDEC_PTR109_C4:%.*]] = getelementptr inbounds i8, i8* [[A]], i32 3 +; V8M-NEXT: [[GEP_A_2:%.*]] = getelementptr inbounds i8, ptr [[A:%.*]], i32 2 +; V8M-NEXT: [[INCDEC_PTR109_C4:%.*]] = getelementptr inbounds i8, ptr [[A]], i32 3 ; V8M-NEXT: [[ZERO:%.*]] = icmp ne i8 [[IN:%.*]], 0 ; V8M-NEXT: br i1 [[ZERO]], label [[FOR_INC_PREHEADER:%.*]], label [[SW_BB92:%.*]] ; V8M: sw.bb92: @@ -21,14 +21,14 @@ define i32 @multiple_spec_select_costs(i8* %a, i32* %idx, i8 %in) { ; V8M-NEXT: [[SPEC_SELECT1:%.*]] = select i1 [[UGT_9]], i32 1, i32 7 ; V8M-NEXT: br label [[FOR_INC_PREHEADER]] ; V8M: for.inc.preheader: -; V8M-NEXT: [[STR_PH_0:%.*]] = phi i8* [ [[GEP_A_2]], [[ENTRY:%.*]] ], [ [[INCDEC_PTR109_C4]], [[SW_BB92]] ] +; V8M-NEXT: [[STR_PH_0:%.*]] = phi ptr [ [[GEP_A_2]], [[ENTRY:%.*]] ], [ [[INCDEC_PTR109_C4]], [[SW_BB92]] ] ; V8M-NEXT: [[CMP:%.*]] = phi i1 [ false, [[ENTRY]] ], [ [[SPEC_SELECT]], [[SW_BB92]] ] ; V8M-NEXT: [[PHI_RES:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[SPEC_SELECT1]], [[SW_BB92]] ] ; V8M-NEXT: br label [[FOR_INC:%.*]] ; V8M: for.inc: -; V8M-NEXT: [[STR_PH_1:%.*]] = phi i8* [ [[INCDEC_PTR109:%.*]], [[FOR_BODY:%.*]] ], [ [[STR_PH_0]], [[FOR_INC_PREHEADER]] ] -; V8M-NEXT: [[INCDEC_PTR109]] = getelementptr inbounds i8, i8* [[STR_PH_1]], i32 1 -; V8M-NEXT: [[LOAD_1:%.*]] = load i8, i8* [[INCDEC_PTR109]], align 1 +; V8M-NEXT: [[STR_PH_1:%.*]] = phi ptr [ [[INCDEC_PTR109:%.*]], [[FOR_BODY:%.*]] ], [ [[STR_PH_0]], [[FOR_INC_PREHEADER]] ] +; V8M-NEXT: [[INCDEC_PTR109]] = getelementptr inbounds i8, ptr [[STR_PH_1]], i32 1 +; V8M-NEXT: [[LOAD_1:%.*]] = load i8, ptr [[INCDEC_PTR109]], align 1 ; V8M-NEXT: [[TOBOOL:%.*]] = icmp ne i8 [[LOAD_1]], 0 ; V8M-NEXT: [[AND:%.*]] = and i1 [[CMP]], [[TOBOOL]] ; V8M-NEXT: br i1 [[AND]], label [[FOR_BODY]], label [[EXIT:%.*]] @@ -40,8 +40,8 @@ define i32 @multiple_spec_select_costs(i8* %a, i32* %idx, i8 %in) { ; ; V8A-LABEL: @multiple_spec_select_costs( ; V8A-NEXT: entry: -; V8A-NEXT: [[GEP_A_2:%.*]] = getelementptr inbounds i8, i8* [[A:%.*]], i32 2 -; V8A-NEXT: [[INCDEC_PTR109_C4:%.*]] = getelementptr inbounds i8, i8* [[A]], i32 3 +; V8A-NEXT: [[GEP_A_2:%.*]] = getelementptr inbounds i8, ptr [[A:%.*]], i32 2 +; V8A-NEXT: [[INCDEC_PTR109_C4:%.*]] = getelementptr inbounds i8, ptr [[A]], i32 3 ; V8A-NEXT: [[ZERO:%.*]] = icmp ne i8 [[IN:%.*]], 0 ; V8A-NEXT: br i1 [[ZERO]], label [[FOR_INC_PREHEADER:%.*]], label [[SW_BB92:%.*]] ; V8A: sw.bb92: @@ -51,14 +51,14 @@ define i32 @multiple_spec_select_costs(i8* %a, i32* %idx, i8 %in) { ; V8A-NEXT: [[SPEC_SELECT1:%.*]] = select i1 [[UGT_9]], i32 1, i32 7 ; V8A-NEXT: br label [[FOR_INC_PREHEADER]] ; V8A: for.inc.preheader: -; V8A-NEXT: [[STR_PH_0:%.*]] = phi i8* [ [[GEP_A_2]], [[ENTRY:%.*]] ], [ [[INCDEC_PTR109_C4]], [[SW_BB92]] ] +; V8A-NEXT: [[STR_PH_0:%.*]] = phi ptr [ [[GEP_A_2]], [[ENTRY:%.*]] ], [ [[INCDEC_PTR109_C4]], [[SW_BB92]] ] ; V8A-NEXT: [[CMP:%.*]] = phi i1 [ false, [[ENTRY]] ], [ [[SPEC_SELECT]], [[SW_BB92]] ] ; V8A-NEXT: [[PHI_RES:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[SPEC_SELECT1]], [[SW_BB92]] ] ; V8A-NEXT: br label [[FOR_INC:%.*]] ; V8A: for.inc: -; V8A-NEXT: [[STR_PH_1:%.*]] = phi i8* [ [[INCDEC_PTR109:%.*]], [[FOR_BODY:%.*]] ], [ [[STR_PH_0]], [[FOR_INC_PREHEADER]] ] -; V8A-NEXT: [[INCDEC_PTR109]] = getelementptr inbounds i8, i8* [[STR_PH_1]], i32 1 -; V8A-NEXT: [[LOAD_1:%.*]] = load i8, i8* [[INCDEC_PTR109]], align 1 +; V8A-NEXT: [[STR_PH_1:%.*]] = phi ptr [ [[INCDEC_PTR109:%.*]], [[FOR_BODY:%.*]] ], [ [[STR_PH_0]], [[FOR_INC_PREHEADER]] ] +; V8A-NEXT: [[INCDEC_PTR109]] = getelementptr inbounds i8, ptr [[STR_PH_1]], i32 1 +; V8A-NEXT: [[LOAD_1:%.*]] = load i8, ptr [[INCDEC_PTR109]], align 1 ; V8A-NEXT: [[TOBOOL:%.*]] = icmp ne i8 [[LOAD_1]], 0 ; V8A-NEXT: [[AND:%.*]] = and i1 [[CMP]], [[TOBOOL]] ; V8A-NEXT: br i1 [[AND]], label [[FOR_BODY]], label [[EXIT:%.*]] @@ -69,8 +69,8 @@ define i32 @multiple_spec_select_costs(i8* %a, i32* %idx, i8 %in) { ; V8A-NEXT: ret i32 [[PHI_RES]] ; entry: - %gep.a.2 = getelementptr inbounds i8, i8* %a, i32 2 - %incdec.ptr109.c4 = getelementptr inbounds i8, i8* %a, i32 3 + %gep.a.2 = getelementptr inbounds i8, ptr %a, i32 2 + %incdec.ptr109.c4 = getelementptr inbounds i8, ptr %a, i32 3 %zero = icmp ne i8 %in, 0 br i1 %zero , label %for.inc.preheader, label %sw.bb92 @@ -83,15 +83,15 @@ select.unfold198: br label %for.inc.preheader for.inc.preheader: - %str.ph.0 = phi i8* [ %incdec.ptr109.c4, %select.unfold198 ], [ %incdec.ptr109.c4, %sw.bb92 ], [ %gep.a.2, %entry ] + %str.ph.0 = phi ptr [ %incdec.ptr109.c4, %select.unfold198 ], [ %incdec.ptr109.c4, %sw.bb92 ], [ %gep.a.2, %entry ] %cmp = phi i1 [ true, %select.unfold198 ], [ false, %sw.bb92 ], [ false, %entry ] %phi.res = phi i32 [ 7, %select.unfold198 ], [ 1, %sw.bb92 ], [ 1, %entry ] br label %for.inc for.inc: - %str.ph.1 = phi i8* [ %incdec.ptr109, %for.body ], [ %str.ph.0, %for.inc.preheader ] - %incdec.ptr109 = getelementptr inbounds i8, i8* %str.ph.1, i32 1 - %load.1 = load i8, i8* %incdec.ptr109, align 1 + %str.ph.1 = phi ptr [ %incdec.ptr109, %for.body ], [ %str.ph.0, %for.inc.preheader ] + %incdec.ptr109 = getelementptr inbounds i8, ptr %str.ph.1, i32 1 + %load.1 = load i8, ptr %incdec.ptr109, align 1 %tobool = icmp ne i8 %load.1, 0 %and = and i1 %cmp, %tobool br i1 %and, label %for.body, label %exit @@ -104,11 +104,11 @@ exit: ret i32 %phi.res } -define i32 @multiple_spec_select_costs_minsize(i8* %a, i32* %idx, i8 %in) #0 { +define i32 @multiple_spec_select_costs_minsize(ptr %a, ptr %idx, i8 %in) #0 { ; V8M-LABEL: @multiple_spec_select_costs_minsize( ; V8M-NEXT: entry: -; V8M-NEXT: [[GEP_A_2:%.*]] = getelementptr inbounds i8, i8* [[A:%.*]], i32 2 -; V8M-NEXT: [[INCDEC_PTR109_C4:%.*]] = getelementptr inbounds i8, i8* [[A]], i32 3 +; V8M-NEXT: [[GEP_A_2:%.*]] = getelementptr inbounds i8, ptr [[A:%.*]], i32 2 +; V8M-NEXT: [[INCDEC_PTR109_C4:%.*]] = getelementptr inbounds i8, ptr [[A]], i32 3 ; V8M-NEXT: [[ZERO:%.*]] = icmp ne i8 [[IN:%.*]], 0 ; V8M-NEXT: br i1 [[ZERO]], label [[FOR_INC_PREHEADER:%.*]], label [[SW_BB92:%.*]] ; V8M: sw.bb92: @@ -118,14 +118,14 @@ define i32 @multiple_spec_select_costs_minsize(i8* %a, i32* %idx, i8 %in) #0 { ; V8M: select.unfold198: ; V8M-NEXT: br label [[FOR_INC_PREHEADER]] ; V8M: for.inc.preheader: -; V8M-NEXT: [[STR_PH_0:%.*]] = phi i8* [ [[INCDEC_PTR109_C4]], [[SELECT_UNFOLD198]] ], [ [[INCDEC_PTR109_C4]], [[SW_BB92]] ], [ [[GEP_A_2]], [[ENTRY:%.*]] ] +; V8M-NEXT: [[STR_PH_0:%.*]] = phi ptr [ [[INCDEC_PTR109_C4]], [[SELECT_UNFOLD198]] ], [ [[INCDEC_PTR109_C4]], [[SW_BB92]] ], [ [[GEP_A_2]], [[ENTRY:%.*]] ] ; V8M-NEXT: [[CMP:%.*]] = phi i1 [ true, [[SELECT_UNFOLD198]] ], [ false, [[SW_BB92]] ], [ false, [[ENTRY]] ] ; V8M-NEXT: [[PHI_RES:%.*]] = phi i32 [ 7, [[SELECT_UNFOLD198]] ], [ 1, [[SW_BB92]] ], [ 1, [[ENTRY]] ] ; V8M-NEXT: br label [[FOR_INC:%.*]] ; V8M: for.inc: -; V8M-NEXT: [[STR_PH_1:%.*]] = phi i8* [ [[INCDEC_PTR109:%.*]], [[FOR_BODY:%.*]] ], [ [[STR_PH_0]], [[FOR_INC_PREHEADER]] ] -; V8M-NEXT: [[INCDEC_PTR109]] = getelementptr inbounds i8, i8* [[STR_PH_1]], i32 1 -; V8M-NEXT: [[LOAD_1:%.*]] = load i8, i8* [[INCDEC_PTR109]], align 1 +; V8M-NEXT: [[STR_PH_1:%.*]] = phi ptr [ [[INCDEC_PTR109:%.*]], [[FOR_BODY:%.*]] ], [ [[STR_PH_0]], [[FOR_INC_PREHEADER]] ] +; V8M-NEXT: [[INCDEC_PTR109]] = getelementptr inbounds i8, ptr [[STR_PH_1]], i32 1 +; V8M-NEXT: [[LOAD_1:%.*]] = load i8, ptr [[INCDEC_PTR109]], align 1 ; V8M-NEXT: [[TOBOOL:%.*]] = icmp ne i8 [[LOAD_1]], 0 ; V8M-NEXT: [[AND:%.*]] = and i1 [[CMP]], [[TOBOOL]] ; V8M-NEXT: br i1 [[AND]], label [[FOR_BODY]], label [[EXIT:%.*]] @@ -137,8 +137,8 @@ define i32 @multiple_spec_select_costs_minsize(i8* %a, i32* %idx, i8 %in) #0 { ; ; V8A-LABEL: @multiple_spec_select_costs_minsize( ; V8A-NEXT: entry: -; V8A-NEXT: [[GEP_A_2:%.*]] = getelementptr inbounds i8, i8* [[A:%.*]], i32 2 -; V8A-NEXT: [[INCDEC_PTR109_C4:%.*]] = getelementptr inbounds i8, i8* [[A]], i32 3 +; V8A-NEXT: [[GEP_A_2:%.*]] = getelementptr inbounds i8, ptr [[A:%.*]], i32 2 +; V8A-NEXT: [[INCDEC_PTR109_C4:%.*]] = getelementptr inbounds i8, ptr [[A]], i32 3 ; V8A-NEXT: [[ZERO:%.*]] = icmp ne i8 [[IN:%.*]], 0 ; V8A-NEXT: br i1 [[ZERO]], label [[FOR_INC_PREHEADER:%.*]], label [[SW_BB92:%.*]] ; V8A: sw.bb92: @@ -148,14 +148,14 @@ define i32 @multiple_spec_select_costs_minsize(i8* %a, i32* %idx, i8 %in) #0 { ; V8A-NEXT: [[SPEC_SELECT1:%.*]] = select i1 [[UGT_9]], i32 1, i32 7 ; V8A-NEXT: br label [[FOR_INC_PREHEADER]] ; V8A: for.inc.preheader: -; V8A-NEXT: [[STR_PH_0:%.*]] = phi i8* [ [[GEP_A_2]], [[ENTRY:%.*]] ], [ [[INCDEC_PTR109_C4]], [[SW_BB92]] ] +; V8A-NEXT: [[STR_PH_0:%.*]] = phi ptr [ [[GEP_A_2]], [[ENTRY:%.*]] ], [ [[INCDEC_PTR109_C4]], [[SW_BB92]] ] ; V8A-NEXT: [[CMP:%.*]] = phi i1 [ false, [[ENTRY]] ], [ [[SPEC_SELECT]], [[SW_BB92]] ] ; V8A-NEXT: [[PHI_RES:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[SPEC_SELECT1]], [[SW_BB92]] ] ; V8A-NEXT: br label [[FOR_INC:%.*]] ; V8A: for.inc: -; V8A-NEXT: [[STR_PH_1:%.*]] = phi i8* [ [[INCDEC_PTR109:%.*]], [[FOR_BODY:%.*]] ], [ [[STR_PH_0]], [[FOR_INC_PREHEADER]] ] -; V8A-NEXT: [[INCDEC_PTR109]] = getelementptr inbounds i8, i8* [[STR_PH_1]], i32 1 -; V8A-NEXT: [[LOAD_1:%.*]] = load i8, i8* [[INCDEC_PTR109]], align 1 +; V8A-NEXT: [[STR_PH_1:%.*]] = phi ptr [ [[INCDEC_PTR109:%.*]], [[FOR_BODY:%.*]] ], [ [[STR_PH_0]], [[FOR_INC_PREHEADER]] ] +; V8A-NEXT: [[INCDEC_PTR109]] = getelementptr inbounds i8, ptr [[STR_PH_1]], i32 1 +; V8A-NEXT: [[LOAD_1:%.*]] = load i8, ptr [[INCDEC_PTR109]], align 1 ; V8A-NEXT: [[TOBOOL:%.*]] = icmp ne i8 [[LOAD_1]], 0 ; V8A-NEXT: [[AND:%.*]] = and i1 [[CMP]], [[TOBOOL]] ; V8A-NEXT: br i1 [[AND]], label [[FOR_BODY]], label [[EXIT:%.*]] @@ -166,8 +166,8 @@ define i32 @multiple_spec_select_costs_minsize(i8* %a, i32* %idx, i8 %in) #0 { ; V8A-NEXT: ret i32 [[PHI_RES]] ; entry: - %gep.a.2 = getelementptr inbounds i8, i8* %a, i32 2 - %incdec.ptr109.c4 = getelementptr inbounds i8, i8* %a, i32 3 + %gep.a.2 = getelementptr inbounds i8, ptr %a, i32 2 + %incdec.ptr109.c4 = getelementptr inbounds i8, ptr %a, i32 3 %zero = icmp ne i8 %in, 0 br i1 %zero , label %for.inc.preheader, label %sw.bb92 @@ -180,15 +180,15 @@ select.unfold198: br label %for.inc.preheader for.inc.preheader: - %str.ph.0 = phi i8* [ %incdec.ptr109.c4, %select.unfold198 ], [ %incdec.ptr109.c4, %sw.bb92 ], [ %gep.a.2, %entry ] + %str.ph.0 = phi ptr [ %incdec.ptr109.c4, %select.unfold198 ], [ %incdec.ptr109.c4, %sw.bb92 ], [ %gep.a.2, %entry ] %cmp = phi i1 [ true, %select.unfold198 ], [ false, %sw.bb92 ], [ false, %entry ] %phi.res = phi i32 [ 7, %select.unfold198 ], [ 1, %sw.bb92 ], [ 1, %entry ] br label %for.inc for.inc: - %str.ph.1 = phi i8* [ %incdec.ptr109, %for.body ], [ %str.ph.0, %for.inc.preheader ] - %incdec.ptr109 = getelementptr inbounds i8, i8* %str.ph.1, i32 1 - %load.1 = load i8, i8* %incdec.ptr109, align 1 + %str.ph.1 = phi ptr [ %incdec.ptr109, %for.body ], [ %str.ph.0, %for.inc.preheader ] + %incdec.ptr109 = getelementptr inbounds i8, ptr %str.ph.1, i32 1 + %load.1 = load i8, ptr %incdec.ptr109, align 1 %tobool = icmp ne i8 %load.1, 0 %and = and i1 %cmp, %tobool br i1 %and, label %for.body, label %exit diff --git a/llvm/test/Transforms/SimplifyCFG/ARM/speculate-math.ll b/llvm/test/Transforms/SimplifyCFG/ARM/speculate-math.ll index 6ff248241fcc58..b3d2864d519454 100644 --- a/llvm/test/Transforms/SimplifyCFG/ARM/speculate-math.ll +++ b/llvm/test/Transforms/SimplifyCFG/ARM/speculate-math.ll @@ -47,13 +47,13 @@ cond.end: ret double %cond } -define void @sqrt_test(float addrspace(1)* noalias nocapture %out, float %a) nounwind { +define void @sqrt_test(ptr addrspace(1) noalias nocapture %out, float %a) nounwind { ; CHECK-MVE-LABEL: @sqrt_test( ; CHECK-MVE-NEXT: entry: ; CHECK-MVE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-MVE-NEXT: [[TMP0:%.*]] = tail call float @llvm.sqrt.f32(float [[A]]) #3 ; CHECK-MVE-NEXT: [[COND_I:%.*]] = select afn i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-MVE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-MVE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-MVE-NEXT: ret void ; ; CHECK-V8M-MAIN-LABEL: @sqrt_test( @@ -61,7 +61,7 @@ define void @sqrt_test(float addrspace(1)* noalias nocapture %out, float %a) nou ; CHECK-V8M-MAIN-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-MAIN-NEXT: [[TMP0:%.*]] = tail call float @llvm.sqrt.f32(float [[A]]) #2 ; CHECK-V8M-MAIN-NEXT: [[COND_I:%.*]] = select afn i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-MAIN-NEXT: ret void ; ; CHECK-V8M-BASE-LABEL: @sqrt_test( @@ -69,7 +69,7 @@ define void @sqrt_test(float addrspace(1)* noalias nocapture %out, float %a) nou ; CHECK-V8M-BASE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-BASE-NEXT: [[TMP0:%.*]] = tail call float @llvm.sqrt.f32(float [[A]]) #2 ; CHECK-V8M-BASE-NEXT: [[COND_I:%.*]] = select afn i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-BASE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-BASE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-BASE-NEXT: ret void ; entry: @@ -82,17 +82,17 @@ cond.else.i: ; preds = %entry test_sqrt.exit: ; preds = %cond.else.i, %entry %cond.i = phi afn float [ %0, %cond.else.i ], [ 0x7FF8000000000000, %entry ] - store float %cond.i, float addrspace(1)* %out, align 4 + store float %cond.i, ptr addrspace(1) %out, align 4 ret void } -define void @fabs_test(float addrspace(1)* noalias nocapture %out, float %a) nounwind { +define void @fabs_test(ptr addrspace(1) noalias nocapture %out, float %a) nounwind { ; CHECK-MVE-LABEL: @fabs_test( ; CHECK-MVE-NEXT: entry: ; CHECK-MVE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-MVE-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[A]]) #3 ; CHECK-MVE-NEXT: [[COND_I:%.*]] = select reassoc i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-MVE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-MVE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-MVE-NEXT: ret void ; ; CHECK-V8M-MAIN-LABEL: @fabs_test( @@ -100,7 +100,7 @@ define void @fabs_test(float addrspace(1)* noalias nocapture %out, float %a) nou ; CHECK-V8M-MAIN-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-MAIN-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[A]]) #2 ; CHECK-V8M-MAIN-NEXT: [[COND_I:%.*]] = select reassoc i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-MAIN-NEXT: ret void ; ; CHECK-V8M-BASE-LABEL: @fabs_test( @@ -108,7 +108,7 @@ define void @fabs_test(float addrspace(1)* noalias nocapture %out, float %a) nou ; CHECK-V8M-BASE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-BASE-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[A]]) #2 ; CHECK-V8M-BASE-NEXT: [[COND_I:%.*]] = select reassoc i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-BASE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-BASE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-BASE-NEXT: ret void ; entry: @@ -121,17 +121,17 @@ cond.else.i: ; preds = %entry test_fabs.exit: ; preds = %cond.else.i, %entry %cond.i = phi reassoc float [ %0, %cond.else.i ], [ 0x7FF8000000000000, %entry ] - store float %cond.i, float addrspace(1)* %out, align 4 + store float %cond.i, ptr addrspace(1) %out, align 4 ret void } -define void @fma_test(float addrspace(1)* noalias nocapture %out, float %a, float %b, float %c) nounwind { +define void @fma_test(ptr addrspace(1) noalias nocapture %out, float %a, float %b, float %c) nounwind { ; CHECK-MVE-LABEL: @fma_test( ; CHECK-MVE-NEXT: entry: ; CHECK-MVE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-MVE-NEXT: [[TMP0:%.*]] = tail call float @llvm.fma.f32(float [[A]], float [[B:%.*]], float [[C:%.*]]) #3 ; CHECK-MVE-NEXT: [[COND_I:%.*]] = select reassoc nsz i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-MVE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-MVE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-MVE-NEXT: ret void ; ; CHECK-V8M-MAIN-LABEL: @fma_test( @@ -139,7 +139,7 @@ define void @fma_test(float addrspace(1)* noalias nocapture %out, float %a, floa ; CHECK-V8M-MAIN-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-MAIN-NEXT: [[TMP0:%.*]] = tail call float @llvm.fma.f32(float [[A]], float [[B:%.*]], float [[C:%.*]]) #2 ; CHECK-V8M-MAIN-NEXT: [[COND_I:%.*]] = select reassoc nsz i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-MAIN-NEXT: ret void ; ; CHECK-V8M-BASE-LABEL: @fma_test( @@ -147,7 +147,7 @@ define void @fma_test(float addrspace(1)* noalias nocapture %out, float %a, floa ; CHECK-V8M-BASE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-BASE-NEXT: [[TMP0:%.*]] = tail call float @llvm.fma.f32(float [[A]], float [[B:%.*]], float [[C:%.*]]) #2 ; CHECK-V8M-BASE-NEXT: [[COND_I:%.*]] = select reassoc nsz i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-BASE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-BASE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-BASE-NEXT: ret void ; entry: @@ -160,17 +160,17 @@ cond.else.i: ; preds = %entry test_fma.exit: ; preds = %cond.else.i, %entry %cond.i = phi nsz reassoc float [ %0, %cond.else.i ], [ 0x7FF8000000000000, %entry ] - store float %cond.i, float addrspace(1)* %out, align 4 + store float %cond.i, ptr addrspace(1) %out, align 4 ret void } -define void @fmuladd_test(float addrspace(1)* noalias nocapture %out, float %a, float %b, float %c) nounwind { +define void @fmuladd_test(ptr addrspace(1) noalias nocapture %out, float %a, float %b, float %c) nounwind { ; CHECK-MVE-LABEL: @fmuladd_test( ; CHECK-MVE-NEXT: entry: ; CHECK-MVE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-MVE-NEXT: [[TMP0:%.*]] = tail call float @llvm.fmuladd.f32(float [[A]], float [[B:%.*]], float [[C:%.*]]) #3 ; CHECK-MVE-NEXT: [[COND_I:%.*]] = select ninf i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-MVE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-MVE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-MVE-NEXT: ret void ; ; CHECK-V8M-MAIN-LABEL: @fmuladd_test( @@ -178,7 +178,7 @@ define void @fmuladd_test(float addrspace(1)* noalias nocapture %out, float %a, ; CHECK-V8M-MAIN-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-MAIN-NEXT: [[TMP0:%.*]] = tail call float @llvm.fmuladd.f32(float [[A]], float [[B:%.*]], float [[C:%.*]]) #2 ; CHECK-V8M-MAIN-NEXT: [[COND_I:%.*]] = select ninf i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-MAIN-NEXT: ret void ; ; CHECK-V8M-BASE-LABEL: @fmuladd_test( @@ -186,7 +186,7 @@ define void @fmuladd_test(float addrspace(1)* noalias nocapture %out, float %a, ; CHECK-V8M-BASE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-BASE-NEXT: [[TMP0:%.*]] = tail call float @llvm.fmuladd.f32(float [[A]], float [[B:%.*]], float [[C:%.*]]) #2 ; CHECK-V8M-BASE-NEXT: [[COND_I:%.*]] = select ninf i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-BASE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-BASE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-BASE-NEXT: ret void ; entry: @@ -199,17 +199,17 @@ cond.else.i: ; preds = %entry test_fmuladd.exit: ; preds = %cond.else.i, %entry %cond.i = phi ninf float [ %0, %cond.else.i ], [ 0x7FF8000000000000, %entry ] - store float %cond.i, float addrspace(1)* %out, align 4 + store float %cond.i, ptr addrspace(1) %out, align 4 ret void } -define void @minnum_test(float addrspace(1)* noalias nocapture %out, float %a, float %b) nounwind { +define void @minnum_test(ptr addrspace(1) noalias nocapture %out, float %a, float %b) nounwind { ; CHECK-MVE-LABEL: @minnum_test( ; CHECK-MVE-NEXT: entry: ; CHECK-MVE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-MVE-NEXT: [[TMP0:%.*]] = tail call float @llvm.minnum.f32(float [[A]], float [[B:%.*]]) #3 ; CHECK-MVE-NEXT: [[COND_I:%.*]] = select i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-MVE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-MVE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-MVE-NEXT: ret void ; ; CHECK-V8M-MAIN-LABEL: @minnum_test( @@ -217,7 +217,7 @@ define void @minnum_test(float addrspace(1)* noalias nocapture %out, float %a, f ; CHECK-V8M-MAIN-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-MAIN-NEXT: [[TMP0:%.*]] = tail call float @llvm.minnum.f32(float [[A]], float [[B:%.*]]) #2 ; CHECK-V8M-MAIN-NEXT: [[COND_I:%.*]] = select i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-MAIN-NEXT: ret void ; ; CHECK-V8M-BASE-LABEL: @minnum_test( @@ -225,7 +225,7 @@ define void @minnum_test(float addrspace(1)* noalias nocapture %out, float %a, f ; CHECK-V8M-BASE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-BASE-NEXT: [[TMP0:%.*]] = tail call float @llvm.minnum.f32(float [[A]], float [[B:%.*]]) #2 ; CHECK-V8M-BASE-NEXT: [[COND_I:%.*]] = select i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-BASE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-BASE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-BASE-NEXT: ret void ; entry: @@ -238,17 +238,17 @@ cond.else.i: ; preds = %entry test_minnum.exit: ; preds = %cond.else.i, %entry %cond.i = phi float [ %0, %cond.else.i ], [ 0x7FF8000000000000, %entry ] - store float %cond.i, float addrspace(1)* %out, align 4 + store float %cond.i, ptr addrspace(1) %out, align 4 ret void } -define void @maxnum_test(float addrspace(1)* noalias nocapture %out, float %a, float %b) nounwind { +define void @maxnum_test(ptr addrspace(1) noalias nocapture %out, float %a, float %b) nounwind { ; CHECK-MVE-LABEL: @maxnum_test( ; CHECK-MVE-NEXT: entry: ; CHECK-MVE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-MVE-NEXT: [[TMP0:%.*]] = tail call float @llvm.maxnum.f32(float [[A]], float [[B:%.*]]) #3 ; CHECK-MVE-NEXT: [[COND_I:%.*]] = select ninf nsz i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-MVE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-MVE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-MVE-NEXT: ret void ; ; CHECK-V8M-MAIN-LABEL: @maxnum_test( @@ -256,7 +256,7 @@ define void @maxnum_test(float addrspace(1)* noalias nocapture %out, float %a, f ; CHECK-V8M-MAIN-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-MAIN-NEXT: [[TMP0:%.*]] = tail call float @llvm.maxnum.f32(float [[A]], float [[B:%.*]]) #2 ; CHECK-V8M-MAIN-NEXT: [[COND_I:%.*]] = select ninf nsz i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-MAIN-NEXT: ret void ; ; CHECK-V8M-BASE-LABEL: @maxnum_test( @@ -264,7 +264,7 @@ define void @maxnum_test(float addrspace(1)* noalias nocapture %out, float %a, f ; CHECK-V8M-BASE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-BASE-NEXT: [[TMP0:%.*]] = tail call float @llvm.maxnum.f32(float [[A]], float [[B:%.*]]) #2 ; CHECK-V8M-BASE-NEXT: [[COND_I:%.*]] = select ninf nsz i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-BASE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-BASE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-BASE-NEXT: ret void ; entry: @@ -277,17 +277,17 @@ cond.else.i: ; preds = %entry test_maxnum.exit: ; preds = %cond.else.i, %entry %cond.i = phi ninf nsz float [ %0, %cond.else.i ], [ 0x7FF8000000000000, %entry ] - store float %cond.i, float addrspace(1)* %out, align 4 + store float %cond.i, ptr addrspace(1) %out, align 4 ret void } -define void @minimum_test(float addrspace(1)* noalias nocapture %out, float %a, float %b) nounwind { +define void @minimum_test(ptr addrspace(1) noalias nocapture %out, float %a, float %b) nounwind { ; CHECK-MVE-LABEL: @minimum_test( ; CHECK-MVE-NEXT: entry: ; CHECK-MVE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-MVE-NEXT: [[TMP0:%.*]] = tail call float @llvm.minimum.f32(float [[A]], float [[B:%.*]]) #3 ; CHECK-MVE-NEXT: [[COND_I:%.*]] = select reassoc i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-MVE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-MVE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-MVE-NEXT: ret void ; ; CHECK-V8M-MAIN-LABEL: @minimum_test( @@ -295,7 +295,7 @@ define void @minimum_test(float addrspace(1)* noalias nocapture %out, float %a, ; CHECK-V8M-MAIN-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-MAIN-NEXT: [[TMP0:%.*]] = tail call float @llvm.minimum.f32(float [[A]], float [[B:%.*]]) #2 ; CHECK-V8M-MAIN-NEXT: [[COND_I:%.*]] = select reassoc i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-MAIN-NEXT: ret void ; ; CHECK-V8M-BASE-LABEL: @minimum_test( @@ -303,7 +303,7 @@ define void @minimum_test(float addrspace(1)* noalias nocapture %out, float %a, ; CHECK-V8M-BASE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-BASE-NEXT: [[TMP0:%.*]] = tail call float @llvm.minimum.f32(float [[A]], float [[B:%.*]]) #2 ; CHECK-V8M-BASE-NEXT: [[COND_I:%.*]] = select reassoc i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-BASE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-BASE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-BASE-NEXT: ret void ; entry: @@ -316,17 +316,17 @@ cond.else.i: ; preds = %entry test_minimum.exit: ; preds = %cond.else.i, %entry %cond.i = phi reassoc float [ %0, %cond.else.i ], [ 0x7FF8000000000000, %entry ] - store float %cond.i, float addrspace(1)* %out, align 4 + store float %cond.i, ptr addrspace(1) %out, align 4 ret void } -define void @maximum_test(float addrspace(1)* noalias nocapture %out, float %a, float %b) nounwind { +define void @maximum_test(ptr addrspace(1) noalias nocapture %out, float %a, float %b) nounwind { ; CHECK-MVE-LABEL: @maximum_test( ; CHECK-MVE-NEXT: entry: ; CHECK-MVE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-MVE-NEXT: [[TMP0:%.*]] = tail call float @llvm.maximum.f32(float [[A]], float [[B:%.*]]) #3 ; CHECK-MVE-NEXT: [[COND_I:%.*]] = select nsz i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-MVE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-MVE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-MVE-NEXT: ret void ; ; CHECK-V8M-MAIN-LABEL: @maximum_test( @@ -334,7 +334,7 @@ define void @maximum_test(float addrspace(1)* noalias nocapture %out, float %a, ; CHECK-V8M-MAIN-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-MAIN-NEXT: [[TMP0:%.*]] = tail call float @llvm.maximum.f32(float [[A]], float [[B:%.*]]) #2 ; CHECK-V8M-MAIN-NEXT: [[COND_I:%.*]] = select nsz i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-MAIN-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-MAIN-NEXT: ret void ; ; CHECK-V8M-BASE-LABEL: @maximum_test( @@ -342,7 +342,7 @@ define void @maximum_test(float addrspace(1)* noalias nocapture %out, float %a, ; CHECK-V8M-BASE-NEXT: [[CMP_I:%.*]] = fcmp olt float [[A:%.*]], 0.000000e+00 ; CHECK-V8M-BASE-NEXT: [[TMP0:%.*]] = tail call float @llvm.maximum.f32(float [[A]], float [[B:%.*]]) #2 ; CHECK-V8M-BASE-NEXT: [[COND_I:%.*]] = select nsz i1 [[CMP_I]], float 0x7FF8000000000000, float [[TMP0]] -; CHECK-V8M-BASE-NEXT: store float [[COND_I]], float addrspace(1)* [[OUT:%.*]], align 4 +; CHECK-V8M-BASE-NEXT: store float [[COND_I]], ptr addrspace(1) [[OUT:%.*]], align 4 ; CHECK-V8M-BASE-NEXT: ret void ; entry: @@ -355,6 +355,6 @@ cond.else.i: ; preds = %entry test_maximum.exit: ; preds = %cond.else.i, %entry %cond.i = phi nsz float [ %0, %cond.else.i ], [ 0x7FF8000000000000, %entry ] - store float %cond.i, float addrspace(1)* %out, align 4 + store float %cond.i, ptr addrspace(1) %out, align 4 ret void } diff --git a/llvm/test/Transforms/SimplifyCFG/ARM/switch-to-lookup-table-constant-expr.ll b/llvm/test/Transforms/SimplifyCFG/ARM/switch-to-lookup-table-constant-expr.ll index 2547e4424cfed4..23e4e2e494050f 100644 --- a/llvm/test/Transforms/SimplifyCFG/ARM/switch-to-lookup-table-constant-expr.ll +++ b/llvm/test/Transforms/SimplifyCFG/ARM/switch-to-lookup-table-constant-expr.ll @@ -15,7 +15,7 @@ target triple = "armv7a--none-eabi" @g3 = external global i32, align 4 @g4 = external thread_local global i32, align 4 -define i32* @test3(i32 %n) { +define ptr @test3(i32 %n) { ; CHECK-LABEL: @test3( ; CHECK-NEXT: entry: ; CHECK-NEXT: switch i32 [[N:%.*]], label [[SW_DEFAULT:%.*]] [ @@ -30,8 +30,8 @@ define i32* @test3(i32 %n) { ; CHECK: sw.default: ; CHECK-NEXT: br label [[RETURN]] ; CHECK: return: -; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i32* [ @g4, [[SW_DEFAULT]] ], [ getelementptr inbounds (i32, i32* inttoptr (i32 mul (i32 ptrtoint (i32* @g3 to i32), i32 2) to i32*), i32 1), [[SW_BB2]] ], [ @g2, [[SW_BB1]] ], [ @g1, [[ENTRY:%.*]] ] -; CHECK-NEXT: ret i32* [[RETVAL_0]] +; CHECK-NEXT: [[RETVAL_0:%.*]] = phi ptr [ @g4, [[SW_DEFAULT]] ], [ getelementptr inbounds (i32, ptr inttoptr (i32 mul (i32 ptrtoint (ptr @g3 to i32), i32 2) to ptr), i32 1), [[SW_BB2]] ], [ @g2, [[SW_BB1]] ], [ @g1, [[ENTRY:%.*]] ] +; CHECK-NEXT: ret ptr [[RETVAL_0]] ; entry: switch i32 %n, label %sw.default [ @@ -53,6 +53,6 @@ sw.default: br label %return return: - %retval.0 = phi i32* [ @g4, %sw.default ], [ getelementptr inbounds (i32, i32* inttoptr (i32 mul (i32 ptrtoint (i32* @g3 to i32), i32 2) to i32*), i32 1), %sw.bb2 ], [ @g2, %sw.bb1 ], [ @g1, %sw.bb ] - ret i32* %retval.0 + %retval.0 = phi ptr [ @g4, %sw.default ], [ getelementptr inbounds (i32, ptr inttoptr (i32 mul (i32 ptrtoint (ptr @g3 to i32), i32 2) to ptr), i32 1), %sw.bb2 ], [ @g2, %sw.bb1 ], [ @g1, %sw.bb ] + ret ptr %retval.0 } diff --git a/llvm/test/Transforms/SimplifyCFG/ARM/switch-to-lookup-table.ll b/llvm/test/Transforms/SimplifyCFG/ARM/switch-to-lookup-table.ll index 549ebb6dee0187..463a85cfd583dd 100644 --- a/llvm/test/Transforms/SimplifyCFG/ARM/switch-to-lookup-table.ll +++ b/llvm/test/Transforms/SimplifyCFG/ARM/switch-to-lookup-table.ll @@ -12,12 +12,12 @@ ; RUN: opt -S -passes='simplifycfg' -mtriple=arm -relocation-model=ropi-rwpi < %s | FileCheck %s --check-prefix=CHECK --check-prefix=DISABLE ; CHECK: @{{.*}} = private unnamed_addr constant [3 x i32] [i32 1234, i32 5678, i32 15532] -; ENABLE: @{{.*}} = private unnamed_addr constant [3 x i32*] [i32* @c1, i32* @c2, i32* @c3] -; DISABLE-NOT: @{{.*}} = private unnamed_addr constant [3 x i32*] [i32* @c1, i32* @c2, i32* @c3] -; ENABLE: @{{.*}} = private unnamed_addr constant [3 x i32*] [i32* @g1, i32* @g2, i32* @g3] -; DISABLE-NOT: @{{.*}} = private unnamed_addr constant [3 x i32*] [i32* @g1, i32* @g2, i32* @g3] -; ENABLE: @{{.*}} = private unnamed_addr constant [3 x i32 (i32, i32)*] [i32 (i32, i32)* @f1, i32 (i32, i32)* @f2, i32 (i32, i32)* @f3] -; DISABLE-NOT: @{{.*}} = private unnamed_addr constant [3 x i32 (i32, i32)*] [i32 (i32, i32)* @f1, i32 (i32, i32)* @f2, i32 (i32, i32)* @f3] +; ENABLE: @{{.*}} = private unnamed_addr constant [3 x ptr] [ptr @c1, ptr @c2, ptr @c3] +; DISABLE-NOT: @{{.*}} = private unnamed_addr constant [3 x ptr] [ptr @c1, ptr @c2, ptr @c3] +; ENABLE: @{{.*}} = private unnamed_addr constant [3 x ptr] [ptr @g1, ptr @g2, ptr @g3] +; DISABLE-NOT: @{{.*}} = private unnamed_addr constant [3 x ptr] [ptr @g1, ptr @g2, ptr @g3] +; ENABLE: @{{.*}} = private unnamed_addr constant [3 x ptr] [ptr @f1, ptr @f2, ptr @f3] +; DISABLE-NOT: @{{.*}} = private unnamed_addr constant [3 x ptr] [ptr @f1, ptr @f2, ptr @f3] target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" target triple = "armv7a--none-eabi" @@ -53,7 +53,7 @@ return: @c4 = external constant i32, align 4 -define i32* @test2(i32 %n) { +define ptr @test2(i32 %n) { entry: switch i32 %n, label %sw.default [ i32 0, label %sw.bb @@ -74,8 +74,8 @@ sw.default: br label %return return: - %retval.0 = phi i32* [ @c4, %sw.default ], [ @c3, %sw.bb2 ], [ @c2, %sw.bb1 ], [ @c1, %sw.bb ] - ret i32* %retval.0 + %retval.0 = phi ptr [ @c4, %sw.default ], [ @c3, %sw.bb2 ], [ @c2, %sw.bb1 ], [ @c1, %sw.bb ] + ret ptr %retval.0 } @g1 = external global i32, align 4 @@ -83,7 +83,7 @@ return: @g3 = external global i32, align 4 @g4 = external global i32, align 4 -define i32* @test3(i32 %n) { +define ptr @test3(i32 %n) { entry: switch i32 %n, label %sw.default [ i32 0, label %sw.bb @@ -104,8 +104,8 @@ sw.default: br label %return return: - %retval.0 = phi i32* [ @g4, %sw.default ], [ @g3, %sw.bb2 ], [ @g2, %sw.bb1 ], [ @g1, %sw.bb ] - ret i32* %retval.0 + %retval.0 = phi ptr [ @g4, %sw.default ], [ @g3, %sw.bb2 ], [ @g2, %sw.bb1 ], [ @g1, %sw.bb ] + ret ptr %retval.0 } declare i32 @f1(i32, i32) @@ -129,11 +129,11 @@ cond.false3: cond.false6: %cmp7 = icmp eq i32 %a, 4 - %cond = select i1 %cmp7, i32 (i32, i32)* @f4, i32 (i32, i32)* @f5 + %cond = select i1 %cmp7, ptr @f4, ptr @f5 br label %cond.end11 cond.end11: - %cond12 = phi i32 (i32, i32)* [ @f1, %entry ], [ @f2, %cond.false ], [ %cond, %cond.false6 ], [ @f3, %cond.false3 ] + %cond12 = phi ptr [ @f1, %entry ], [ @f2, %cond.false ], [ %cond, %cond.false6 ], [ @f3, %cond.false3 ] %call = call i32 %cond12(i32 %b, i32 %c) #2 ret i32 %call } diff --git a/llvm/test/Transforms/SimplifyCFG/EmptyBlockMerge.ll b/llvm/test/Transforms/SimplifyCFG/EmptyBlockMerge.ll index 414749d8f9db49..d38f50e0e31a69 100644 --- a/llvm/test/Transforms/SimplifyCFG/EmptyBlockMerge.ll +++ b/llvm/test/Transforms/SimplifyCFG/EmptyBlockMerge.ll @@ -4,9 +4,9 @@ declare void @foo() -define void @cprop_test12(i32* %data) { +define void @cprop_test12(ptr %data) { bb0: - %reg108 = load i32, i32* %data ; [#uses=2] + %reg108 = load i32, ptr %data ; [#uses=2] %cond218 = icmp ne i32 %reg108, 5 ; [#uses=1] br i1 %cond218, label %bb3, label %bb2 bb2: ; preds = %bb0 @@ -15,7 +15,7 @@ bb2: ; preds = %bb0 br label %bb3 bb3: ; preds = %bb2, %bb0 %reg117 = phi i32 [ 110, %bb2 ], [ %reg108, %bb0 ] ; [#uses=1] - store i32 %reg117, i32* %data + store i32 %reg117, ptr %data ret void } diff --git a/llvm/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll b/llvm/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll index 937392946f8971..2e096fb97e63f7 100644 --- a/llvm/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll +++ b/llvm/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll @@ -61,13 +61,13 @@ U: ; preds = %T, %S, %R ; Test merging of blocks with phi nodes where at least one incoming value ; in the successor is undef. -define i8 @testundef2(i32 %u, i32* %A) { +define i8 @testundef2(i32 %u, ptr %A) { ; CHECK-LABEL: @testundef2( ; CHECK-NEXT: V: ; CHECK-NEXT: [[COND:%.*]] = icmp eq i32 [[U:%.*]], 3 ; CHECK-NEXT: br i1 [[COND]], label [[Z:%.*]], label [[U:%.*]] ; CHECK: Z: -; CHECK-NEXT: store i32 0, i32* [[A:%.*]], align 4 +; CHECK-NEXT: store i32 0, ptr [[A:%.*]], align 4 ; CHECK-NEXT: br label [[U]] ; CHECK: U: ; CHECK-NEXT: ret i8 1 @@ -84,7 +84,7 @@ W: ; preds = %V br label %U Z: - store i32 0, i32* %A, align 4 + store i32 0, ptr %A, align 4 br label %X X: ; preds = %V, %V, %Z @@ -100,7 +100,7 @@ U: ; preds = %X, %W, %V ret i8 %val.0 } -define i8 @testmergesome(i32 %u, i32* %A) { +define i8 @testmergesome(i32 %u, ptr %A) { ; CHECK-LABEL: @testmergesome( ; CHECK-NEXT: V: ; CHECK-NEXT: switch i32 [[U:%.*]], label [[Y:%.*]] [ @@ -108,10 +108,10 @@ define i8 @testmergesome(i32 %u, i32* %A) { ; CHECK-NEXT: i32 3, label [[Z:%.*]] ; CHECK-NEXT: ] ; CHECK: W: -; CHECK-NEXT: store i32 1, i32* [[A:%.*]], align 4 +; CHECK-NEXT: store i32 1, ptr [[A:%.*]], align 4 ; CHECK-NEXT: br label [[Y]] ; CHECK: Z: -; CHECK-NEXT: store i32 0, i32* [[A]], align 4 +; CHECK-NEXT: store i32 0, ptr [[A]], align 4 ; CHECK-NEXT: br label [[Y]] ; CHECK: Y: ; CHECK-NEXT: [[VAL_0:%.*]] = phi i8 [ 2, [[W]] ], [ 1, [[Z]] ], [ 1, [[V:%.*]] ] @@ -126,11 +126,11 @@ V: ] W: ; preds = %V - store i32 1, i32* %A, align 4 + store i32 1, ptr %A, align 4 br label %Y Z: - store i32 0, i32* %A, align 4 + store i32 0, ptr %A, align 4 br label %X X: ; preds = %V, %Z @@ -144,7 +144,7 @@ Y: ; preds = %X, %W, %V } -define i8 @testmergesome2(i32 %u, i32* %A) { +define i8 @testmergesome2(i32 %u, ptr %A) { ; CHECK-LABEL: @testmergesome2( ; CHECK-NEXT: V: ; CHECK-NEXT: switch i32 [[U:%.*]], label [[W:%.*]] [ @@ -153,7 +153,7 @@ define i8 @testmergesome2(i32 %u, i32* %A) { ; CHECK-NEXT: i32 2, label [[Y]] ; CHECK-NEXT: ] ; CHECK: W: -; CHECK-NEXT: store i32 1, i32* [[A:%.*]], align 4 +; CHECK-NEXT: store i32 1, ptr [[A:%.*]], align 4 ; CHECK-NEXT: br label [[Y]] ; CHECK: Y: ; CHECK-NEXT: [[VAL_0:%.*]] = phi i8 [ 1, [[V:%.*]] ], [ 2, [[W]] ], [ 1, [[V]] ], [ 1, [[V]] ] @@ -168,7 +168,7 @@ V: ] W: ; preds = %V - store i32 1, i32* %A, align 4 + store i32 1, ptr %A, align 4 br label %Y X: ; preds = %V, %Z diff --git a/llvm/test/Transforms/SimplifyCFG/FoldValueComparisonIntoPredecessors-domtree-preservation-edgecase-2.ll b/llvm/test/Transforms/SimplifyCFG/FoldValueComparisonIntoPredecessors-domtree-preservation-edgecase-2.ll index 1688515af75c15..b55c53b6af3a07 100644 --- a/llvm/test/Transforms/SimplifyCFG/FoldValueComparisonIntoPredecessors-domtree-preservation-edgecase-2.ll +++ b/llvm/test/Transforms/SimplifyCFG/FoldValueComparisonIntoPredecessors-domtree-preservation-edgecase-2.ll @@ -6,7 +6,7 @@ declare i16 @baz() declare void @snork() declare void @spam() -define void @zot() local_unnamed_addr align 2 personality i8* undef { +define void @zot() local_unnamed_addr align 2 personality ptr undef { ; CHECK-LABEL: @zot( ; CHECK-NEXT: bb: ; CHECK-NEXT: invoke void @widget() @@ -27,7 +27,7 @@ define void @zot() local_unnamed_addr align 2 personality i8* undef { ; CHECK: common.ret: ; CHECK-NEXT: ret void ; CHECK: bb21: -; CHECK-NEXT: [[I22:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[I22:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: br label [[COMMON_RET:%.*]] ; CHECK: bb23: @@ -58,7 +58,7 @@ bb20: ; preds = %bb19 unreachable bb21: ; preds = %bb - %i22 = landingpad { i8*, i32 } + %i22 = landingpad { ptr, i32 } cleanup ret void @@ -70,7 +70,7 @@ bb24: ; preds = %bb25, %bb23 ret void bb25: ; preds = %bb23, %bb19, %bb14 - %i26 = landingpad { i8*, i32 } + %i26 = landingpad { ptr, i32 } cleanup br label %bb24 } diff --git a/llvm/test/Transforms/SimplifyCFG/Hexagon/switch-to-lookup-table.ll b/llvm/test/Transforms/SimplifyCFG/Hexagon/switch-to-lookup-table.ll index 4106501eeb3a00..8bff822ef57f0e 100644 --- a/llvm/test/Transforms/SimplifyCFG/Hexagon/switch-to-lookup-table.ll +++ b/llvm/test/Transforms/SimplifyCFG/Hexagon/switch-to-lookup-table.ll @@ -13,8 +13,8 @@ define i32 @foo(i32 %x) #0 section ".tcm_text" { ; ENABLE-NEXT: [[TMP0:%.*]] = icmp ult i32 [[X:%.*]], 6 ; ENABLE-NEXT: br i1 [[TMP0]], label [[SWITCH_LOOKUP:%.*]], label [[RETURN:%.*]] ; ENABLE: switch.lookup: -; ENABLE-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.foo, i32 0, i32 [[X]] -; ENABLE-NEXT: [[SWITCH_LOAD:%.*]] = load i32, i32* [[SWITCH_GEP]], align 4 +; ENABLE-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [6 x i32], ptr @switch.table.foo, i32 0, i32 [[X]] +; ENABLE-NEXT: [[SWITCH_LOAD:%.*]] = load i32, ptr [[SWITCH_GEP]], align 4 ; ENABLE-NEXT: br label [[RETURN]] ; ENABLE: return: ; ENABLE-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[SWITCH_LOAD]], [[SWITCH_LOOKUP]] ], [ 19, [[ENTRY:%.*]] ] @@ -49,8 +49,8 @@ define i32 @foo(i32 %x) #0 section ".tcm_text" { entry: %retval = alloca i32, align 4 %x.addr = alloca i32, align 4 - store i32 %x, i32* %x.addr, align 4 - %0 = load i32, i32* %x.addr, align 4 + store i32 %x, ptr %x.addr, align 4 + %0 = load i32, ptr %x.addr, align 4 switch i32 %0, label %sw.default [ i32 0, label %sw.bb i32 1, label %sw.bb1 @@ -61,35 +61,35 @@ entry: ] sw.bb: ; preds = %entry - store i32 9, i32* %retval, align 4 + store i32 9, ptr %retval, align 4 br label %return sw.bb1: ; preds = %entry - store i32 20, i32* %retval, align 4 + store i32 20, ptr %retval, align 4 br label %return sw.bb2: ; preds = %entry - store i32 14, i32* %retval, align 4 + store i32 14, ptr %retval, align 4 br label %return sw.bb3: ; preds = %entry - store i32 22, i32* %retval, align 4 + store i32 22, ptr %retval, align 4 br label %return sw.bb4: ; preds = %entry - store i32 12, i32* %retval, align 4 + store i32 12, ptr %retval, align 4 br label %return sw.bb5: ; preds = %entry - store i32 5, i32* %retval, align 4 + store i32 5, ptr %retval, align 4 br label %return sw.default: ; preds = %entry - store i32 19, i32* %retval, align 4 + store i32 19, ptr %retval, align 4 br label %return return: ; preds = %sw.default, %sw.bb5, %sw.bb4, %sw.bb3, %sw.bb2, %sw.bb1, %sw.bb - %1 = load i32, i32* %retval, align 4 + %1 = load i32, ptr %retval, align 4 ret i32 %1 } diff --git a/llvm/test/Transforms/SimplifyCFG/HoistCode.ll b/llvm/test/Transforms/SimplifyCFG/HoistCode.ll index 8d6436c7ee6052..10c6f81c91ac59 100644 --- a/llvm/test/Transforms/SimplifyCFG/HoistCode.ll +++ b/llvm/test/Transforms/SimplifyCFG/HoistCode.ll @@ -2,18 +2,18 @@ ; RUN: opt < %s -passes=simplifycfg -hoist-common-insts=true -S | FileCheck %s ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -S | FileCheck %s -define void @foo(i1 %C, i32* %P) { +define void @foo(i1 %C, ptr %P) { ; CHECK-LABEL: @foo( ; CHECK-NEXT: common.ret: -; CHECK-NEXT: store i32 7, i32* [[P:%.*]], align 4 +; CHECK-NEXT: store i32 7, ptr [[P:%.*]], align 4 ; CHECK-NEXT: ret void ; br i1 %C, label %T, label %F T: ; preds = %0 - store i32 7, i32* %P + store i32 7, ptr %P ret void F: ; preds = %0 - store i32 7, i32* %P + store i32 7, ptr %P ret void } diff --git a/llvm/test/Transforms/SimplifyCFG/InfLoop.ll b/llvm/test/Transforms/SimplifyCFG/InfLoop.ll index 04d2891564bec0..6db83653ebe49a 100644 --- a/llvm/test/Transforms/SimplifyCFG/InfLoop.ll +++ b/llvm/test/Transforms/SimplifyCFG/InfLoop.ll @@ -13,7 +13,7 @@ target triple = "thumbv7-apple-ios9.0.0" define void @main() { entry: - %0 = load i32, i32* getelementptr inbounds (%struct.anon, %struct.anon* @U, i32 0, i32 2), align 4 + %0 = load i32, ptr getelementptr inbounds (%struct.anon, ptr @U, i32 0, i32 2), align 4 %cmp.i = icmp eq i32 %0, -1 br i1 %cmp.i, label %if.then, label %if.end @@ -21,8 +21,8 @@ if.then: ; preds = %entry br label %if.end if.end: ; preds = %entry, %if.then - %1 = load i32, i32* getelementptr inbounds (%struct.anon, %struct.anon* @U, i32 0, i32 2), align 4 - %bf.load = load i32, i32* getelementptr inbounds (%struct.anon, %struct.anon* @U, i32 0, i32 3, i32 0, i32 0), align 4 + %1 = load i32, ptr getelementptr inbounds (%struct.anon, ptr @U, i32 0, i32 2), align 4 + %bf.load = load i32, ptr getelementptr inbounds (%struct.anon, ptr @U, i32 0, i32 3, i32 0, i32 0), align 4 %cmp = icmp slt i32 %0, 0 br i1 %cmp, label %if.end7, label %cond.false @@ -63,8 +63,8 @@ for.cond.i: ; preds = %if.end6.i, %if.end. br i1 %cmp2.i, label %for.body.i, label %TmpSimpleNeedExt.exit for.body.i: ; preds = %for.cond.i - %arrayidx.i = getelementptr inbounds %struct.anon, %struct.anon* @U, i32 0, i32 0, i32 2, i32 %ix.0.i - %elt = load i8, i8* %arrayidx.i, align 1 + %arrayidx.i = getelementptr inbounds %struct.anon, ptr @U, i32 0, i32 0, i32 2, i32 %ix.0.i + %elt = load i8, ptr %arrayidx.i, align 1 %cmp3.i = icmp sgt i8 %elt, 7 br i1 %cmp3.i, label %if.else21, label %if.end6.i diff --git a/llvm/test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll b/llvm/test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll index 8eed46b978e5f7..e64d970ad70ec3 100644 --- a/llvm/test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll +++ b/llvm/test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll @@ -11,23 +11,23 @@ source_filename = "./csmith107.i.debug.ll" @a = global i16 0, !dbg !0 @b = global i32 0, !dbg !4 -@c = global i16* null, !dbg !9 +@c = global ptr null, !dbg !9 define i16 @fn1() !dbg !17 { bb2: - store i32 -1, i32* @b, align 1 - %_tmp1.pre = load i16, i16* @a, align 1, !dbg !20 - %_tmp2.pre = load i16*, i16** @c, align 1 + store i32 -1, ptr @b, align 1 + %_tmp1.pre = load i16, ptr @a, align 1, !dbg !20 + %_tmp2.pre = load ptr, ptr @c, align 1 tail call void @llvm.dbg.value(metadata i16 6, metadata !22, metadata !23), !dbg !24 tail call void @llvm.dbg.value(metadata i16 %_tmp1.pre, metadata !25, metadata !23), !dbg !20 - %_tmp3 = load i16, i16* %_tmp2.pre, align 1 + %_tmp3 = load i16, ptr %_tmp2.pre, align 1 %_tmp4 = icmp ne i16 %_tmp3, 0 %_tmp6 = icmp ne i16 %_tmp1.pre, 0 %or.cond = and i1 %_tmp6, %_tmp4 br i1 %or.cond, label %bb5, label %bb1 bb1: ; preds = %bb2 - store i32 5, i32* @b, align 1 + store i32 5, ptr @b, align 1 br label %bb5 bb5: ; preds = %bb1, %bb2 diff --git a/llvm/test/Transforms/SimplifyCFG/PR9946.ll b/llvm/test/Transforms/SimplifyCFG/PR9946.ll index 8c6cbafedc97fb..92a87c1e4ca501 100644 --- a/llvm/test/Transforms/SimplifyCFG/PR9946.ll +++ b/llvm/test/Transforms/SimplifyCFG/PR9946.ll @@ -4,7 +4,7 @@ define i32 @f() { entry: - br i1 icmp eq (i64 and (i64 ptrtoint (i32* @foo to i64), i64 15), i64 0), label %if.end, label %if.then + br i1 icmp eq (i64 and (i64 ptrtoint (ptr @foo to i64), i64 15), i64 0), label %if.end, label %if.then if.then: ; preds = %entry br label %return diff --git a/llvm/test/Transforms/SimplifyCFG/PowerPC/prefer-fma.ll b/llvm/test/Transforms/SimplifyCFG/PowerPC/prefer-fma.ll index cd15f74f8e7505..c7bc43e1faaede 100644 --- a/llvm/test/Transforms/SimplifyCFG/PowerPC/prefer-fma.ll +++ b/llvm/test/Transforms/SimplifyCFG/PowerPC/prefer-fma.ll @@ -4,85 +4,85 @@ ; This case is copied from test/Transforms/SimplifyCFG/AArch64/ ; Function Attrs: nounwind -define double @_Z3fooRdS_S_S_(double* dereferenceable(8) %x, double* dereferenceable(8) %y, double* dereferenceable(8) %a) { +define double @_Z3fooRdS_S_S_(ptr dereferenceable(8) %x, ptr dereferenceable(8) %y, ptr dereferenceable(8) %a) { ; CHECK-LABEL: @_Z3fooRdS_S_S_( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[TMP0:%.*]] = load double, double* [[Y:%.*]], align 8 +; CHECK-NEXT: [[TMP0:%.*]] = load double, ptr [[Y:%.*]], align 8 ; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq double [[TMP0]], 0.000000e+00 -; CHECK-NEXT: [[TMP1:%.*]] = load double, double* [[X:%.*]], align 8 -; CHECK-NEXT: [[TMP2:%.*]] = load double, double* [[A:%.*]], align 8 +; CHECK-NEXT: [[TMP1:%.*]] = load double, ptr [[X:%.*]], align 8 +; CHECK-NEXT: [[TMP2:%.*]] = load double, ptr [[A:%.*]], align 8 ; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; CHECK: if.then: ; CHECK-NEXT: [[TMP3:%.*]] = fmul fast double [[TMP1]], [[TMP2]] ; CHECK-NEXT: [[MUL:%.*]] = fadd fast double 1.000000e+00, [[TMP3]] -; CHECK-NEXT: store double [[MUL]], double* [[Y]], align 8 +; CHECK-NEXT: store double [[MUL]], ptr [[Y]], align 8 ; CHECK-NEXT: br label [[IF_END:%.*]] ; CHECK: if.else: ; CHECK-NEXT: [[MUL1:%.*]] = fmul fast double [[TMP1]], [[TMP2]] ; CHECK-NEXT: [[SUB1:%.*]] = fsub fast double [[MUL1]], [[TMP0]] -; CHECK-NEXT: [[GEP1:%.*]] = getelementptr double, double* [[Y]], i32 1 -; CHECK-NEXT: store double [[SUB1]], double* [[GEP1]], align 8 +; CHECK-NEXT: [[GEP1:%.*]] = getelementptr double, ptr [[Y]], i32 1 +; CHECK-NEXT: store double [[SUB1]], ptr [[GEP1]], align 8 ; CHECK-NEXT: br label [[IF_END]] ; CHECK: if.end: -; CHECK-NEXT: [[TMP4:%.*]] = load double, double* [[Y]], align 8 +; CHECK-NEXT: [[TMP4:%.*]] = load double, ptr [[Y]], align 8 ; CHECK-NEXT: [[CMP2:%.*]] = fcmp oeq double [[TMP4]], 2.000000e+00 -; CHECK-NEXT: [[TMP5:%.*]] = load double, double* [[X]], align 8 +; CHECK-NEXT: [[TMP5:%.*]] = load double, ptr [[X]], align 8 ; CHECK-NEXT: br i1 [[CMP2]], label [[IF_THEN2:%.*]], label [[IF_ELSE2:%.*]] ; CHECK: if.then2: -; CHECK-NEXT: [[TMP6:%.*]] = load double, double* [[A]], align 8 +; CHECK-NEXT: [[TMP6:%.*]] = load double, ptr [[A]], align 8 ; CHECK-NEXT: [[TMP7:%.*]] = fmul fast double [[TMP5]], 3.000000e+00 ; CHECK-NEXT: [[MUL2:%.*]] = fsub fast double [[TMP6]], [[TMP7]] -; CHECK-NEXT: store double [[MUL2]], double* [[Y]], align 8 +; CHECK-NEXT: store double [[MUL2]], ptr [[Y]], align 8 ; CHECK-NEXT: br label [[IF_END2:%.*]] ; CHECK: if.else2: ; CHECK-NEXT: [[MUL3:%.*]] = fmul fast double [[TMP5]], 3.000000e+00 ; CHECK-NEXT: [[NEG:%.*]] = fsub fast double 0.000000e+00, [[MUL3]] ; CHECK-NEXT: [[SUB2:%.*]] = fsub fast double [[NEG]], 3.000000e+00 -; CHECK-NEXT: store double [[SUB2]], double* [[Y]], align 8 +; CHECK-NEXT: store double [[SUB2]], ptr [[Y]], align 8 ; CHECK-NEXT: br label [[IF_END2]] ; CHECK: if.end2: -; CHECK-NEXT: [[TMP8:%.*]] = load double, double* [[X]], align 8 -; CHECK-NEXT: [[TMP9:%.*]] = load double, double* [[Y]], align 8 +; CHECK-NEXT: [[TMP8:%.*]] = load double, ptr [[X]], align 8 +; CHECK-NEXT: [[TMP9:%.*]] = load double, ptr [[Y]], align 8 ; CHECK-NEXT: [[ADD:%.*]] = fadd fast double [[TMP8]], [[TMP9]] -; CHECK-NEXT: [[TMP10:%.*]] = load double, double* [[A]], align 8 +; CHECK-NEXT: [[TMP10:%.*]] = load double, ptr [[A]], align 8 ; CHECK-NEXT: [[ADD2:%.*]] = fadd fast double [[ADD]], [[TMP10]] ; CHECK-NEXT: ret double [[ADD2]] ; entry: - %0 = load double, double* %y, align 8 + %0 = load double, ptr %y, align 8 %cmp = fcmp oeq double %0, 0.000000e+00 - %1 = load double, double* %x, align 8 + %1 = load double, ptr %x, align 8 br i1 %cmp, label %if.then, label %if.else ; fadd (const, (fmul x, y)) if.then: ; preds = %entry - %2 = load double, double* %a, align 8 + %2 = load double, ptr %a, align 8 %3 = fmul fast double %1, %2 %mul = fadd fast double 1.000000e+00, %3 - store double %mul, double* %y, align 8 + store double %mul, ptr %y, align 8 br label %if.end ; fsub ((fmul x, y), z) if.else: ; preds = %entry - %4 = load double, double* %a, align 8 + %4 = load double, ptr %a, align 8 %mul1 = fmul fast double %1, %4 %sub1 = fsub fast double %mul1, %0 - %gep1 = getelementptr double, double* %y, i32 1 - store double %sub1, double* %gep1, align 8 + %gep1 = getelementptr double, ptr %y, i32 1 + store double %sub1, ptr %gep1, align 8 br label %if.end if.end: ; preds = %if.else, %if.then - %5 = load double, double* %y, align 8 + %5 = load double, ptr %y, align 8 %cmp2 = fcmp oeq double %5, 2.000000e+00 - %6 = load double, double* %x, align 8 + %6 = load double, ptr %x, align 8 br i1 %cmp2, label %if.then2, label %if.else2 ; fsub (x, (fmul y, z)) if.then2: ; preds = %entry - %7 = load double, double* %a, align 8 + %7 = load double, ptr %a, align 8 %8 = fmul fast double %6, 3.0000000e+00 %mul2 = fsub fast double %7, %8 - store double %mul2, double* %y, align 8 + store double %mul2, ptr %y, align 8 br label %if.end2 ; fsub (fneg((fmul x, y)), const) @@ -90,14 +90,14 @@ if.else2: ; preds = %entry %mul3 = fmul fast double %6, 3.0000000e+00 %neg = fsub fast double 0.0000000e+00, %mul3 %sub2 = fsub fast double %neg, 3.0000000e+00 - store double %sub2, double* %y, align 8 + store double %sub2, ptr %y, align 8 br label %if.end2 if.end2: ; preds = %if.else, %if.then - %9 = load double, double* %x, align 8 - %10 = load double, double* %y, align 8 + %9 = load double, ptr %x, align 8 + %10 = load double, ptr %y, align 8 %add = fadd fast double %9, %10 - %11 = load double, double* %a, align 8 + %11 = load double, ptr %a, align 8 %add2 = fadd fast double %add, %11 ret double %add2 } diff --git a/llvm/test/Transforms/SimplifyCFG/PowerPC/prefer-load-i32.ll b/llvm/test/Transforms/SimplifyCFG/PowerPC/prefer-load-i32.ll index 742cef5a9ded3f..d7a9389e3f5017 100644 --- a/llvm/test/Transforms/SimplifyCFG/PowerPC/prefer-load-i32.ll +++ b/llvm/test/Transforms/SimplifyCFG/PowerPC/prefer-load-i32.ll @@ -1,30 +1,30 @@ ; RUN: opt < %s -mtriple=powerpc64le-unknown-linux-gnu -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -S | FileCheck %s -define float @foo(float* %src, float* %dest, i32 signext %count, i32 signext %cond) { +define float @foo(ptr %src, ptr %dest, i32 signext %count, i32 signext %cond) { ; CHECK-LABEL: @foo( ; CHECK-LABEL: entry: ; CHECK-NOT: load float entry: %cmp = icmp sgt i32 %cond, 10 %idxprom = sext i32 %count to i64 - %arrayidx = getelementptr inbounds float, float* %src, i64 %idxprom + %arrayidx = getelementptr inbounds float, ptr %src, i64 %idxprom br i1 %cmp, label %if.then, label %if.else ; CHECK-LABEL: if.then: -; CHECK: %0 = load float, float* %arrayidx, align 4 +; CHECK: %0 = load float, ptr %arrayidx, align 4 if.then: ; preds = %entry - %0 = load float, float* %arrayidx, align 4 + %0 = load float, ptr %arrayidx, align 4 %res = fmul float %0, 3.000000e+00 br label %if.end ; CHECK-LABEL: if.else: -; CHECK: %1 = load float, float* %arrayidx, align 4 -; CHECK: store float %1, float* %arrayidx4, align 4 +; CHECK: %1 = load float, ptr %arrayidx, align 4 +; CHECK: store float %1, ptr %arrayidx4, align 4 if.else: ; preds = %entry - %1 = load float, float* %arrayidx, align 4 + %1 = load float, ptr %arrayidx, align 4 %idxprom3 = sext i32 %count to i64 - %arrayidx4 = getelementptr inbounds float, float* %dest, i64 %idxprom3 - store float %1, float* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds float, ptr %dest, i64 %idxprom3 + store float %1, ptr %arrayidx4, align 4 br label %if.end if.end: ; preds = %if.else, %if.then diff --git a/llvm/test/Transforms/SimplifyCFG/RISCV/switch_to_lookup_table-rv32.ll b/llvm/test/Transforms/SimplifyCFG/RISCV/switch_to_lookup_table-rv32.ll index ead70e5d4e7fc3..7bf4d35530b9a5 100644 --- a/llvm/test/Transforms/SimplifyCFG/RISCV/switch_to_lookup_table-rv32.ll +++ b/llvm/test/Transforms/SimplifyCFG/RISCV/switch_to_lookup_table-rv32.ll @@ -14,7 +14,7 @@ target triple = "riscv32-unknown-elf" ; CHECK: @switch.table.h = private unnamed_addr constant [4 x float] [float 0x40091EB860000000, float 0x3FF3BE76C0000000, float 0x4012449BA0000000, float 0x4001AE1480000000], align 4 ; The table for @foostring -; CHECK: @switch.table.foostring = private unnamed_addr constant [4 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str3, i64 0, i64 0)], align 4 +; CHECK: @switch.table.foostring = private unnamed_addr constant [4 x ptr] [ptr @.str, ptr @.str1, ptr @.str2, ptr @.str3], align 4 ; A simple int-to-int selection switch. ; It is dense enough to be replaced by table lookup. @@ -28,8 +28,8 @@ define i32 @f(i32 %c) { ; CHECK-NEXT: [[TMP0:%.*]] = icmp ult i32 [[SWITCH_TABLEIDX]], 7 ; CHECK-NEXT: br i1 [[TMP0]], label [[SWITCH_LOOKUP:%.*]], label [[RETURN:%.*]] ; CHECK: switch.lookup: -; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.f, i32 0, i32 [[SWITCH_TABLEIDX]] -; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load i32, i32* [[SWITCH_GEP]], align 4 +; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [7 x i32], ptr @switch.table.f, i32 0, i32 [[SWITCH_TABLEIDX]] +; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load i32, ptr [[SWITCH_GEP]], align 4 ; CHECK-NEXT: br label [[RETURN]] ; CHECK: return: ; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[SWITCH_LOAD]], [[SWITCH_LOOKUP]] ], [ 15, [[ENTRY:%.*]] ] @@ -68,8 +68,8 @@ define i8 @char(i32 %c) { ; CHECK-NEXT: [[TMP0:%.*]] = icmp ult i32 [[SWITCH_TABLEIDX]], 9 ; CHECK-NEXT: br i1 [[TMP0]], label [[SWITCH_LOOKUP:%.*]], label [[RETURN:%.*]] ; CHECK: switch.lookup: -; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [9 x i8], [9 x i8]* @switch.table.char, i32 0, i32 [[SWITCH_TABLEIDX]] -; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load i8, i8* [[SWITCH_GEP]], align 1 +; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [9 x i8], ptr @switch.table.char, i32 0, i32 [[SWITCH_TABLEIDX]] +; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load i8, ptr [[SWITCH_GEP]], align 1 ; CHECK-NEXT: br label [[RETURN]] ; CHECK: return: ; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i8 [ [[SWITCH_LOAD]], [[SWITCH_LOOKUP]] ], [ 15, [[ENTRY:%.*]] ] @@ -115,8 +115,8 @@ define void @h(i32 %x) { ; CHECK-NEXT: [[SWITCH_SHIFTAMT:%.*]] = mul i32 [[X]], 8 ; CHECK-NEXT: [[SWITCH_DOWNSHIFT:%.*]] = lshr i32 89655594, [[SWITCH_SHIFTAMT]] ; CHECK-NEXT: [[SWITCH_MASKED:%.*]] = trunc i32 [[SWITCH_DOWNSHIFT]] to i8 -; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [4 x float], [4 x float]* @switch.table.h, i32 0, i32 [[X]] -; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load float, float* [[SWITCH_GEP]], align 4 +; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [4 x float], ptr @switch.table.h, i32 0, i32 [[X]] +; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load float, ptr [[SWITCH_GEP]], align 4 ; CHECK-NEXT: br label [[SW_EPILOG]] ; CHECK: sw.epilog: ; CHECK-NEXT: [[A_0:%.*]] = phi i8 [ [[SWITCH_MASKED]], [[SWITCH_LOOKUP]] ], [ 7, [[ENTRY:%.*]] ] @@ -154,18 +154,18 @@ sw.epilog: @.str3 = private unnamed_addr constant [4 x i8] c"qux\00", align 1 @.str4 = private unnamed_addr constant [6 x i8] c"error\00", align 1 -define i8* @foostring(i32 %x) { +define ptr @foostring(i32 %x) { ; CHECK-LABEL: @foostring( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = icmp ult i32 [[X:%.*]], 4 ; CHECK-NEXT: br i1 [[TMP0]], label [[SWITCH_LOOKUP:%.*]], label [[RETURN:%.*]] ; CHECK: switch.lookup: -; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [4 x i8*], [4 x i8*]* @switch.table.foostring, i32 0, i32 [[X]] -; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load i8*, i8** [[SWITCH_GEP]], align 4 +; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [4 x ptr], ptr @switch.table.foostring, i32 0, i32 [[X]] +; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load ptr, ptr [[SWITCH_GEP]], align 4 ; CHECK-NEXT: br label [[RETURN]] ; CHECK: return: -; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i8* [ [[SWITCH_LOAD]], [[SWITCH_LOOKUP]] ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str4, i64 0, i64 0), [[ENTRY:%.*]] ] -; CHECK-NEXT: ret i8* [[RETVAL_0]] +; CHECK-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[SWITCH_LOAD]], [[SWITCH_LOOKUP]] ], [ @.str4, [[ENTRY:%.*]] ] +; CHECK-NEXT: ret ptr [[RETVAL_0]] ; entry: switch i32 %x, label %sw.default [ @@ -181,11 +181,11 @@ sw.bb3: br label %return sw.default: br label %return return: - %retval.0 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str4, i64 0, i64 0), %sw.default ], - [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str3, i64 0, i64 0), %sw.bb3 ], - [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str2, i64 0, i64 0), %sw.bb2 ], - [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str1, i64 0, i64 0), %sw.bb1 ], - [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %entry ] - ret i8* %retval.0 + %retval.0 = phi ptr [ @.str4, %sw.default ], + [ @.str3, %sw.bb3 ], + [ @.str2, %sw.bb2 ], + [ @.str1, %sw.bb1 ], + [ @.str, %entry ] + ret ptr %retval.0 } diff --git a/llvm/test/Transforms/SimplifyCFG/RISCV/switch_to_lookup_table-rv64.ll b/llvm/test/Transforms/SimplifyCFG/RISCV/switch_to_lookup_table-rv64.ll index 93324fee26ccbe..168e5188abff22 100644 --- a/llvm/test/Transforms/SimplifyCFG/RISCV/switch_to_lookup_table-rv64.ll +++ b/llvm/test/Transforms/SimplifyCFG/RISCV/switch_to_lookup_table-rv64.ll @@ -14,7 +14,7 @@ target triple = "riscv64-unknown-elf" ; CHECK: @switch.table.h = private unnamed_addr constant [4 x float] [float 0x40091EB860000000, float 0x3FF3BE76C0000000, float 0x4012449BA0000000, float 0x4001AE1480000000], align 4 ; The table for @foostring -; CHECK: @switch.table.foostring = private unnamed_addr constant [4 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str3, i64 0, i64 0)], align 8 +; CHECK: @switch.table.foostring = private unnamed_addr constant [4 x ptr] [ptr @.str, ptr @.str1, ptr @.str2, ptr @.str3], align 8 ; A simple int-to-int selection switch. ; It is dense enough to be replaced by table lookup. @@ -28,8 +28,8 @@ define i32 @f(i32 %c) { ; CHECK-NEXT: [[TMP0:%.*]] = icmp ult i32 [[SWITCH_TABLEIDX]], 7 ; CHECK-NEXT: br i1 [[TMP0]], label [[SWITCH_LOOKUP:%.*]], label [[RETURN:%.*]] ; CHECK: switch.lookup: -; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.f, i32 0, i32 [[SWITCH_TABLEIDX]] -; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load i32, i32* [[SWITCH_GEP]], align 4 +; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [7 x i32], ptr @switch.table.f, i32 0, i32 [[SWITCH_TABLEIDX]] +; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load i32, ptr [[SWITCH_GEP]], align 4 ; CHECK-NEXT: br label [[RETURN]] ; CHECK: return: ; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[SWITCH_LOAD]], [[SWITCH_LOOKUP]] ], [ 15, [[ENTRY:%.*]] ] @@ -68,8 +68,8 @@ define i8 @char(i32 %c) { ; CHECK-NEXT: [[TMP0:%.*]] = icmp ult i32 [[SWITCH_TABLEIDX]], 9 ; CHECK-NEXT: br i1 [[TMP0]], label [[SWITCH_LOOKUP:%.*]], label [[RETURN:%.*]] ; CHECK: switch.lookup: -; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [9 x i8], [9 x i8]* @switch.table.char, i32 0, i32 [[SWITCH_TABLEIDX]] -; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load i8, i8* [[SWITCH_GEP]], align 1 +; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [9 x i8], ptr @switch.table.char, i32 0, i32 [[SWITCH_TABLEIDX]] +; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load i8, ptr [[SWITCH_GEP]], align 1 ; CHECK-NEXT: br label [[RETURN]] ; CHECK: return: ; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i8 [ [[SWITCH_LOAD]], [[SWITCH_LOOKUP]] ], [ 15, [[ENTRY:%.*]] ] @@ -115,8 +115,8 @@ define void @h(i32 %x) { ; CHECK-NEXT: [[SWITCH_SHIFTAMT:%.*]] = mul i32 [[X]], 8 ; CHECK-NEXT: [[SWITCH_DOWNSHIFT:%.*]] = lshr i32 89655594, [[SWITCH_SHIFTAMT]] ; CHECK-NEXT: [[SWITCH_MASKED:%.*]] = trunc i32 [[SWITCH_DOWNSHIFT]] to i8 -; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [4 x float], [4 x float]* @switch.table.h, i32 0, i32 [[X]] -; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load float, float* [[SWITCH_GEP]], align 4 +; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [4 x float], ptr @switch.table.h, i32 0, i32 [[X]] +; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load float, ptr [[SWITCH_GEP]], align 4 ; CHECK-NEXT: br label [[SW_EPILOG]] ; CHECK: sw.epilog: ; CHECK-NEXT: [[A_0:%.*]] = phi i8 [ [[SWITCH_MASKED]], [[SWITCH_LOOKUP]] ], [ 7, [[ENTRY:%.*]] ] @@ -154,18 +154,18 @@ sw.epilog: @.str3 = private unnamed_addr constant [4 x i8] c"qux\00", align 1 @.str4 = private unnamed_addr constant [6 x i8] c"error\00", align 1 -define i8* @foostring(i32 %x) { +define ptr @foostring(i32 %x) { ; CHECK-LABEL: @foostring( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = icmp ult i32 [[X:%.*]], 4 ; CHECK-NEXT: br i1 [[TMP0]], label [[SWITCH_LOOKUP:%.*]], label [[RETURN:%.*]] ; CHECK: switch.lookup: -; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [4 x i8*], [4 x i8*]* @switch.table.foostring, i32 0, i32 [[X]] -; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load i8*, i8** [[SWITCH_GEP]], align 8 +; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [4 x ptr], ptr @switch.table.foostring, i32 0, i32 [[X]] +; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load ptr, ptr [[SWITCH_GEP]], align 8 ; CHECK-NEXT: br label [[RETURN]] ; CHECK: return: -; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i8* [ [[SWITCH_LOAD]], [[SWITCH_LOOKUP]] ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str4, i64 0, i64 0), [[ENTRY:%.*]] ] -; CHECK-NEXT: ret i8* [[RETVAL_0]] +; CHECK-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[SWITCH_LOAD]], [[SWITCH_LOOKUP]] ], [ @.str4, [[ENTRY:%.*]] ] +; CHECK-NEXT: ret ptr [[RETVAL_0]] ; entry: switch i32 %x, label %sw.default [ @@ -181,11 +181,11 @@ sw.bb3: br label %return sw.default: br label %return return: - %retval.0 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str4, i64 0, i64 0), %sw.default ], - [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str3, i64 0, i64 0), %sw.bb3 ], - [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str2, i64 0, i64 0), %sw.bb2 ], - [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str1, i64 0, i64 0), %sw.bb1 ], - [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %entry ] - ret i8* %retval.0 + %retval.0 = phi ptr [ @.str4, %sw.default ], + [ @.str3, %sw.bb3 ], + [ @.str2, %sw.bb2 ], + [ @.str1, %sw.bb1 ], + [ @.str, %entry ] + ret ptr %retval.0 } diff --git a/llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll b/llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll index 7e245392974f1c..a9fb464f7a09ba 100644 --- a/llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll +++ b/llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll @@ -1,7 +1,7 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s -define void @test1(i1 %C, i1* %BP) { +define void @test1(i1 %C, ptr %BP) { ; CHECK-LABEL: @test1( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = xor i1 [[C:%.*]], true @@ -11,13 +11,13 @@ define void @test1(i1 %C, i1* %BP) { entry: br i1 %C, label %T, label %F T: - store i1 %C, i1* %BP + store i1 %C, ptr %BP unreachable F: ret void } -define void @test2() personality i32 (...)* @__gxx_personality_v0 { +define void @test2() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @test2( ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @test2() @@ -27,7 +27,7 @@ entry: invoke void @test2( ) to label %N unwind label %U U: - %res = landingpad { i8* } + %res = landingpad { ptr } cleanup unreachable N: @@ -61,12 +61,12 @@ T: ;; unreachable control flow because of the undef store of null. Make sure we do ;; the latter. -define void @test5(i1 %cond, i8* %ptr) { +define void @test5(i1 %cond, ptr %ptr) { ; CHECK-LABEL: @test5( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = xor i1 [[COND:%.*]], true ; CHECK-NEXT: call void @llvm.assume(i1 [[TMP0]]) -; CHECK-NEXT: store i8 2, i8* [[PTR:%.*]], align 8 +; CHECK-NEXT: store i8 2, ptr [[PTR:%.*]], align 8 ; CHECK-NEXT: ret void ; entry: @@ -79,26 +79,25 @@ bb1: br label %bb2 bb2: - %ptr.2 = phi i8* [ %ptr, %bb3 ], [ null, %bb1 ] - store i8 2, i8* %ptr.2, align 8 + %ptr.2 = phi ptr [ %ptr, %bb3 ], [ null, %bb1 ] + store i8 2, ptr %ptr.2, align 8 ret void } declare void @llvm.assume(i1) -declare i1 @llvm.type.test(i8*, metadata) nounwind readnone +declare i1 @llvm.type.test(ptr, metadata) nounwind readnone ;; Same as the above test but make sure the unreachable control flow is still ;; removed in the presence of a type test / assume sequence. -define void @test5_type_test_assume(i1 %cond, i8* %ptr, [3 x i8*]* %vtable) { +define void @test5_type_test_assume(i1 %cond, ptr %ptr, ptr %vtable) { ; CHECK-LABEL: @test5_type_test_assume( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = xor i1 [[COND:%.*]], true ; CHECK-NEXT: call void @llvm.assume(i1 [[TMP0]]) -; CHECK-NEXT: [[VTABLEI8:%.*]] = bitcast [3 x i8*]* [[VTABLE:%.*]] to i8* -; CHECK-NEXT: [[P:%.*]] = call i1 @llvm.type.test(i8* [[VTABLEI8]], metadata !"foo") +; CHECK-NEXT: [[P:%.*]] = call i1 @llvm.type.test(ptr [[VTABLE:%.*]], metadata !"foo") ; CHECK-NEXT: tail call void @llvm.assume(i1 [[P]]) -; CHECK-NEXT: store i8 2, i8* [[PTR:%.*]], align 8 +; CHECK-NEXT: store i8 2, ptr [[PTR:%.*]], align 8 ; CHECK-NEXT: ret void ; entry: @@ -111,19 +110,18 @@ bb1: br label %bb2 bb2: - %ptr.2 = phi i8* [ %ptr, %bb3 ], [ null, %bb1 ] - %vtablei8 = bitcast [3 x i8*]* %vtable to i8* - %p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"foo") + %ptr.2 = phi ptr [ %ptr, %bb3 ], [ null, %bb1 ] + %p = call i1 @llvm.type.test(ptr %vtable, metadata !"foo") tail call void @llvm.assume(i1 %p) - store i8 2, i8* %ptr.2, align 8 + store i8 2, ptr %ptr.2, align 8 ret void } -define void @test5_no_null_opt(i1 %cond, i8* %ptr) #0 { +define void @test5_no_null_opt(i1 %cond, ptr %ptr) #0 { ; CHECK-LABEL: @test5_no_null_opt( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[DOTPTR:%.*]] = select i1 [[COND:%.*]], i8* null, i8* [[PTR:%.*]] -; CHECK-NEXT: store i8 2, i8* [[DOTPTR]], align 8 +; CHECK-NEXT: [[DOTPTR:%.*]] = select i1 [[COND:%.*]], ptr null, ptr [[PTR:%.*]] +; CHECK-NEXT: store i8 2, ptr [[DOTPTR]], align 8 ; CHECK-NEXT: ret void ; entry: @@ -136,17 +134,17 @@ bb1: br label %bb2 bb2: - %ptr.2 = phi i8* [ %ptr, %bb3 ], [ null, %bb1 ] - store i8 2, i8* %ptr.2, align 8 + %ptr.2 = phi ptr [ %ptr, %bb3 ], [ null, %bb1 ] + store i8 2, ptr %ptr.2, align 8 ret void } -define void @test6(i1 %cond, i8* %ptr) { +define void @test6(i1 %cond, ptr %ptr) { ; CHECK-LABEL: @test6( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = xor i1 [[COND:%.*]], true ; CHECK-NEXT: call void @llvm.assume(i1 [[TMP0]]) -; CHECK-NEXT: store i8 2, i8* [[PTR:%.*]], align 8 +; CHECK-NEXT: store i8 2, ptr [[PTR:%.*]], align 8 ; CHECK-NEXT: ret void ; entry: @@ -156,16 +154,16 @@ bb1: br label %bb2 bb2: - %ptr.2 = phi i8* [ %ptr, %entry ], [ null, %bb1 ] - store i8 2, i8* %ptr.2, align 8 + %ptr.2 = phi ptr [ %ptr, %entry ], [ null, %bb1 ] + store i8 2, ptr %ptr.2, align 8 ret void } -define void @test6_no_null_opt(i1 %cond, i8* %ptr) #0 { +define void @test6_no_null_opt(i1 %cond, ptr %ptr) #0 { ; CHECK-LABEL: @test6_no_null_opt( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[COND:%.*]], i8* null, i8* [[PTR:%.*]] -; CHECK-NEXT: store i8 2, i8* [[SPEC_SELECT]], align 8 +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[COND:%.*]], ptr null, ptr [[PTR:%.*]] +; CHECK-NEXT: store i8 2, ptr [[SPEC_SELECT]], align 8 ; CHECK-NEXT: ret void ; entry: @@ -175,8 +173,8 @@ bb1: br label %bb2 bb2: - %ptr.2 = phi i8* [ %ptr, %entry ], [ null, %bb1 ] - store i8 2, i8* %ptr.2, align 8 + %ptr.2 = phi ptr [ %ptr, %entry ], [ null, %bb1 ] + store i8 2, ptr %ptr.2, align 8 ret void } @@ -200,7 +198,7 @@ else: ret i32 %phi } -define void @test8(i1 %X, void ()* %Y) { +define void @test8(i1 %X, ptr %Y) { ; CHECK-LABEL: @test8( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = xor i1 [[X:%.*]], true @@ -215,15 +213,15 @@ if: br label %else else: - %phi = phi void ()* [ %Y, %entry ], [ null, %if ] + %phi = phi ptr [ %Y, %entry ], [ null, %if ] call void %phi() ret void } -define void @test8_no_null_opt(i1 %X, void ()* %Y) #0 { +define void @test8_no_null_opt(i1 %X, ptr %Y) #0 { ; CHECK-LABEL: @test8_no_null_opt( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], void ()* null, void ()* [[Y:%.*]] +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], ptr null, ptr [[Y:%.*]] ; CHECK-NEXT: call void [[SPEC_SELECT]]() ; CHECK-NEXT: ret void ; @@ -234,23 +232,23 @@ if: br label %else else: - %phi = phi void ()* [ %Y, %entry ], [ null, %if ] + %phi = phi ptr [ %Y, %entry ], [ null, %if ] call void %phi() ret void } -declare i8* @fn_nonnull_noundef_arg(i8* nonnull noundef %p) -declare i8* @fn_nonnull_deref_arg(i8* nonnull dereferenceable(4) %p) -declare i8* @fn_nonnull_deref_or_null_arg(i8* nonnull dereferenceable_or_null(4) %p) -declare i8* @fn_nonnull_arg(i8* nonnull %p) -declare i8* @fn_noundef_arg(i8* noundef %p) +declare ptr @fn_nonnull_noundef_arg(ptr nonnull noundef %p) +declare ptr @fn_nonnull_deref_arg(ptr nonnull dereferenceable(4) %p) +declare ptr @fn_nonnull_deref_or_null_arg(ptr nonnull dereferenceable_or_null(4) %p) +declare ptr @fn_nonnull_arg(ptr nonnull %p) +declare ptr @fn_noundef_arg(ptr noundef %p) -define void @test9(i1 %X, i8* %Y) { +define void @test9(i1 %X, ptr %Y) { ; CHECK-LABEL: @test9( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = xor i1 [[X:%.*]], true ; CHECK-NEXT: call void @llvm.assume(i1 [[TMP0]]) -; CHECK-NEXT: [[TMP1:%.*]] = call i8* @fn_nonnull_noundef_arg(i8* [[Y:%.*]]) +; CHECK-NEXT: [[TMP1:%.*]] = call ptr @fn_nonnull_noundef_arg(ptr [[Y:%.*]]) ; CHECK-NEXT: ret void ; entry: @@ -260,18 +258,18 @@ if: br label %else else: - %phi = phi i8* [ %Y, %entry ], [ null, %if ] - call i8* @fn_nonnull_noundef_arg(i8* %phi) + %phi = phi ptr [ %Y, %entry ], [ null, %if ] + call ptr @fn_nonnull_noundef_arg(ptr %phi) ret void } ; Optimizing this code should produce assume. -define void @test9_deref(i1 %X, i8* %Y) { +define void @test9_deref(i1 %X, ptr %Y) { ; CHECK-LABEL: @test9_deref( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = xor i1 [[X:%.*]], true ; CHECK-NEXT: call void @llvm.assume(i1 [[TMP0]]) -; CHECK-NEXT: [[TMP1:%.*]] = call i8* @fn_nonnull_deref_arg(i8* [[Y:%.*]]) +; CHECK-NEXT: [[TMP1:%.*]] = call ptr @fn_nonnull_deref_arg(ptr [[Y:%.*]]) ; CHECK-NEXT: ret void ; entry: @@ -281,18 +279,18 @@ if: br label %else else: - %phi = phi i8* [ %Y, %entry ], [ null, %if ] - call i8* @fn_nonnull_deref_arg(i8* %phi) + %phi = phi ptr [ %Y, %entry ], [ null, %if ] + call ptr @fn_nonnull_deref_arg(ptr %phi) ret void } ; Optimizing this code should produce assume. -define void @test9_deref_or_null(i1 %X, i8* %Y) { +define void @test9_deref_or_null(i1 %X, ptr %Y) { ; CHECK-LABEL: @test9_deref_or_null( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = xor i1 [[X:%.*]], true ; CHECK-NEXT: call void @llvm.assume(i1 [[TMP0]]) -; CHECK-NEXT: [[TMP1:%.*]] = call i8* @fn_nonnull_deref_or_null_arg(i8* [[Y:%.*]]) +; CHECK-NEXT: [[TMP1:%.*]] = call ptr @fn_nonnull_deref_or_null_arg(ptr [[Y:%.*]]) ; CHECK-NEXT: ret void ; entry: @@ -302,15 +300,15 @@ if: br label %else else: - %phi = phi i8* [ %Y, %entry ], [ null, %if ] - call i8* @fn_nonnull_deref_or_null_arg(i8* %phi) + %phi = phi ptr [ %Y, %entry ], [ null, %if ] + call ptr @fn_nonnull_deref_or_null_arg(ptr %phi) ret void } -define void @test9_undef(i1 %X, i8* %Y) { +define void @test9_undef(i1 %X, ptr %Y) { ; CHECK-LABEL: @test9_undef( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[TMP0:%.*]] = call i8* @fn_noundef_arg(i8* [[Y:%.*]]) +; CHECK-NEXT: [[TMP0:%.*]] = call ptr @fn_noundef_arg(ptr [[Y:%.*]]) ; CHECK-NEXT: ret void ; entry: @@ -320,15 +318,15 @@ if: br label %else else: - %phi = phi i8* [ %Y, %entry ], [ undef, %if ] - call i8* @fn_noundef_arg(i8* %phi) + %phi = phi ptr [ %Y, %entry ], [ undef, %if ] + call ptr @fn_noundef_arg(ptr %phi) ret void } -define void @test9_undef_null_defined(i1 %X, i8* %Y) #0 { +define void @test9_undef_null_defined(i1 %X, ptr %Y) #0 { ; CHECK-LABEL: @test9_undef_null_defined( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[TMP0:%.*]] = call i8* @fn_noundef_arg(i8* [[Y:%.*]]) +; CHECK-NEXT: [[TMP0:%.*]] = call ptr @fn_noundef_arg(ptr [[Y:%.*]]) ; CHECK-NEXT: ret void ; entry: @@ -338,17 +336,17 @@ if: br label %else else: - %phi = phi i8* [ %Y, %entry ], [ undef, %if ] - call i8* @fn_noundef_arg(i8* %phi) + %phi = phi ptr [ %Y, %entry ], [ undef, %if ] + call ptr @fn_noundef_arg(ptr %phi) ret void } -define void @test9_null_callsite(i1 %X, i8* %Y) { +define void @test9_null_callsite(i1 %X, ptr %Y) { ; CHECK-LABEL: @test9_null_callsite( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = xor i1 [[X:%.*]], true ; CHECK-NEXT: call void @llvm.assume(i1 [[TMP0]]) -; CHECK-NEXT: [[TMP1:%.*]] = call i8* @fn_nonnull_arg(i8* noundef nonnull [[Y:%.*]]) +; CHECK-NEXT: [[TMP1:%.*]] = call ptr @fn_nonnull_arg(ptr noundef nonnull [[Y:%.*]]) ; CHECK-NEXT: ret void ; entry: @@ -358,17 +356,16 @@ if: br label %else else: - %phi = phi i8* [ %Y, %entry ], [ null, %if ] - call i8* @fn_nonnull_arg(i8* nonnull noundef %phi) + %phi = phi ptr [ %Y, %entry ], [ null, %if ] + call ptr @fn_nonnull_arg(ptr nonnull noundef %phi) ret void } -define void @test9_gep_mismatch(i1 %X, i8* %Y, i8* %P) { +define void @test9_gep_mismatch(i1 %X, ptr %Y, ptr %P) { ; CHECK-LABEL: @test9_gep_mismatch( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], i8* null, i8* [[Y:%.*]] -; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i8, i8* [[P:%.*]], i64 0 -; CHECK-NEXT: [[TMP0:%.*]] = call i8* @fn_nonnull_noundef_arg(i8* [[GEP]]) +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], ptr null, ptr [[Y:%.*]] +; CHECK-NEXT: [[TMP0:%.*]] = call ptr @fn_nonnull_noundef_arg(ptr [[P:%.*]]) ; CHECK-NEXT: ret void ; entry: @@ -378,19 +375,17 @@ if: br label %else else: - %phi = phi i8* [ %Y, %entry ], [ null, %if ] - %gep = getelementptr inbounds i8, i8* %P, i64 0 - call i8* @fn_nonnull_noundef_arg(i8* %gep) + %phi = phi ptr [ %Y, %entry ], [ null, %if ] + call ptr @fn_nonnull_noundef_arg(ptr %P) ret void } -define void @test9_gep_zero(i1 %X, i8* %Y) { +define void @test9_gep_zero(i1 %X, ptr %Y) { ; CHECK-LABEL: @test9_gep_zero( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = xor i1 [[X:%.*]], true ; CHECK-NEXT: call void @llvm.assume(i1 [[TMP0]]) -; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i8, i8* [[Y:%.*]], i64 0 -; CHECK-NEXT: [[TMP1:%.*]] = call i8* @fn_nonnull_noundef_arg(i8* [[GEP]]) +; CHECK-NEXT: [[TMP1:%.*]] = call ptr @fn_nonnull_noundef_arg(ptr [[Y:%.*]]) ; CHECK-NEXT: ret void ; entry: @@ -400,20 +395,17 @@ if: br label %else else: - %phi = phi i8* [ %Y, %entry ], [ null, %if ] - %gep = getelementptr inbounds i8, i8* %phi, i64 0 - call i8* @fn_nonnull_noundef_arg(i8* %gep) + %phi = phi ptr [ %Y, %entry ], [ null, %if ] + call ptr @fn_nonnull_noundef_arg(ptr %phi) ret void } -define void @test9_gep_bitcast(i1 %X, i32* %Y) { +define void @test9_gep_bitcast(i1 %X, ptr %Y) { ; CHECK-LABEL: @test9_gep_bitcast( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = xor i1 [[X:%.*]], true ; CHECK-NEXT: call void @llvm.assume(i1 [[TMP0]]) -; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i32, i32* [[Y:%.*]], i64 0 -; CHECK-NEXT: [[BC:%.*]] = bitcast i32* [[GEP]] to i8* -; CHECK-NEXT: [[TMP1:%.*]] = call i8* @fn_nonnull_noundef_arg(i8* [[BC]]) +; CHECK-NEXT: [[TMP1:%.*]] = call ptr @fn_nonnull_noundef_arg(ptr [[Y:%.*]]) ; CHECK-NEXT: ret void ; entry: @@ -423,19 +415,17 @@ if: br label %else else: - %phi = phi i32* [ %Y, %entry ], [ null, %if ] - %gep = getelementptr inbounds i32, i32* %phi, i64 0 - %bc = bitcast i32* %gep to i8* - call i8* @fn_nonnull_noundef_arg(i8* %bc) + %phi = phi ptr [ %Y, %entry ], [ null, %if ] + call ptr @fn_nonnull_noundef_arg(ptr %phi) ret void } -define void @test9_gep_nonzero(i1 %X, i8* %Y) { +define void @test9_gep_nonzero(i1 %X, ptr %Y) { ; CHECK-LABEL: @test9_gep_nonzero( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], i8* null, i8* [[Y:%.*]] -; CHECK-NEXT: [[GEP:%.*]] = getelementptr i8, i8* [[SPEC_SELECT]], i64 12 -; CHECK-NEXT: [[TMP0:%.*]] = call i8* @fn_nonnull_noundef_arg(i8* [[GEP]]) +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], ptr null, ptr [[Y:%.*]] +; CHECK-NEXT: [[GEP:%.*]] = getelementptr i8, ptr [[SPEC_SELECT]], i64 12 +; CHECK-NEXT: [[TMP0:%.*]] = call ptr @fn_nonnull_noundef_arg(ptr [[GEP]]) ; CHECK-NEXT: ret void ; entry: @@ -445,18 +435,18 @@ if: br label %else else: - %phi = phi i8* [ %Y, %entry ], [ null, %if ] - %gep = getelementptr i8, i8* %phi, i64 12 - call i8* @fn_nonnull_noundef_arg(i8* %gep) + %phi = phi ptr [ %Y, %entry ], [ null, %if ] + %gep = getelementptr i8, ptr %phi, i64 12 + call ptr @fn_nonnull_noundef_arg(ptr %gep) ret void } -define void @test9_gep_inbounds_nonzero(i1 %X, i8* %Y) { +define void @test9_gep_inbounds_nonzero(i1 %X, ptr %Y) { ; CHECK-LABEL: @test9_gep_inbounds_nonzero( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], i8* null, i8* [[Y:%.*]] -; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i8, i8* [[SPEC_SELECT]], i64 12 -; CHECK-NEXT: [[TMP0:%.*]] = call i8* @fn_nonnull_noundef_arg(i8* [[GEP]]) +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], ptr null, ptr [[Y:%.*]] +; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i8, ptr [[SPEC_SELECT]], i64 12 +; CHECK-NEXT: [[TMP0:%.*]] = call ptr @fn_nonnull_noundef_arg(ptr [[GEP]]) ; CHECK-NEXT: ret void ; entry: @@ -466,19 +456,19 @@ if: br label %else else: - %phi = phi i8* [ %Y, %entry ], [ null, %if ] - %gep = getelementptr inbounds i8, i8* %phi, i64 12 - call i8* @fn_nonnull_noundef_arg(i8* %gep) + %phi = phi ptr [ %Y, %entry ], [ null, %if ] + %gep = getelementptr inbounds i8, ptr %phi, i64 12 + call ptr @fn_nonnull_noundef_arg(ptr %gep) ret void } -define void @test9_gep_inbouds_unknown_null(i1 %X, i8* %Y, i64 %I) { +define void @test9_gep_inbouds_unknown_null(i1 %X, ptr %Y, i64 %I) { ; CHECK-LABEL: @test9_gep_inbouds_unknown_null( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], i8* null, i8* [[Y:%.*]] -; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i8, i8* [[SPEC_SELECT]], i64 [[I:%.*]] -; CHECK-NEXT: [[TMP0:%.*]] = call i8* @fn_nonnull_noundef_arg(i8* [[GEP]]) +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], ptr null, ptr [[Y:%.*]] +; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i8, ptr [[SPEC_SELECT]], i64 [[I:%.*]] +; CHECK-NEXT: [[TMP0:%.*]] = call ptr @fn_nonnull_noundef_arg(ptr [[GEP]]) ; CHECK-NEXT: ret void ; entry: @@ -488,18 +478,18 @@ if: br label %else else: - %phi = phi i8* [ %Y, %entry ], [ null, %if ] - %gep = getelementptr inbounds i8, i8* %phi, i64 %I - call i8* @fn_nonnull_noundef_arg(i8* %gep) + %phi = phi ptr [ %Y, %entry ], [ null, %if ] + %gep = getelementptr inbounds i8, ptr %phi, i64 %I + call ptr @fn_nonnull_noundef_arg(ptr %gep) ret void } -define void @test9_gep_unknown_null(i1 %X, i8* %Y, i64 %I) { +define void @test9_gep_unknown_null(i1 %X, ptr %Y, i64 %I) { ; CHECK-LABEL: @test9_gep_unknown_null( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], i8* null, i8* [[Y:%.*]] -; CHECK-NEXT: [[GEP:%.*]] = getelementptr i8, i8* [[SPEC_SELECT]], i64 [[I:%.*]] -; CHECK-NEXT: [[TMP0:%.*]] = call i8* @fn_nonnull_noundef_arg(i8* [[GEP]]) +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], ptr null, ptr [[Y:%.*]] +; CHECK-NEXT: [[GEP:%.*]] = getelementptr i8, ptr [[SPEC_SELECT]], i64 [[I:%.*]] +; CHECK-NEXT: [[TMP0:%.*]] = call ptr @fn_nonnull_noundef_arg(ptr [[GEP]]) ; CHECK-NEXT: ret void ; entry: @@ -509,17 +499,17 @@ if: br label %else else: - %phi = phi i8* [ %Y, %entry ], [ null, %if ] - %gep = getelementptr i8, i8* %phi, i64 %I - call i8* @fn_nonnull_noundef_arg(i8* %gep) + %phi = phi ptr [ %Y, %entry ], [ null, %if ] + %gep = getelementptr i8, ptr %phi, i64 %I + call ptr @fn_nonnull_noundef_arg(ptr %gep) ret void } -define void @test9_gep_unknown_undef(i1 %X, i8* %Y, i64 %I) { +define void @test9_gep_unknown_undef(i1 %X, ptr %Y, i64 %I) { ; CHECK-LABEL: @test9_gep_unknown_undef( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[GEP:%.*]] = getelementptr i8, i8* [[Y:%.*]], i64 [[I:%.*]] -; CHECK-NEXT: [[TMP0:%.*]] = call i8* @fn_noundef_arg(i8* [[GEP]]) +; CHECK-NEXT: [[GEP:%.*]] = getelementptr i8, ptr [[Y:%.*]], i64 [[I:%.*]] +; CHECK-NEXT: [[TMP0:%.*]] = call ptr @fn_noundef_arg(ptr [[GEP]]) ; CHECK-NEXT: ret void ; entry: @@ -529,17 +519,17 @@ if: br label %else else: - %phi = phi i8* [ %Y, %entry ], [ undef, %if ] - %gep = getelementptr i8, i8* %phi, i64 %I - call i8* @fn_noundef_arg(i8* %gep) + %phi = phi ptr [ %Y, %entry ], [ undef, %if ] + %gep = getelementptr i8, ptr %phi, i64 %I + call ptr @fn_noundef_arg(ptr %gep) ret void } -define void @test9_missing_noundef(i1 %X, i8* %Y) { +define void @test9_missing_noundef(i1 %X, ptr %Y) { ; CHECK-LABEL: @test9_missing_noundef( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], i8* null, i8* [[Y:%.*]] -; CHECK-NEXT: [[TMP0:%.*]] = call i8* @fn_nonnull_arg(i8* [[SPEC_SELECT]]) +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], ptr null, ptr [[Y:%.*]] +; CHECK-NEXT: [[TMP0:%.*]] = call ptr @fn_nonnull_arg(ptr [[SPEC_SELECT]]) ; CHECK-NEXT: ret void ; entry: @@ -549,16 +539,16 @@ if: br label %else else: - %phi = phi i8* [ %Y, %entry ], [ null, %if ] - call i8* @fn_nonnull_arg(i8* %phi) + %phi = phi ptr [ %Y, %entry ], [ null, %if ] + call ptr @fn_nonnull_arg(ptr %phi) ret void } -define void @test9_null_defined(i1 %X, i8* %Y) #0 { +define void @test9_null_defined(i1 %X, ptr %Y) #0 { ; CHECK-LABEL: @test9_null_defined( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], i8* null, i8* [[Y:%.*]] -; CHECK-NEXT: [[TMP0:%.*]] = call i8* @fn_nonnull_noundef_arg(i8* [[SPEC_SELECT]]) +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[X:%.*]], ptr null, ptr [[Y:%.*]] +; CHECK-NEXT: [[TMP0:%.*]] = call ptr @fn_nonnull_noundef_arg(ptr [[SPEC_SELECT]]) ; CHECK-NEXT: ret void ; entry: @@ -568,8 +558,8 @@ if: br label %else else: - %phi = phi i8* [ %Y, %entry ], [ null, %if ] - call i8* @fn_nonnull_noundef_arg(i8* %phi) + %phi = phi ptr [ %Y, %entry ], [ null, %if ] + call ptr @fn_nonnull_noundef_arg(ptr %phi) ret void } diff --git a/llvm/test/Transforms/SimplifyCFG/X86/2010-03-30-InvokeCrash.ll b/llvm/test/Transforms/SimplifyCFG/X86/2010-03-30-InvokeCrash.ll index 29f74e49b56538..5305d31f498d2f 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/2010-03-30-InvokeCrash.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/2010-03-30-InvokeCrash.ll @@ -5,7 +5,7 @@ target triple = "x86_64-unknown-linux-gnu" declare void @bar(i32) -define void @foo() personality i32 (...)* @__gxx_personality_v0 { +define void @foo() personality ptr @__gxx_personality_v0 { entry: invoke void @bar(i32 undef) to label %r unwind label %u @@ -14,9 +14,9 @@ r: ; preds = %entry ret void u: ; preds = %entry - %val = landingpad { i8*, i32 } + %val = landingpad { ptr, i32 } cleanup - resume { i8*, i32 } %val + resume { ptr, i32 } %val } declare i32 @__gxx_personality_v0(...) diff --git a/llvm/test/Transforms/SimplifyCFG/X86/MagicPointer.ll b/llvm/test/Transforms/SimplifyCFG/X86/MagicPointer.ll index 72acb2328a3403..413406f921be6f 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/MagicPointer.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/MagicPointer.ll @@ -5,20 +5,20 @@ target datalayout = "e-p:64:64:64-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple = "x86_64-apple-darwin10.0.0" -@.str = private constant [5 x i8] c"null\00" ; <[5 x i8]*> [#uses=2] -@.str1 = private constant [4 x i8] c"one\00" ; <[4 x i8]*> [#uses=2] -@.str2 = private constant [4 x i8] c"two\00" ; <[4 x i8]*> [#uses=2] -@.str3 = private constant [5 x i8] c"four\00" ; <[5 x i8]*> [#uses=2] +@.str = private constant [5 x i8] c"null\00" ; [#uses=2] +@.str1 = private constant [4 x i8] c"one\00" ; [#uses=2] +@.str2 = private constant [4 x i8] c"two\00" ; [#uses=2] +@.str3 = private constant [5 x i8] c"four\00" ; [#uses=2] -@.str_as1 = private addrspace(1) constant [5 x i8] c"null\00" ; <[5 x i8]*> [#uses=2] -@.str1_as1 = private addrspace(1) constant [4 x i8] c"one\00" ; <[4 x i8]*> [#uses=2] -@.str2_as1 = private addrspace(1) constant [4 x i8] c"two\00" ; <[4 x i8]*> [#uses=2] -@.str3_as1 = private addrspace(1) constant [5 x i8] c"four\00" ; <[5 x i8]*> [#uses=2] +@.str_as1 = private addrspace(1) constant [5 x i8] c"null\00" ; [#uses=2] +@.str1_as1 = private addrspace(1) constant [4 x i8] c"one\00" ; [#uses=2] +@.str2_as1 = private addrspace(1) constant [4 x i8] c"two\00" ; [#uses=2] +@.str3_as1 = private addrspace(1) constant [5 x i8] c"four\00" ; [#uses=2] -declare i32 @puts(i8*) -declare i32 @puts_as1(i8 addrspace(1)*) +declare i32 @puts(ptr) +declare i32 @puts_as1(ptr addrspace(1)) -define void @f(i8* %x) nounwind ssp { +define void @f(ptr %x) nounwind ssp { ; CHECK-LABEL: @f( ; CHECK: switch i64 %magicptr ; CHECK: i64 0, label @@ -29,43 +29,43 @@ define void @f(i8* %x) nounwind ssp { ; CHECK: } entry: - %tobool = icmp eq i8* %x, null ; [#uses=1] + %tobool = icmp eq ptr %x, null ; [#uses=1] br i1 %tobool, label %if.then, label %if.else if.then: ; preds = %entry - %call = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)) nounwind ; [#uses=0] + %call = call i32 @puts(ptr @.str) nounwind ; [#uses=0] br label %if.end21 if.else: ; preds = %entry - %cmp = icmp eq i8* %x, inttoptr (i64 1 to i8*) ; [#uses=1] + %cmp = icmp eq ptr %x, inttoptr (i64 1 to ptr) ; [#uses=1] br i1 %cmp, label %if.then2, label %if.else4 if.then2: ; preds = %if.else - %call3 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str1, i64 0, i64 0)) nounwind ; [#uses=0] + %call3 = call i32 @puts(ptr @.str1) nounwind ; [#uses=0] br label %if.end20 if.else4: ; preds = %if.else - %cmp6 = icmp eq i8* %x, inttoptr (i64 2 to i8*) ; [#uses=1] + %cmp6 = icmp eq ptr %x, inttoptr (i64 2 to ptr) ; [#uses=1] br i1 %cmp6, label %if.then9, label %lor.lhs.false lor.lhs.false: ; preds = %if.else4 - %cmp8 = icmp eq i8* %x, inttoptr (i64 3 to i8*) ; [#uses=1] + %cmp8 = icmp eq ptr %x, inttoptr (i64 3 to ptr) ; [#uses=1] br i1 %cmp8, label %if.then9, label %if.else11 if.then9: ; preds = %lor.lhs.false, %if.else4 - %call10 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str2, i64 0, i64 0)) nounwind ; [#uses=0] + %call10 = call i32 @puts(ptr @.str2) nounwind ; [#uses=0] br label %if.end19 if.else11: ; preds = %lor.lhs.false - %cmp13 = icmp eq i8* %x, inttoptr (i64 4 to i8*) ; [#uses=1] + %cmp13 = icmp eq ptr %x, inttoptr (i64 4 to ptr) ; [#uses=1] br i1 %cmp13, label %if.then14, label %if.else16 if.then14: ; preds = %if.else11 - %call15 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str3, i64 0, i64 0)) nounwind ; [#uses=0] + %call15 = call i32 @puts(ptr @.str3) nounwind ; [#uses=0] br label %if.end if.else16: ; preds = %if.else11 - %call18 = call i32 @puts(i8* %x) nounwind ; [#uses=0] + %call18 = call i32 @puts(ptr %x) nounwind ; [#uses=0] br label %if.end if.end: ; preds = %if.else16, %if.then14 @@ -83,9 +83,9 @@ if.end21: ; preds = %if.end20, %if.then ; Is it useful to test a version where the ptrtoints are to the same ; size? -define void @f_as1(i8 addrspace(1)* %x) nounwind ssp { +define void @f_as1(ptr addrspace(1) %x) nounwind ssp { ; CHECK-LABEL: @f_as1( -; CHECK: ptrtoint i8 addrspace(1)* %x to i16 +; CHECK: ptrtoint ptr addrspace(1) %x to i16 ; CHECK: switch i16 %magicptr ; CHECK: i16 0, label ; CHECK: i16 1, label @@ -95,43 +95,43 @@ define void @f_as1(i8 addrspace(1)* %x) nounwind ssp { ; CHECK: } entry: - %tobool = icmp eq i8 addrspace(1)* %x, null ; [#uses=1] + %tobool = icmp eq ptr addrspace(1) %x, null ; [#uses=1] br i1 %tobool, label %if.then, label %if.else if.then: ; preds = %entry - %call = call i32 @puts_as1(i8 addrspace(1)* getelementptr inbounds ([5 x i8], [5 x i8] addrspace(1)* @.str_as1, i64 0, i64 0)) nounwind ; [#uses=0] + %call = call i32 @puts_as1(ptr addrspace(1) @.str_as1) nounwind ; [#uses=0] br label %if.end21 if.else: ; preds = %entry - %cmp = icmp eq i8 addrspace(1)* %x, inttoptr (i64 1 to i8 addrspace(1)*) ; [#uses=1] + %cmp = icmp eq ptr addrspace(1) %x, inttoptr (i64 1 to ptr addrspace(1)) ; [#uses=1] br i1 %cmp, label %if.then2, label %if.else4 if.then2: ; preds = %if.else - %call3 = call i32 @puts_as1(i8 addrspace(1)* getelementptr inbounds ([4 x i8], [4 x i8] addrspace(1)* @.str1_as1, i64 0, i64 0)) nounwind ; [#uses=0] + %call3 = call i32 @puts_as1(ptr addrspace(1) @.str1_as1) nounwind ; [#uses=0] br label %if.end20 if.else4: ; preds = %if.else - %cmp6 = icmp eq i8 addrspace(1)* %x, inttoptr (i64 2 to i8 addrspace(1)*) ; [#uses=1] + %cmp6 = icmp eq ptr addrspace(1) %x, inttoptr (i64 2 to ptr addrspace(1)) ; [#uses=1] br i1 %cmp6, label %if.then9, label %lor.lhs.false lor.lhs.false: ; preds = %if.else4 - %cmp8 = icmp eq i8 addrspace(1)* %x, inttoptr (i64 3 to i8 addrspace(1)*) ; [#uses=1] + %cmp8 = icmp eq ptr addrspace(1) %x, inttoptr (i64 3 to ptr addrspace(1)) ; [#uses=1] br i1 %cmp8, label %if.then9, label %if.else11 if.then9: ; preds = %lor.lhs.false, %if.else4 - %call10 = call i32 @puts_as1(i8 addrspace(1)* getelementptr inbounds ([4 x i8], [4 x i8] addrspace(1)* @.str2_as1, i64 0, i64 0)) nounwind ; [#uses=0] + %call10 = call i32 @puts_as1(ptr addrspace(1) @.str2_as1) nounwind ; [#uses=0] br label %if.end19 if.else11: ; preds = %lor.lhs.false - %cmp13 = icmp eq i8 addrspace(1)* %x, inttoptr (i64 4 to i8 addrspace(1)*) ; [#uses=1] + %cmp13 = icmp eq ptr addrspace(1) %x, inttoptr (i64 4 to ptr addrspace(1)) ; [#uses=1] br i1 %cmp13, label %if.then14, label %if.else16 if.then14: ; preds = %if.else11 - %call15 = call i32 @puts_as1(i8 addrspace(1)* getelementptr inbounds ([5 x i8], [5 x i8] addrspace(1)* @.str3_as1, i64 0, i64 0)) nounwind ; [#uses=0] + %call15 = call i32 @puts_as1(ptr addrspace(1) @.str3_as1) nounwind ; [#uses=0] br label %if.end if.else16: ; preds = %if.else11 - %call18 = call i32 @puts_as1(i8 addrspace(1)* %x) nounwind ; [#uses=0] + %call18 = call i32 @puts_as1(ptr addrspace(1) %x) nounwind ; [#uses=0] br label %if.end if.end: ; preds = %if.else16, %if.then14 diff --git a/llvm/test/Transforms/SimplifyCFG/X86/PR29163.ll b/llvm/test/Transforms/SimplifyCFG/X86/PR29163.ll index fa3349d50b2c26..c47c655d641564 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/PR29163.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/PR29163.ll @@ -2,30 +2,28 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" -@GV = external constant i64* +@GV = external constant ptr -define i64* @test1(i1 %cond, i8* %P) { +define ptr @test1(i1 %cond, ptr %P) { entry: br i1 %cond, label %if, label %then then: - %bc = bitcast i8* %P to i64* br label %join if: - %load = load i64*, i64** @GV, align 8, !dereferenceable !0 + %load = load ptr, ptr @GV, align 8, !dereferenceable !0 br label %join join: - %phi = phi i64* [ %bc, %then ], [ %load, %if ] - ret i64* %phi + %phi = phi ptr [ %P, %then ], [ %load, %if ] + ret ptr %phi } -; CHECK-LABEL: define i64* @test1( -; CHECK: %[[bc:.*]] = bitcast i8* %P to i64* -; CHECK: %[[load:.*]] = load i64*, i64** @GV, align 8{{$}} -; CHECK: %[[phi:.*]] = select i1 %cond, i64* %[[load]], i64* %[[bc]] -; CHECK: ret i64* %[[phi]] +; CHECK-LABEL: define ptr @test1( +; CHECK: %[[load:.*]] = load ptr, ptr @GV, align 8{{$}} +; CHECK: %[[phi:.*]] = select i1 %cond, ptr %[[load]], ptr %P +; CHECK: ret ptr %[[phi]] !0 = !{i64 8} diff --git a/llvm/test/Transforms/SimplifyCFG/X86/PR30210.ll b/llvm/test/Transforms/SimplifyCFG/X86/PR30210.ll index e6e307c6d17e1b..8c04399cdf07f8 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/PR30210.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/PR30210.ll @@ -3,7 +3,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" -declare i32* @fn1(i32* returned) +declare ptr @fn1(ptr returned) define i32 @test1(i1 %B) { ; CHECK-LABEL: @test1( @@ -27,14 +27,14 @@ for.cond4.preheader.split.us: ; preds = %for.cond4.preheader unreachable for.cond4: ; preds = %for.end, %for.cond4.preheader - %phi = phi i32* [ %call, %for.end ], [ undef, %for.cond4.preheader ] - %call = call i32* @fn1(i32* %phi) + %phi = phi ptr [ %call, %for.end ], [ undef, %for.cond4.preheader ] + %call = call ptr @fn1(ptr %phi) br label %for.cond5 for.cond5: ; preds = %for.cond5, %for.cond4 br i1 %B, label %for.cond5, label %for.end for.end: ; preds = %for.cond5 - %load = load i32, i32* %call, align 4 + %load = load i32, ptr %call, align 4 br label %for.cond4 } diff --git a/llvm/test/Transforms/SimplifyCFG/X86/SpeculativeExec.ll b/llvm/test/Transforms/SimplifyCFG/X86/SpeculativeExec.ll index 48db457460d1c0..44797074388c3c 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/SpeculativeExec.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/SpeculativeExec.ll @@ -64,68 +64,68 @@ bb3: ret float %t5 } -define i8* @test4(i1* %dummy, i8* %a, i8* %b) { +define ptr @test4(ptr %dummy, ptr %a, ptr %b) { ; Test that we don't speculate an arbitrarily large number of unfolded constant ; expressions. ; CHECK-LABEL: @test4( ; CHECK-NEXT: entry: -; CHECK-NEXT: [[COND1:%.*]] = load volatile i1, i1* [[DUMMY:%.*]], align 1 +; CHECK-NEXT: [[COND1:%.*]] = load volatile i1, ptr [[DUMMY:%.*]], align 1 ; CHECK-NEXT: br i1 [[COND1]], label [[IF:%.*]], label [[END:%.*]] ; CHECK: if: -; CHECK-NEXT: [[COND2:%.*]] = load volatile i1, i1* [[DUMMY]], align 1 +; CHECK-NEXT: [[COND2:%.*]] = load volatile i1, ptr [[DUMMY]], align 1 ; CHECK-NEXT: br i1 [[COND2]], label [[THEN:%.*]], label [[END]] ; CHECK: then: ; CHECK-NEXT: br label [[END]] ; CHECK: end: -; CHECK-NEXT: [[X1:%.*]] = phi i8* [ [[A:%.*]], [[ENTRY:%.*]] ], [ [[B:%.*]], [[IF]] ], [ inttoptr (i64 1 to i8*), [[THEN]] ] -; CHECK-NEXT: [[X2:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 2 to i8*), [[THEN]] ] -; CHECK-NEXT: [[X3:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 3 to i8*), [[THEN]] ] -; CHECK-NEXT: [[X4:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 4 to i8*), [[THEN]] ] -; CHECK-NEXT: [[X5:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 5 to i8*), [[THEN]] ] -; CHECK-NEXT: [[X6:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 6 to i8*), [[THEN]] ] -; CHECK-NEXT: [[X7:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 7 to i8*), [[THEN]] ] -; CHECK-NEXT: [[X8:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 8 to i8*), [[THEN]] ] -; CHECK-NEXT: [[X9:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 9 to i8*), [[THEN]] ] -; CHECK-NEXT: [[X10:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 10 to i8*), [[THEN]] ] -; CHECK-NEXT: ret i8* [[X10]] +; CHECK-NEXT: [[X1:%.*]] = phi ptr [ [[A:%.*]], [[ENTRY:%.*]] ], [ [[B:%.*]], [[IF]] ], [ inttoptr (i64 1 to ptr), [[THEN]] ] +; CHECK-NEXT: [[X2:%.*]] = phi ptr [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 2 to ptr), [[THEN]] ] +; CHECK-NEXT: [[X3:%.*]] = phi ptr [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 3 to ptr), [[THEN]] ] +; CHECK-NEXT: [[X4:%.*]] = phi ptr [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 4 to ptr), [[THEN]] ] +; CHECK-NEXT: [[X5:%.*]] = phi ptr [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 5 to ptr), [[THEN]] ] +; CHECK-NEXT: [[X6:%.*]] = phi ptr [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 6 to ptr), [[THEN]] ] +; CHECK-NEXT: [[X7:%.*]] = phi ptr [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 7 to ptr), [[THEN]] ] +; CHECK-NEXT: [[X8:%.*]] = phi ptr [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 8 to ptr), [[THEN]] ] +; CHECK-NEXT: [[X9:%.*]] = phi ptr [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 9 to ptr), [[THEN]] ] +; CHECK-NEXT: [[X10:%.*]] = phi ptr [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 10 to ptr), [[THEN]] ] +; CHECK-NEXT: ret ptr [[X10]] ; entry: - %cond1 = load volatile i1, i1* %dummy + %cond1 = load volatile i1, ptr %dummy br i1 %cond1, label %if, label %end if: - %cond2 = load volatile i1, i1* %dummy + %cond2 = load volatile i1, ptr %dummy br i1 %cond2, label %then, label %end then: br label %end end: - %x1 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 1 to i8*), %then ] - %x2 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 2 to i8*), %then ] - %x3 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 3 to i8*), %then ] - %x4 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 4 to i8*), %then ] - %x5 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 5 to i8*), %then ] - %x6 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 6 to i8*), %then ] - %x7 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 7 to i8*), %then ] - %x8 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 8 to i8*), %then ] - %x9 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 9 to i8*), %then ] - %x10 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 10 to i8*), %then ] - - ret i8* %x10 + %x1 = phi ptr [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 1 to ptr), %then ] + %x2 = phi ptr [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 2 to ptr), %then ] + %x3 = phi ptr [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 3 to ptr), %then ] + %x4 = phi ptr [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 4 to ptr), %then ] + %x5 = phi ptr [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 5 to ptr), %then ] + %x6 = phi ptr [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 6 to ptr), %then ] + %x7 = phi ptr [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 7 to ptr), %then ] + %x8 = phi ptr [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 8 to ptr), %then ] + %x9 = phi ptr [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 9 to ptr), %then ] + %x10 = phi ptr [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 10 to ptr), %then ] + + ret ptr %x10 } -define i32* @test5(i32 %a, i32 %b, i32 %c, i32* dereferenceable(10) %ptr1, i32* dereferenceable(10) %ptr2, i32** dereferenceable(10) align 8 %ptr3) nofree nosync { +define ptr @test5(i32 %a, i32 %b, i32 %c, ptr dereferenceable(10) %ptr1, ptr dereferenceable(10) %ptr2, ptr dereferenceable(10) align 8 %ptr3) nofree nosync { ; CHECK-LABEL: @test5( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[T1:%.*]] = icmp eq i32 [[B:%.*]], 0 ; CHECK-NEXT: [[T2:%.*]] = icmp sgt i32 [[C:%.*]], 1 -; CHECK-NEXT: [[T4_SEL:%.*]] = select i1 [[T1]], i32* [[PTR2:%.*]], i32* [[PTR1:%.*]] +; CHECK-NEXT: [[T4_SEL:%.*]] = select i1 [[T1]], ptr [[PTR2:%.*]], ptr [[PTR1:%.*]] ; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[T1]], i1 [[T2]], i1 false -; CHECK-NEXT: [[T3:%.*]] = load i32*, i32** [[PTR3:%.*]], align 8 -; CHECK-NEXT: [[T4:%.*]] = select i1 [[OR_COND]], i32* [[T3]], i32* [[T4_SEL]] -; CHECK-NEXT: ret i32* [[T4]] +; CHECK-NEXT: [[T3:%.*]] = load ptr, ptr [[PTR3:%.*]], align 8 +; CHECK-NEXT: [[T4:%.*]] = select i1 [[OR_COND]], ptr [[T3]], ptr [[T4_SEL]] +; CHECK-NEXT: ret ptr [[T4]] ; entry: %t1 = icmp eq i32 %b, 0 @@ -136,12 +136,12 @@ bb1: br i1 %t2, label %bb2, label %bb3 bb2: - %t3 = load i32*, i32** %ptr3, !dereferenceable !{i64 10} + %t3 = load ptr, ptr %ptr3, !dereferenceable !{i64 10} br label %bb3 bb3: - %t4 = phi i32* [ %ptr1, %entry ], [ %ptr2, %bb1 ], [ %t3, %bb2 ] - ret i32* %t4 + %t4 = phi ptr [ %ptr1, %entry ], [ %ptr2, %bb1 ], [ %t3, %bb2 ] + ret ptr %t4 } define float @spec_select_fp5(float %a, float %b, float %c) { diff --git a/llvm/test/Transforms/SimplifyCFG/X86/bug-25299.ll b/llvm/test/Transforms/SimplifyCFG/X86/bug-25299.ll index aa1c28ba2522b2..f72e58392f9c74 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/bug-25299.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/bug-25299.ll @@ -13,7 +13,7 @@ entry: to label %continue unwind label %unwind unwind: ; preds = %entry - %tmp101 = landingpad { i8*, i32 } + %tmp101 = landingpad { ptr, i32 } cleanup br i1 %B, label %resume, label %then @@ -21,9 +21,9 @@ then: ; preds = %cleanup1 br label %resume resume: ; preds = %cleanup2, %then, %cleanup1, %unwind - %tmp104 = phi { i8*, i32 } [ %tmp101, %then ], [ %tmp106, %cleanup2 ], [ %tmp101, %unwind ] -;CHECK-NOT: resume { i8*, i32 } %tmp104 - resume { i8*, i32 } %tmp104 + %tmp104 = phi { ptr, i32 } [ %tmp101, %then ], [ %tmp106, %cleanup2 ], [ %tmp101, %unwind ] +;CHECK-NOT: resume { ptr, i32 } %tmp104 + resume { ptr, i32 } %tmp104 continue: ; preds = %entry, %continue ;CHECK: continue: ; preds = %entry, %continue @@ -32,7 +32,7 @@ continue: ; preds = %entry, %continue to label %continue unwind label %cleanup2 cleanup2: ; preds = %continue - %tmp106 = landingpad { i8*, i32 } + %tmp106 = landingpad { ptr, i32 } cleanup br label %resume } diff --git a/llvm/test/Transforms/SimplifyCFG/X86/combine-parallel-mem-md.ll b/llvm/test/Transforms/SimplifyCFG/X86/combine-parallel-mem-md.ll index 310fd45ab0b59e..8c5733e5babed3 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/combine-parallel-mem-md.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/combine-parallel-mem-md.ll @@ -3,44 +3,44 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: norecurse nounwind uwtable -define void @Test(i32* nocapture %res, i32* nocapture readnone %c, i32* nocapture readonly %d, i32* nocapture readonly %p) #0 { +define void @Test(ptr nocapture %res, ptr nocapture readnone %c, ptr nocapture readonly %d, ptr nocapture readonly %p) #0 { entry: br label %for.body ; CHECK-LABEL: @Test -; CHECK: load i32, i32* {{.*}}, align 4, !llvm.access.group !0 -; CHECK: load i32, i32* {{.*}}, align 4, !llvm.access.group !0 +; CHECK: load i32, ptr {{.*}}, align 4, !llvm.access.group !0 +; CHECK: load i32, ptr {{.*}}, align 4, !llvm.access.group !0 ; CHECK: store i32 {{.*}}, align 4, !llvm.access.group !0 ; CHECK-NOT: load ; CHECK-NOT: store for.body: ; preds = %cond.end, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %cond.end ] - %arrayidx = getelementptr inbounds i32, i32* %p, i64 %indvars.iv - %0 = load i32, i32* %arrayidx, align 4, !llvm.access.group !10 + %arrayidx = getelementptr inbounds i32, ptr %p, i64 %indvars.iv + %0 = load i32, ptr %arrayidx, align 4, !llvm.access.group !10 %cmp1 = icmp eq i32 %0, 0 br i1 %cmp1, label %cond.true, label %cond.false cond.false: ; preds = %for.body - %arrayidx3 = getelementptr inbounds i32, i32* %res, i64 %indvars.iv - %v = load i32, i32* %arrayidx3, align 4, !llvm.access.group !10 - %arrayidx7 = getelementptr inbounds i32, i32* %d, i64 %indvars.iv - %1 = load i32, i32* %arrayidx7, align 4, !llvm.access.group !10 + %arrayidx3 = getelementptr inbounds i32, ptr %res, i64 %indvars.iv + %v = load i32, ptr %arrayidx3, align 4, !llvm.access.group !10 + %arrayidx7 = getelementptr inbounds i32, ptr %d, i64 %indvars.iv + %1 = load i32, ptr %arrayidx7, align 4, !llvm.access.group !10 %add = add nsw i32 %1, %v br label %cond.end cond.true: ; preds = %for.body - %arrayidx4 = getelementptr inbounds i32, i32* %res, i64 %indvars.iv - %w = load i32, i32* %arrayidx4, align 4, !llvm.access.group !10 - %arrayidx8 = getelementptr inbounds i32, i32* %d, i64 %indvars.iv - %2 = load i32, i32* %arrayidx8, align 4, !llvm.access.group !10 + %arrayidx4 = getelementptr inbounds i32, ptr %res, i64 %indvars.iv + %w = load i32, ptr %arrayidx4, align 4, !llvm.access.group !10 + %arrayidx8 = getelementptr inbounds i32, ptr %d, i64 %indvars.iv + %2 = load i32, ptr %arrayidx8, align 4, !llvm.access.group !10 %add2 = add nsw i32 %2, %w br label %cond.end cond.end: ; preds = %for.body, %cond.false %cond = phi i32 [ %add, %cond.false ], [ %add2, %cond.true ] - %arrayidx9 = getelementptr inbounds i32, i32* %res, i64 %indvars.iv - store i32 %cond, i32* %arrayidx9, align 4, !llvm.access.group !10 + %arrayidx9 = getelementptr inbounds i32, ptr %res, i64 %indvars.iv + store i32 %cond, ptr %arrayidx9, align 4, !llvm.access.group !10 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 16 br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !0 diff --git a/llvm/test/Transforms/SimplifyCFG/X86/critedge-assume.ll b/llvm/test/Transforms/SimplifyCFG/X86/critedge-assume.ll index 1d6fdb10072b49..58ca8df8ff6d6e 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/critedge-assume.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/critedge-assume.ll @@ -18,12 +18,12 @@ target triple = "x86_64-unknown-linux-gnu" %class.F = type { i8 } %class.B = type { i8 } %class.A = type { %class.C } -%class.C = type { i32 (...)** } +%class.C = type { ptr } -define void @foo(%class.F* %this, %class.B* %out) { +define void @foo(ptr %this, ptr %out) { entry: - %call = tail call i32 @_ZNK1F5beginEv(%class.F* %this) - %call2 = tail call i32 @_ZNK1F3endEv(%class.F* %this) + %call = tail call i32 @_ZNK1F5beginEv(ptr %this) + %call2 = tail call i32 @_ZNK1F3endEv(ptr %this) %cmp.i22 = icmp eq i32 %call, %call2 br i1 %cmp.i22, label %while.end, label %while.body.preheader @@ -32,20 +32,18 @@ while.body.preheader: while.body: %frame_node.sroa.0.023 = phi i32 [ %inc.i, %_ZN10unique_ptrD2Ev.exit ], [ %call, %while.body.preheader ] - %call8 = tail call i8* @_Znwm(i64 8) + %call8 = tail call ptr @_Znwm(i64 8) %inc.i = add nsw i32 %frame_node.sroa.0.023, 1 %cmp = icmp eq i32 %inc.i, %call2 br i1 %cmp, label %_ZN10unique_ptrD2Ev.exit, label %if.then if.then: - tail call void @_ZN1B6appendEv(%class.B* %out) + tail call void @_ZN1B6appendEv(ptr %out) br label %_ZN10unique_ptrD2Ev.exit _ZN10unique_ptrD2Ev.exit: - %x1 = bitcast i8* %call8 to void (%class.A*)*** - %vtable.i.i = load void (%class.A*)**, void (%class.A*)*** %x1, align 8 - %x2 = bitcast void (%class.A*)** %vtable.i.i to i8* - %x3 = tail call i1 @llvm.type.test(i8* %x2, metadata !"foo") + %vtable.i.i = load ptr, ptr %call8, align 8 + %x3 = tail call i1 @llvm.type.test(ptr %vtable.i.i, metadata !"foo") ; CHECK: call void @llvm.assume ; CHECK: call void @llvm.assume tail call void @llvm.assume(i1 %x3) #5 @@ -58,21 +56,21 @@ while.end: ret void } -declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) +declare void @llvm.lifetime.start.p0(i64, ptr nocapture) -declare i32 @_ZNK1F5beginEv(%class.F*) +declare i32 @_ZNK1F5beginEv(ptr) -declare i32 @_ZNK1F3endEv(%class.F*) +declare i32 @_ZNK1F3endEv(ptr) -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) +declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1) -declare noalias nonnull i8* @_Znwm(i64) +declare noalias nonnull ptr @_Znwm(i64) -declare void @_ZN1B6appendEv(%class.B*) +declare void @_ZN1B6appendEv(ptr) -declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) +declare void @llvm.lifetime.end.p0(i64, ptr nocapture) -declare i1 @llvm.type.test(i8*, metadata) +declare i1 @llvm.type.test(ptr, metadata) declare void @llvm.assume(i1) diff --git a/llvm/test/Transforms/SimplifyCFG/X86/empty-cleanuppad.ll b/llvm/test/Transforms/SimplifyCFG/X86/empty-cleanuppad.ll index a08c841bb5990f..cd102d3c4ee972 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/empty-cleanuppad.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/empty-cleanuppad.ll @@ -17,7 +17,7 @@ target triple = "x86_64-pc-windows-msvc18.0.0" ; In this case, both cleanup pads can be eliminated and the invoke can be ; converted to a call. ; -define void @f1() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { +define void @f1() personality ptr @__CxxFrameHandler3 { ; CHECK-LABEL: @f1( ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @g() @@ -55,7 +55,7 @@ ehcleanup.1: ; preds = %ehcleanup ; should unwind to the caller (that is, exception handling continues with the ; parent frame of the caller). ; -define void @f2() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { +define void @f2() personality ptr @__CxxFrameHandler3 { ; CHECK-LABEL: @f2( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[B:%.*]] = alloca [[STRUCT_S2:%.*]], align 1 @@ -63,12 +63,12 @@ define void @f2() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8* ; CHECK-NEXT: to label [[TRY_CONT:%.*]] unwind label [[EHCLEANUP:%.*]] ; CHECK: ehcleanup: ; CHECK-NEXT: [[TMP0:%.*]] = cleanuppad within none [] -; CHECK-NEXT: call void @"\01??1S2@@QEAA@XZ"(%struct.S2* [[B]]) +; CHECK-NEXT: call void @"\01??1S2@@QEAA@XZ"(ptr [[B]]) ; CHECK-NEXT: cleanupret from [[TMP0]] unwind label [[CATCH_DISPATCH:%.*]] ; CHECK: catch.dispatch: ; CHECK-NEXT: [[CS1:%.*]] = catchswitch within none [label %catch] unwind to caller ; CHECK: catch: -; CHECK-NEXT: [[TMP1:%.*]] = catchpad within [[CS1]] [i8* null, i32 64, i8* null] +; CHECK-NEXT: [[TMP1:%.*]] = catchpad within [[CS1]] [ptr null, i32 64, ptr null] ; CHECK-NEXT: catchret from [[TMP1]] to label [[TRY_CONT]] ; CHECK: try.cont: ; CHECK-NEXT: ret void @@ -82,14 +82,14 @@ invoke.cont: ; preds = %entry ehcleanup: ; preds = %entry %0 = cleanuppad within none [] - call void @"\01??1S2@@QEAA@XZ"(%struct.S2* %b) + call void @"\01??1S2@@QEAA@XZ"(ptr %b) cleanupret from %0 unwind label %catch.dispatch catch.dispatch: ; preds = %ehcleanup %cs1 = catchswitch within none [label %catch] unwind label %ehcleanup.1 catch: ; preds = %catch.dispatch - %1 = catchpad within %cs1 [i8* null, i32 u0x40, i8* null] + %1 = catchpad within %cs1 [ptr null, i32 u0x40, ptr null] catchret from %1 to label %catchret.dest catchret.dest: ; preds = %catch @@ -119,7 +119,7 @@ ehcleanup.1: ; In this case the inner cleanup pad should be eliminated and the invoke of g() ; should unwind directly to the catchpad. -define void @f3() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { +define void @f3() personality ptr @__CxxFrameHandler3 { ; CHECK-LABEL: @f3( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[A:%.*]] = alloca [[STRUCT_S2:%.*]], align 1 @@ -128,13 +128,13 @@ define void @f3() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8* ; CHECK: catch.dispatch: ; CHECK-NEXT: [[CS1:%.*]] = catchswitch within none [label %catch] unwind label [[EHCLEANUP_1:%.*]] ; CHECK: catch: -; CHECK-NEXT: [[CP2:%.*]] = catchpad within [[CS1]] [i8* null, i32 64, i8* null] +; CHECK-NEXT: [[CP2:%.*]] = catchpad within [[CS1]] [ptr null, i32 64, ptr null] ; CHECK-NEXT: catchret from [[CP2]] to label [[TRY_CONT]] ; CHECK: try.cont: ; CHECK-NEXT: ret void ; CHECK: ehcleanup.1: ; CHECK-NEXT: [[CP3:%.*]] = cleanuppad within none [] -; CHECK-NEXT: call void @"\01??1S2@@QEAA@XZ"(%struct.S2* [[A]]) +; CHECK-NEXT: call void @"\01??1S2@@QEAA@XZ"(ptr [[A]]) ; CHECK-NEXT: cleanupret from [[CP3]] unwind to caller ; entry: @@ -152,7 +152,7 @@ catch.dispatch: ; preds = %ehcleanup %cs1 = catchswitch within none [label %catch] unwind label %ehcleanup.1 catch: ; preds = %catch.dispatch - %cp2 = catchpad within %cs1 [i8* null, i32 u0x40, i8* null] + %cp2 = catchpad within %cs1 [ptr null, i32 u0x40, ptr null] catchret from %cp2 to label %catchret.dest catchret.dest: ; preds = %catch @@ -163,7 +163,7 @@ try.cont: ; preds = %catchret.dest, %inv ehcleanup.1: %cp3 = cleanuppad within none [] - call void @"\01??1S2@@QEAA@XZ"(%struct.S2* %a) + call void @"\01??1S2@@QEAA@XZ"(ptr %a) cleanupret from %cp3 unwind to caller } @@ -186,7 +186,7 @@ ehcleanup.1: ; Note: The cleanuppad simplification will insert an unconditional branch here ; but it will be eliminated, placing the following invoke in the entry BB. ; -define void @f4() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { +define void @f4() personality ptr @__CxxFrameHandler3 { ; CHECK-LABEL: @f4( ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @g() @@ -195,7 +195,7 @@ define void @f4() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8* ; CHECK: catch.dispatch: ; CHECK-NEXT: [[CS1:%.*]] = catchswitch within none [label %catch] unwind to caller ; CHECK: catch: -; CHECK-NEXT: [[TMP0:%.*]] = catchpad within [[CS1]] [i8* null, i32 64, i8* null] +; CHECK-NEXT: [[TMP0:%.*]] = catchpad within [[CS1]] [ptr null, i32 64, ptr null] ; CHECK-NEXT: catchret from [[TMP0]] to label [[TRY_CONT]] ; CHECK: try.cont: ; CHECK-NEXT: ret void @@ -212,7 +212,7 @@ catch.dispatch: ; preds = %invoke.cont %cs1 = catchswitch within none [label %catch] unwind label %ehcleanup catch: ; preds = %catch.dispatch - %0 = catchpad within %cs1 [i8* null, i32 u0x40, i8* null] + %0 = catchpad within %cs1 [ptr null, i32 u0x40, ptr null] catchret from %0 to label %try.cont try.cont: ; preds = %catch, %invoke.cont @@ -242,7 +242,7 @@ ehcleanup: ; In this case, the cleanup pad should be eliminated and the PHI node in the ; cleanup pad should be sunk into the catch dispatch block. ; -define i32 @f6() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { +define i32 @f6() personality ptr @__CxxFrameHandler3 { ; CHECK-LABEL: @f6( ; CHECK-NEXT: entry: ; CHECK-NEXT: invoke void @g() @@ -254,7 +254,7 @@ define i32 @f6() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) ; CHECK-NEXT: [[STATE_0:%.*]] = phi i32 [ 2, [[INVOKE_CONT]] ], [ 1, [[ENTRY:%.*]] ] ; CHECK-NEXT: [[CS1:%.*]] = catchswitch within none [label %catch] unwind to caller ; CHECK: catch: -; CHECK-NEXT: [[TMP0:%.*]] = catchpad within [[CS1]] [i8* null, i32 64, i8* null] +; CHECK-NEXT: [[TMP0:%.*]] = catchpad within [[CS1]] [ptr null, i32 64, ptr null] ; CHECK-NEXT: catchret from [[TMP0]] to label [[RETURN]] ; CHECK: return: ; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[STATE_0]], [[CATCH:%.*]] ], [ 0, [[INVOKE_CONT]] ] @@ -277,7 +277,7 @@ catch.dispatch: ; preds = %ehcleanup %cs1 = catchswitch within none [label %catch] unwind to caller catch: ; preds = %catch.dispatch - %1 = catchpad within %cs1 [i8* null, i32 u0x40, i8* null] + %1 = catchpad within %cs1 [ptr null, i32 u0x40, ptr null] catchret from %1 to label %return return: ; preds = %invoke.cont, %catch @@ -306,7 +306,7 @@ return: ; preds = %invoke.cont, %catch ; In this case, the cleanup pad should be eliminated and the PHI node in the ; cleanup pad should be merged with the PHI node in the catch dispatch block. ; -define i32 @f7() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { +define i32 @f7() personality ptr @__CxxFrameHandler3 { ; CHECK-LABEL: @f7( ; CHECK-NEXT: entry: ; CHECK-NEXT: invoke void @g() @@ -321,7 +321,7 @@ define i32 @f7() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) ; CHECK-NEXT: [[STATE_1:%.*]] = phi i32 [ 1, [[ENTRY:%.*]] ], [ 3, [[INVOKE_CONT_1]] ], [ 2, [[INVOKE_CONT]] ] ; CHECK-NEXT: [[CS1:%.*]] = catchswitch within none [label %catch] unwind to caller ; CHECK: catch: -; CHECK-NEXT: [[TMP0:%.*]] = catchpad within [[CS1]] [i8* null, i32 64, i8* null] +; CHECK-NEXT: [[TMP0:%.*]] = catchpad within [[CS1]] [ptr null, i32 64, ptr null] ; CHECK-NEXT: catchret from [[TMP0]] to label [[RETURN]] ; CHECK: return: ; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[STATE_1]], [[CATCH:%.*]] ], [ 0, [[INVOKE_CONT_1]] ] @@ -349,7 +349,7 @@ catch.dispatch: ; preds = %ehcleanup, %entry %cs1 = catchswitch within none [label %catch] unwind to caller catch: ; preds = %catch.dispatch - %1 = catchpad within %cs1 [i8* null, i32 u0x40, i8* null] + %1 = catchpad within %cs1 [ptr null, i32 u0x40, ptr null] catchret from %1 to label %return return: ; preds = %invoke.cont.1, %catch @@ -384,7 +384,7 @@ return: ; preds = %invoke.cont.1, %cat ; should have an incoming value entry for path from 'foo' that references the ; PHI node itself. ; -define void @f8() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { +define void @f8() personality ptr @__CxxFrameHandler3 { ; CHECK-LABEL: @f8( ; CHECK-NEXT: entry: ; CHECK-NEXT: invoke void @g() @@ -396,7 +396,7 @@ define void @f8() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8* ; CHECK-NEXT: [[X:%.*]] = phi i32 [ 2, [[INVOKE_CONT]] ], [ 1, [[ENTRY:%.*]] ], [ [[X]], [[CATCH_CONT:%.*]] ] ; CHECK-NEXT: [[CS1:%.*]] = catchswitch within none [label %catch] unwind to caller ; CHECK: catch: -; CHECK-NEXT: [[TMP0:%.*]] = catchpad within [[CS1]] [i8* null, i32 64, i8* null] +; CHECK-NEXT: [[TMP0:%.*]] = catchpad within [[CS1]] [ptr null, i32 64, ptr null] ; CHECK-NEXT: call void @use_x(i32 [[X]]) ; CHECK-NEXT: catchret from [[TMP0]] to label [[CATCH_CONT]] ; CHECK: catch.cont: @@ -422,7 +422,7 @@ catch.dispatch: ; preds = %ehcleanup, %catch.c %cs1 = catchswitch within none [label %catch] unwind to caller catch: ; preds = %catch.dispatch - %1 = catchpad within %cs1 [i8* null, i32 u0x40, i8* null] + %1 = catchpad within %cs1 [ptr null, i32 u0x40, ptr null] call void @use_x(i32 %x) catchret from %1 to label %catch.cont @@ -433,46 +433,44 @@ catch.cont: ; preds = %catch return: ; preds = %invoke.cont, %catch.cont ret void } -define i32 @f9() personality i32 (...)* @__CxxFrameHandler3 { +define i32 @f9() personality ptr @__CxxFrameHandler3 { ; CHECK-LABEL: @f9( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[S:%.*]] = alloca i8, align 1 -; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 1, i8* nonnull [[S]]) -; CHECK-NEXT: [[BC:%.*]] = bitcast i8* [[S]] to %struct.S2* -; CHECK-NEXT: invoke void @"\01??1S2@@QEAA@XZ"(%struct.S2* [[BC]]) +; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 1, ptr nonnull [[S]]) +; CHECK-NEXT: invoke void @"\01??1S2@@QEAA@XZ"(ptr [[S]]) ; CHECK-NEXT: to label [[TRY_CONT:%.*]] unwind label [[CATCH_DISPATCH:%.*]] ; CHECK: catch.dispatch: ; CHECK-NEXT: [[CATCH_SWITCH:%.*]] = catchswitch within none [label %catch] unwind to caller ; CHECK: catch: -; CHECK-NEXT: [[CATCH_PAD:%.*]] = catchpad within [[CATCH_SWITCH]] [i8* null, i32 0, i8* null] +; CHECK-NEXT: [[CATCH_PAD:%.*]] = catchpad within [[CATCH_SWITCH]] [ptr null, i32 0, ptr null] ; CHECK-NEXT: catchret from [[CATCH_PAD]] to label [[TRY_CONT]] ; CHECK: try.cont: ; CHECK-NEXT: ret i32 0 ; entry: %s = alloca i8, align 1 - call void @llvm.lifetime.start.p0i8(i64 1, i8* nonnull %s) - %bc = bitcast i8* %s to %struct.S2* - invoke void @"\01??1S2@@QEAA@XZ"(%struct.S2* %bc) + call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %s) + invoke void @"\01??1S2@@QEAA@XZ"(ptr %s) to label %try.cont unwind label %ehcleanup ehcleanup: %cleanup.pad = cleanuppad within none [] - call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %s) + call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %s) cleanupret from %cleanup.pad unwind label %catch.dispatch catch.dispatch: %catch.switch = catchswitch within none [label %catch] unwind to caller catch: - %catch.pad = catchpad within %catch.switch [i8* null, i32 0, i8* null] + %catch.pad = catchpad within %catch.switch [ptr null, i32 0, ptr null] catchret from %catch.pad to label %try.cont try.cont: ret i32 0 } -define void @f10(i32 %V) personality i32 (...)* @__CxxFrameHandler3 { +define void @f10(i32 %V) personality ptr @__CxxFrameHandler3 { ; CHECK-LABEL: @f10( ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @g() @@ -501,7 +499,7 @@ cleanupret2: ; This case tests the handling of an empty cleanup pad that ; contains a lifetime_end intrinsic and does not dominate its ; successor. -define void @f11() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { +define void @f11() personality ptr @__CxxFrameHandler3 { ; CHECK-LABEL: @f11( ; CHECK-NEXT: entry: ; CHECK-NEXT: invoke void @g() @@ -515,7 +513,7 @@ define void @f11() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8 ; CHECK: catch.dispatch: ; CHECK-NEXT: [[CS1:%.*]] = catchswitch within none [label %catch] unwind to caller ; CHECK: catch: -; CHECK-NEXT: [[TMP0:%.*]] = catchpad within [[CS1]] [i8* null, i32 64, i8* null] +; CHECK-NEXT: [[TMP0:%.*]] = catchpad within [[CS1]] [ptr null, i32 64, ptr null] ; CHECK-NEXT: catchret from [[TMP0]] to label [[RETURN]] ; CHECK: return: ; CHECK-NEXT: ret void @@ -533,16 +531,16 @@ invoke.cont2: ; preds = %invoke.cont to label %return unwind label %catch.dispatch ehcleanup: ; preds = %invoke.cont, %entry - %x = phi i8* [ undef, %invoke.cont ], [ undef, %entry ] + %x = phi ptr [ undef, %invoke.cont ], [ undef, %entry ] %0 = cleanuppad within none [] - call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %x) + call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %x) cleanupret from %0 unwind label %catch.dispatch catch.dispatch: ; preds = %ehcleanup, %invoke.cont %cs1 = catchswitch within none [label %catch] unwind to caller catch: ; preds = %catch.dispatch - %1 = catchpad within %cs1 [i8* null, i32 u0x40, i8* null] + %1 = catchpad within %cs1 [ptr null, i32 u0x40, ptr null] catchret from %1 to label %return return: ; preds = %invoke.cont, %catch.cont @@ -551,11 +549,11 @@ return: ; preds = %invoke.cont, %catch %struct.S = type { i8 } %struct.S2 = type { i8 } -declare void @"\01??1S2@@QEAA@XZ"(%struct.S2*) +declare void @"\01??1S2@@QEAA@XZ"(ptr) declare void @g() declare void @use_x(i32 %x) declare i32 @__CxxFrameHandler3(...) -declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) -declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) +declare void @llvm.lifetime.start.p0(i64, ptr nocapture) +declare void @llvm.lifetime.end.p0(i64, ptr nocapture) diff --git a/llvm/test/Transforms/SimplifyCFG/X86/invalidate-dom.ll b/llvm/test/Transforms/SimplifyCFG/X86/invalidate-dom.ll index 3347a014ca1d2b..a937d9c65017a4 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/invalidate-dom.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/invalidate-dom.ll @@ -9,11 +9,11 @@ target triple = "x86_64-unknown-linux-gnu" @f = external global i32, align 4 @g = external global i32, align 4 -define i32* @a(i32 %h) #0 { +define ptr @a(i32 %h) #0 { entry: %h.addr = alloca i32, align 4 - store i32 %h, i32* %h.addr, align 4 - %tmp0 = load i32, i32* %h.addr, align 4 + store i32 %h, ptr %h.addr, align 4 + %tmp0 = load i32, ptr %h.addr, align 4 switch i32 %tmp0, label %sw.default [ i32 4, label %sw.bb i32 3, label %sw.bb1 @@ -31,8 +31,8 @@ sw.bb1: ; preds = %entry sw.bb3: ; preds = %entry %call4 = call i32 (...) @c() %conv = sext i32 %call4 to i64 - %tmp1 = inttoptr i64 %conv to i32* - ret i32* %tmp1 + %tmp1 = inttoptr i64 %conv to ptr + ret ptr %tmp1 sw.default: ; preds = %entry unreachable @@ -48,41 +48,41 @@ entry: define internal i32 @j() #0 { entry: %i = alloca i32, align 4 - store i32 0, i32* %i, align 4 + store i32 0, ptr %i, align 4 br label %for.cond for.cond: ; preds = %for.body, %entry - %tmp0 = load i32, i32* %i, align 4 - %tmp1 = load i32, i32* @f, align 4 + %tmp0 = load i32, ptr %i, align 4 + %tmp1 = load i32, ptr @f, align 4 %cmp = icmp ult i32 %tmp0, %tmp1 br i1 %cmp, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond - %tmp2 = load i32, i32* @f, align 4 - %call3 = call i32* @a(i32 %tmp2) + %tmp2 = load i32, ptr @f, align 4 + %call3 = call ptr @a(i32 %tmp2) ret i32 undef for.body: ; preds = %for.cond %call = call i32 (...) @c() %call1 = call i32 (...) @c() %call2 = call i32 (...) @c() - %tmp3 = load i32, i32* @b, align 4 - %tmp4 = load i32, i32* @g, align 4 + %tmp3 = load i32, ptr @b, align 4 + %tmp4 = load i32, ptr @g, align 4 %sub = sub nsw i32 %tmp4, %tmp3 - store i32 %sub, i32* @g, align 4 - %tmp5 = load i32, i32* %i, align 4 + store i32 %sub, ptr @g, align 4 + %tmp5 = load i32, ptr %i, align 4 %inc = add i32 %tmp5, 1 - store i32 %inc, i32* %i, align 4 + store i32 %inc, ptr %i, align 4 br label %for.cond } declare i32 @c(...) #0 ; Function Attrs: argmemonly nounwind -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 -declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #2 +declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 attributes #0 = { "use-soft-float"="false" } attributes #1 = { "target-cpu"="x86-64" } diff --git a/llvm/test/Transforms/SimplifyCFG/X86/merge-cleanuppads.ll b/llvm/test/Transforms/SimplifyCFG/X86/merge-cleanuppads.ll index ec7f133a05e7c9..6e6c97f12c86fe 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/merge-cleanuppads.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/merge-cleanuppads.ll @@ -3,7 +3,7 @@ target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-windows-msvc18.0.0" ; Function Attrs: uwtable -define void @test1() #0 personality i32 (...)* @__CxxFrameHandler3 { +define void @test1() #0 personality ptr @__CxxFrameHandler3 { entry: invoke void @may_throw(i32 3) to label %invoke.cont unwind label %ehcleanup diff --git a/llvm/test/Transforms/SimplifyCFG/X86/merge-compatible-invokes-of-landingpad-debuginfo.ll b/llvm/test/Transforms/SimplifyCFG/X86/merge-compatible-invokes-of-landingpad-debuginfo.ll index 295bda14a1c6d8..801e81e6f49f25 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/merge-compatible-invokes-of-landingpad-debuginfo.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/merge-compatible-invokes-of-landingpad-debuginfo.ll @@ -6,17 +6,17 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16 target triple = "x86_64-unknown-linux-gnu" ; More interesting test, here we can merge the invokes. -define void @t1_mergeable_invoke() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t1_mergeable_invoke() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t1_mergeable_invoke( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond(), !dbg [[DBG12:![0-9]+]] ; CHECK-NEXT: call void @llvm.dbg.value(metadata i1 [[C0]], metadata [[META9:![0-9]+]], metadata !DIExpression()), !dbg [[DBG12]] ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE:%.*]], !dbg [[DBG13:![0-9]+]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup, !dbg [[DBG14:![0-9]+]] ; CHECK-NEXT: call void @destructor(), !dbg [[DBG15:![0-9]+]] -; CHECK-NEXT: resume { i8*, i32 } [[EH]], !dbg [[DBG16:![0-9]+]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]], !dbg [[DBG16:![0-9]+]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond(), !dbg [[DBG17:![0-9]+]] ; CHECK-NEXT: call void @llvm.dbg.value(metadata i1 [[C1]], metadata [[META11:![0-9]+]], metadata !DIExpression()), !dbg [[DBG17]] @@ -41,9 +41,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() diff --git a/llvm/test/Transforms/SimplifyCFG/X86/merge-compatible-invokes-of-landingpad.ll b/llvm/test/Transforms/SimplifyCFG/X86/merge-compatible-invokes-of-landingpad.ll index 9a41ca8e9ba149..c29451ae2ca06c 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/merge-compatible-invokes-of-landingpad.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/merge-compatible-invokes-of-landingpad.ll @@ -6,7 +6,7 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16 target triple = "x86_64-unknown-linux-gnu" ; Simple test, nothing interesting happens here. -define void @t0_noop() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t0_noop() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t0_noop( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C:%.*]] = call i1 @cond() @@ -17,10 +17,10 @@ define void @t0_noop() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 ; CHECK: invoke.cont: ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.end: ; CHECK-NEXT: call void @sideeffect() ; CHECK-NEXT: ret void @@ -36,9 +36,9 @@ invoke.cont: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.end: call void @sideeffect() @@ -46,16 +46,16 @@ if.end: } ; More interesting test, here we can merge the invokes. -define void @t1_mergeable_invoke() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t1_mergeable_invoke() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t1_mergeable_invoke( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] @@ -79,9 +79,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -99,16 +99,16 @@ if.end: } ; normal block is shared, but it is unreachable, so we are fine. -define void @t2_shared_normal_dest() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t2_shared_normal_dest() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t2_shared_normal_dest( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] @@ -132,9 +132,9 @@ invoke.cont: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -149,7 +149,7 @@ if.end: } ; shared normal destination is not unreachable. -define void @t3_shared_identical_normal_dest() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t3_shared_identical_normal_dest() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t3_shared_identical_normal_dest( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -158,10 +158,10 @@ define void @t3_shared_identical_normal_dest() personality i8* bitcast (i32 (... ; CHECK-NEXT: call void @sideeffect() ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] @@ -184,9 +184,9 @@ invoke.cont: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -201,7 +201,7 @@ if.end: } ; normal destinations are not unreachable and not shared and can not be merged. -define void @t4_normal_dests() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t4_normal_dests() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t4_normal_dests( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -213,10 +213,10 @@ define void @t4_normal_dests() personality i8* bitcast (i32 (...)* @__gxx_person ; CHECK-NEXT: call void @sideeffect() ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1:%.*]], label [[IF_END:%.*]] @@ -242,9 +242,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -263,7 +263,7 @@ if.end: } ; Invokes lead to different landing pads. -define void @t5_different_landingpads() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t5_different_landingpads() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t5_different_landingpads( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -274,10 +274,10 @@ define void @t5_different_landingpads() personality i8* bitcast (i32 (...)* @__g ; CHECK: invoke.cont0: ; CHECK-NEXT: unreachable ; CHECK: common.resume: -; CHECK-NEXT: [[COMMON_RESUME_OP:%.*]] = phi { i8*, i32 } [ [[EH0:%.*]], [[LPAD0]] ], [ [[EH1:%.*]], [[LPAD1:%.*]] ] -; CHECK-NEXT: resume { i8*, i32 } [[COMMON_RESUME_OP]] +; CHECK-NEXT: [[COMMON_RESUME_OP:%.*]] = phi { ptr, i32 } [ [[EH0:%.*]], [[LPAD0]] ], [ [[EH1:%.*]], [[LPAD1:%.*]] ] +; CHECK-NEXT: resume { ptr, i32 } [[COMMON_RESUME_OP]] ; CHECK: lpad0: -; CHECK-NEXT: [[EH0]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH0]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() ; CHECK-NEXT: br label [[COMMON_RESUME:%.*]] @@ -290,7 +290,7 @@ define void @t5_different_landingpads() personality i8* bitcast (i32 (...)* @__g ; CHECK: invoke.cont2: ; CHECK-NEXT: unreachable ; CHECK: lpad1: -; CHECK-NEXT: [[EH1]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH1]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @another_destructor() ; CHECK-NEXT: br label [[COMMON_RESUME]] @@ -309,9 +309,9 @@ invoke.cont0: unreachable lpad0: - %eh0 = landingpad { i8*, i32 } cleanup + %eh0 = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh0 + resume { ptr, i32 } %eh0 if.else: %c1 = call i1 @cond() @@ -324,9 +324,9 @@ invoke.cont2: unreachable lpad1: - %eh1 = landingpad { i8*, i32 } cleanup + %eh1 = landingpad { ptr, i32 } cleanup call void @another_destructor() - resume { i8*, i32 } %eh1 + resume { ptr, i32 } %eh1 if.end: call void @sideeffect() @@ -334,7 +334,7 @@ if.end: } ; The invoked functions are different -define void @t6_different_invokes() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t6_different_invokes() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t6_different_invokes( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -345,10 +345,10 @@ define void @t6_different_invokes() personality i8* bitcast (i32 (...)* @__gxx_p ; CHECK: invoke.cont0: ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1:%.*]], label [[IF_END:%.*]] @@ -372,9 +372,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -392,7 +392,7 @@ if.end: } ; Merging of this invoke is disallowed -define void @t7_nomerge0() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t7_nomerge0() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t7_nomerge0( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -403,10 +403,10 @@ define void @t7_nomerge0() personality i8* bitcast (i32 (...)* @__gxx_personalit ; CHECK: invoke.cont0: ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1:%.*]], label [[IF_END:%.*]] @@ -430,9 +430,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -448,7 +448,7 @@ if.end: call void @sideeffect() ret void } -define void @t8_nomerge1() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t8_nomerge1() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t8_nomerge1( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -459,10 +459,10 @@ define void @t8_nomerge1() personality i8* bitcast (i32 (...)* @__gxx_personalit ; CHECK: invoke.cont0: ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1:%.*]], label [[IF_END:%.*]] @@ -486,9 +486,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -504,7 +504,7 @@ if.end: call void @sideeffect() ret void } -define void @t9_nomerge2() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t9_nomerge2() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t9_nomerge2( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -515,10 +515,10 @@ define void @t9_nomerge2() personality i8* bitcast (i32 (...)* @__gxx_personalit ; CHECK: invoke.cont0: ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1:%.*]], label [[IF_END:%.*]] @@ -542,9 +542,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -562,7 +562,7 @@ if.end: } ; Just don't deal with inlineasm. -define void @t10_inlineasm() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t10_inlineasm() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t10_inlineasm( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -573,10 +573,10 @@ define void @t10_inlineasm() personality i8* bitcast (i32 (...)* @__gxx_personal ; CHECK: invoke.cont0: ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1:%.*]], label [[IF_END:%.*]] @@ -600,9 +600,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -620,7 +620,7 @@ if.end: } ; landingpad has PHI nodes, and the incoming values are incompatible. -define void @t11_phi_in_landingpad_incompatible_incoming_values() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t11_phi_in_landingpad_incompatible_incoming_values() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t11_phi_in_landingpad_incompatible_incoming_values( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -632,11 +632,11 @@ define void @t11_phi_in_landingpad_incompatible_incoming_values() personality i8 ; CHECK-NEXT: unreachable ; CHECK: lpad: ; CHECK-NEXT: [[PHI:%.*]] = phi i32 [ 0, [[IF_THEN0]] ], [ 1, [[IF_THEN1:%.*]] ] -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @consume(i32 [[PHI]]) ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1]], label [[IF_END:%.*]] @@ -661,10 +661,10 @@ invoke.cont0: lpad: %phi = phi i32 [ 0, %if.then0 ], [ 1, %if.then1 ] - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @consume(i32 %phi) call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -682,16 +682,16 @@ if.end: } ; It is okay for the invoke to take arguments -define void @t12_arguments_are_fine() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t12_arguments_are_fine() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t12_arguments_are_fine( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] @@ -715,9 +715,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -735,16 +735,16 @@ if.end: } ; It is okay for the invoke to take different arguments -define void @t13_different_arguments_are_fine() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t13_different_arguments_are_fine() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t13_different_arguments_are_fine( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] @@ -769,9 +769,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -789,16 +789,16 @@ if.end: } ; There can be more than two invokes in a set -define void @t14_three_invokes() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t14_three_invokes() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t14_three_invokes( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN2_INVOKE:%.*]], label [[IF_ELSE0:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else0: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN2_INVOKE]], label [[IF_ELSE1:%.*]] @@ -825,9 +825,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else0: %c1 = call i1 @cond() @@ -855,16 +855,16 @@ if.end: } ; If not all invokes of landingpad are compatible then we still merge compatible ones. -define void @t15_three_invokes_only_two_compatible() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t15_three_invokes_only_two_compatible() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t15_three_invokes_only_two_compatible( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE0:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else0: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_ELSE1:%.*]] @@ -896,9 +896,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else0: %c1 = call i1 @cond() @@ -926,16 +926,16 @@ if.end: } ; We succeed in merging invokes into two sets -define void @t16_four_invokes_forming_two_sets() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t16_four_invokes_forming_two_sets() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t16_four_invokes_forming_two_sets( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE0:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else0: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_ELSE1:%.*]] @@ -970,9 +970,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else0: %c1 = call i1 @cond() @@ -1010,7 +1010,7 @@ if.end: } ; Attributes must match -define void @t17_mismatched_attrs_prevent_merge() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t17_mismatched_attrs_prevent_merge() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t17_mismatched_attrs_prevent_merge( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -1021,10 +1021,10 @@ define void @t17_mismatched_attrs_prevent_merge() personality i8* bitcast (i32 ( ; CHECK: invoke.cont0: ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1:%.*]], label [[IF_END:%.*]] @@ -1048,9 +1048,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -1068,16 +1068,16 @@ if.end: } ; Common attributes are preserved -define void @t18_attributes_are_preserved() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t18_attributes_are_preserved() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t18_attributes_are_preserved( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] @@ -1101,9 +1101,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -1121,16 +1121,16 @@ if.end: } ; Fully identical operand bundles are good. -define void @t19_compatible_operand_bundle() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t19_compatible_operand_bundle() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t19_compatible_operand_bundle( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] @@ -1154,9 +1154,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -1174,7 +1174,7 @@ if.end: } ; Operand bundles must be compatible, else we can't merge. -define void @t20_incompatible_operand_bundle() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t20_incompatible_operand_bundle() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t20_incompatible_operand_bundle( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -1185,10 +1185,10 @@ define void @t20_incompatible_operand_bundle() personality i8* bitcast (i32 (... ; CHECK: invoke.cont0: ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1:%.*]], label [[IF_END:%.*]] @@ -1212,9 +1212,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -1232,16 +1232,16 @@ if.end: } ; We need to PHI together the arguments of the operand bundles. -define void @t21_semicompatible_operand_bundle() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t21_semicompatible_operand_bundle() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t21_semicompatible_operand_bundle( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] @@ -1266,9 +1266,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -1287,16 +1287,16 @@ if.end: ; Even though the normal destinations are unreachable, ; they may have (dead) PHI nodes, so we must cleanup them. -define void @t22_dead_phi_in_normal_dest() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t22_dead_phi_in_normal_dest() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t22_dead_phi_in_normal_dest( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] @@ -1317,9 +1317,9 @@ if.then0: invoke void @maybe_throw() to label %invoke.cont0 unwind label %lpad lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -1342,18 +1342,18 @@ if.end: } ; landingpad has PHI nodes, and out of three invokes, only two have compatible incoming values. -define void @t23_phi_in_landingpad_compatible_incoming_values() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t23_phi_in_landingpad_compatible_incoming_values() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t23_phi_in_landingpad_compatible_incoming_values( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE0:%.*]] ; CHECK: lpad: ; CHECK-NEXT: [[PHI:%.*]] = phi i32 [ -1, [[IF_THEN2:%.*]] ], [ 0, [[IF_THEN1_INVOKE]] ] -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @consume(i32 [[PHI]]) ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else0: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_ELSE1:%.*]] @@ -1386,10 +1386,10 @@ invoke.cont0: lpad: %phi = phi i32 [ 0, %if.then0 ], [ 0, %if.then1 ], [ -1, %if.then2 ] - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @consume(i32 %phi) call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else0: %c1 = call i1 @cond() @@ -1418,7 +1418,7 @@ if.end: ; landingpad has two PHI nodes, but depending on which PHI you look, ; the invoke sets would be different, so we can't merge invokes here. -define void @t24_phi_in_landingpad_semi_compatible_incoming_values() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t24_phi_in_landingpad_semi_compatible_incoming_values() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t24_phi_in_landingpad_semi_compatible_incoming_values( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -1431,12 +1431,12 @@ define void @t24_phi_in_landingpad_semi_compatible_incoming_values() personality ; CHECK: lpad: ; CHECK-NEXT: [[PHI0:%.*]] = phi i32 [ 0, [[IF_THEN0]] ], [ 0, [[IF_THEN1:%.*]] ], [ -1, [[IF_THEN2:%.*]] ] ; CHECK-NEXT: [[PHI1:%.*]] = phi i32 [ 0, [[IF_THEN0]] ], [ 1, [[IF_THEN1]] ], [ 1, [[IF_THEN2]] ] -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @consume(i32 [[PHI0]]) ; CHECK-NEXT: call void @consume(i32 [[PHI1]]) ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else0: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1]], label [[IF_ELSE1:%.*]] @@ -1470,11 +1470,11 @@ invoke.cont0: lpad: %phi0 = phi i32 [ 0, %if.then0 ], [ 0, %if.then1 ], [ -1, %if.then2 ] %phi1= phi i32 [ 0, %if.then0 ], [ 1, %if.then1 ], [ 1, %if.then2 ] - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @consume(i32 %phi0) call void @consume(i32 %phi1) call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else0: %c1 = call i1 @cond() @@ -1502,7 +1502,7 @@ if.end: } ; The normal destinations are shared, but the incoming values are incompatible. -define void @t25_incompatible_phis_in_normal_destination() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t25_incompatible_phis_in_normal_destination() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t25_incompatible_phis_in_normal_destination( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -1516,10 +1516,10 @@ define void @t25_incompatible_phis_in_normal_destination() personality i8* bitca ; CHECK-NEXT: call void @sideeffect() ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1]], label [[IF_END:%.*]] @@ -1544,9 +1544,9 @@ invoke.cont: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -1561,7 +1561,7 @@ if.end: } ; shared normal destination has PHI nodes, and out of three invokes, only two have compatible incoming values. -define void @t26_phi_in_normal_dest_compatible_incoming_values() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t26_phi_in_normal_dest_compatible_incoming_values() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t26_phi_in_normal_dest_compatible_incoming_values( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -1572,10 +1572,10 @@ define void @t26_phi_in_normal_dest_compatible_incoming_values() personality i8* ; CHECK-NEXT: call void @sideeffect() ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else0: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_ELSE1:%.*]] @@ -1606,9 +1606,9 @@ invoke.cont: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else0: %c1 = call i1 @cond() @@ -1630,7 +1630,7 @@ if.end: } ; Invokes return values, but they are unused. -define void @t27_invoke_ret_value_is_used() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t27_invoke_ret_value_is_used() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t27_invoke_ret_value_is_used( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -1639,10 +1639,10 @@ define void @t27_invoke_ret_value_is_used() personality i8* bitcast (i32 (...)* ; CHECK-NEXT: call void @sideeffect() ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] @@ -1665,9 +1665,9 @@ invoke.cont: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -1682,7 +1682,7 @@ if.end: } ; Invokes return values, and they are used in a phi node, making the incoming values incompatible. -define void @t28_invoke_ret_value_is_used_in_phi_node() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t28_invoke_ret_value_is_used_in_phi_node() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t28_invoke_ret_value_is_used_in_phi_node( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -1692,10 +1692,10 @@ define void @t28_invoke_ret_value_is_used_in_phi_node() personality i8* bitcast ; CHECK-NEXT: call void @sideeffect() ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] @@ -1720,9 +1720,9 @@ invoke.cont: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -1737,7 +1737,7 @@ if.end: } ; out of three invokes, two share normal destination and another one has unreachable destination -define void @t29_common_normal_destination_and_unreachable_normal_destination() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t29_common_normal_destination_and_unreachable_normal_destination() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t29_common_normal_destination_and_unreachable_normal_destination( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -1746,10 +1746,10 @@ define void @t29_common_normal_destination_and_unreachable_normal_destination() ; CHECK-NEXT: call void @sideeffect() ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else0: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_ELSE1:%.*]] @@ -1780,9 +1780,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else0: %c1 = call i1 @cond() @@ -1807,7 +1807,7 @@ if.end: } ; normal destinations are not unreachable and different but could be merged -define void @t30_completely_different_normal_dests() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t30_completely_different_normal_dests() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t30_completely_different_normal_dests( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -1819,10 +1819,10 @@ define void @t30_completely_different_normal_dests() personality i8* bitcast (i3 ; CHECK-NEXT: call void @sideeffect() ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1:%.*]], label [[IF_END:%.*]] @@ -1848,9 +1848,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -1871,16 +1871,16 @@ if.end: ; Even though the normal destinations are unreachable, ; they may have (dead) PHI nodes with incompatible incoming values, ; so we must cleanup them. -define void @t31_incompatible_dead_phi_in_normal_dest() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t31_incompatible_dead_phi_in_normal_dest() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t31_incompatible_dead_phi_in_normal_dest( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] @@ -1901,9 +1901,9 @@ if.then0: invoke void @maybe_throw() to label %invoke.cont unwind label %lpad lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -1923,7 +1923,7 @@ if.end: ; Invokes return values, and they are used in a phi node, making the incoming values incompatible, ; second phi has compatible incoming values -define void @t32_invoke_ret_value_is_used_in_phi_node_other_phi_is_fine() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t32_invoke_ret_value_is_used_in_phi_node_other_phi_is_fine() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t32_invoke_ret_value_is_used_in_phi_node_other_phi_is_fine( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -1934,10 +1934,10 @@ define void @t32_invoke_ret_value_is_used_in_phi_node_other_phi_is_fine() person ; CHECK-NEXT: call void @sideeffect() ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] @@ -1964,9 +1964,9 @@ invoke.cont: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -1982,7 +1982,7 @@ if.end: ; Invokes return values, and they are used in a phi node, making the incoming values incompatible, ; second phi has incompatible incoming values. -define void @t33_invoke_ret_value_is_used_in_phi_node_other_phi_is_bad() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t33_invoke_ret_value_is_used_in_phi_node_other_phi_is_bad() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t33_invoke_ret_value_is_used_in_phi_node_other_phi_is_bad( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -1998,10 +1998,10 @@ define void @t33_invoke_ret_value_is_used_in_phi_node_other_phi_is_bad() persona ; CHECK-NEXT: call void @sideeffect() ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1]], label [[IF_END:%.*]] @@ -2028,9 +2028,9 @@ invoke.cont: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -2046,7 +2046,7 @@ if.end: ; Invokes return values, and they are used in a phi node, but when coming from different invokes, ; the incoming value isn't always the invoke, which is not okay. -define void @t34_invoke_ret_value_maybe_incompatibly_used_in_phi_node() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t34_invoke_ret_value_maybe_incompatibly_used_in_phi_node() personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t34_invoke_ret_value_maybe_incompatibly_used_in_phi_node( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() @@ -2062,10 +2062,10 @@ define void @t34_invoke_ret_value_maybe_incompatibly_used_in_phi_node() personal ; CHECK-NEXT: call void @sideeffect() ; CHECK-NEXT: unreachable ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1]], label [[IF_END:%.*]] @@ -2092,9 +2092,9 @@ invoke.cont: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -2109,16 +2109,16 @@ if.end: } ; Two mergeable indirect calls, with identical callees. -define void @t35_identical_indirect_callees(void()* %callee) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t35_identical_indirect_callees(ptr %callee) personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t35_identical_indirect_callees( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] @@ -2142,9 +2142,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -2162,21 +2162,21 @@ if.end: } ; Two mergeable indirect calls, with different callees. -define void @t36_different_indirect_callees(void()* %callee0, void()* %callee1) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t36_different_indirect_callees(ptr %callee0, ptr %callee1) personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t36_different_indirect_callees( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] ; CHECK: if.then1.invoke: -; CHECK-NEXT: [[TMP0:%.*]] = phi void ()* [ [[CALLEE1:%.*]], [[IF_ELSE]] ], [ [[CALLEE0:%.*]], [[ENTRY:%.*]] ] +; CHECK-NEXT: [[TMP0:%.*]] = phi ptr [ [[CALLEE1:%.*]], [[IF_ELSE]] ], [ [[CALLEE0:%.*]], [[ENTRY:%.*]] ] ; CHECK-NEXT: invoke void [[TMP0]]() ; CHECK-NEXT: to label [[IF_THEN1_CONT:%.*]] unwind label [[LPAD:%.*]] ; CHECK: if.then1.cont: @@ -2196,9 +2196,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -2216,16 +2216,16 @@ if.end: } ; Don't merge direct invoke with indirect ones. -define void @t37_three_invokes_two_indirect_one_direct(void()* %callee) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t37_three_invokes_two_indirect_one_direct(ptr %callee) personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t37_three_invokes_two_indirect_one_direct( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE0:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else0: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_ELSE1:%.*]] @@ -2257,9 +2257,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else0: %c1 = call i1 @cond() @@ -2287,22 +2287,22 @@ if.end: } ; For indirect invokes, different arguments are fine. -define void @t38_different_arguments_and_operand_bundes_are_fine(void(i32)* %callee0, void(i32)* %callee1) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t38_different_arguments_and_operand_bundes_are_fine(ptr %callee0, ptr %callee1) personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t38_different_arguments_and_operand_bundes_are_fine( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] ; CHECK: if.then1.invoke: ; CHECK-NEXT: [[TMP0:%.*]] = phi i32 [ 42, [[IF_ELSE]] ], [ 0, [[ENTRY:%.*]] ] -; CHECK-NEXT: [[TMP1:%.*]] = phi void (i32)* [ [[CALLEE1:%.*]], [[IF_ELSE]] ], [ [[CALLEE0:%.*]], [[ENTRY]] ] +; CHECK-NEXT: [[TMP1:%.*]] = phi ptr [ [[CALLEE1:%.*]], [[IF_ELSE]] ], [ [[CALLEE0:%.*]], [[ENTRY]] ] ; CHECK-NEXT: invoke void [[TMP1]](i32 [[TMP0]]) ; CHECK-NEXT: to label [[IF_THEN1_CONT:%.*]] unwind label [[LPAD:%.*]] ; CHECK: if.then1.cont: @@ -2322,9 +2322,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -2342,22 +2342,22 @@ if.end: } ; For indirect invokes, different operand bundle arguments are fine. -define void @t39_different_arguments_and_operand_bundes_are_fine(void()* %callee0, void()* %callee1) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t39_different_arguments_and_operand_bundes_are_fine(ptr %callee0, ptr %callee1) personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t39_different_arguments_and_operand_bundes_are_fine( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] ; CHECK: if.then1.invoke: ; CHECK-NEXT: [[TMP0:%.*]] = phi i32 [ 0, [[IF_ELSE]] ], [ 42, [[ENTRY:%.*]] ] -; CHECK-NEXT: [[TMP1:%.*]] = phi void ()* [ [[CALLEE1:%.*]], [[IF_ELSE]] ], [ [[CALLEE0:%.*]], [[ENTRY]] ] +; CHECK-NEXT: [[TMP1:%.*]] = phi ptr [ [[CALLEE1:%.*]], [[IF_ELSE]] ], [ [[CALLEE0:%.*]], [[ENTRY]] ] ; CHECK-NEXT: invoke void [[TMP1]]() [ "abc"(i32 [[TMP0]]) ] ; CHECK-NEXT: to label [[IF_THEN1_CONT:%.*]] unwind label [[LPAD:%.*]] ; CHECK: if.then1.cont: @@ -2377,9 +2377,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() @@ -2397,23 +2397,23 @@ if.end: } ; For indirect invokes, both different arguments and operand bundle arguments are fine. -define void @t40_different_arguments_and_operand_bundes_are_fine(void(i32)* %callee0, void(i32)* %callee1) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @t40_different_arguments_and_operand_bundes_are_fine(ptr %callee0, ptr %callee1) personality ptr @__gxx_personality_v0 { ; CHECK-LABEL: @t40_different_arguments_and_operand_bundes_are_fine( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[C0:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C0]], label [[IF_THEN1_INVOKE:%.*]], label [[IF_ELSE:%.*]] ; CHECK: lpad: -; CHECK-NEXT: [[EH:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: call void @destructor() -; CHECK-NEXT: resume { i8*, i32 } [[EH]] +; CHECK-NEXT: resume { ptr, i32 } [[EH]] ; CHECK: if.else: ; CHECK-NEXT: [[C1:%.*]] = call i1 @cond() ; CHECK-NEXT: br i1 [[C1]], label [[IF_THEN1_INVOKE]], label [[IF_END:%.*]] ; CHECK: if.then1.invoke: ; CHECK-NEXT: [[TMP0:%.*]] = phi i32 [ 42, [[IF_ELSE]] ], [ 0, [[ENTRY:%.*]] ] ; CHECK-NEXT: [[TMP1:%.*]] = phi i32 [ 0, [[IF_ELSE]] ], [ 42, [[ENTRY]] ] -; CHECK-NEXT: [[TMP2:%.*]] = phi void (i32)* [ [[CALLEE1:%.*]], [[IF_ELSE]] ], [ [[CALLEE0:%.*]], [[ENTRY]] ] +; CHECK-NEXT: [[TMP2:%.*]] = phi ptr [ [[CALLEE1:%.*]], [[IF_ELSE]] ], [ [[CALLEE0:%.*]], [[ENTRY]] ] ; CHECK-NEXT: invoke void [[TMP2]](i32 [[TMP0]]) [ "abc"(i32 [[TMP1]]) ] ; CHECK-NEXT: to label [[IF_THEN1_CONT:%.*]] unwind label [[LPAD:%.*]] ; CHECK: if.then1.cont: @@ -2433,9 +2433,9 @@ invoke.cont0: unreachable lpad: - %eh = landingpad { i8*, i32 } cleanup + %eh = landingpad { ptr, i32 } cleanup call void @destructor() - resume { i8*, i32 } %eh + resume { ptr, i32 } %eh if.else: %c1 = call i1 @cond() diff --git a/llvm/test/Transforms/SimplifyCFG/X86/merge-cond-stores-cost.ll b/llvm/test/Transforms/SimplifyCFG/X86/merge-cond-stores-cost.ll index 2edf2fa47a5628..244400925c9eb5 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/merge-cond-stores-cost.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/merge-cond-stores-cost.ll @@ -1,21 +1,21 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -mtriple=x86_64-unknown-unknown < %s -simplifycfg-merge-cond-stores=true -simplifycfg-merge-cond-stores-aggressively=false -phi-node-folding-threshold=2 -S | FileCheck %s -define void @test_costly(i32* %p, i32 %a, i32 %b, i32 %c, i32 %d) { +define void @test_costly(ptr %p, i32 %a, i32 %b, i32 %c, i32 %d) { ; CHECK-LABEL: @test_costly( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[X1:%.*]] = icmp eq i32 [[A:%.*]], 0 ; CHECK-NEXT: br i1 [[X1]], label [[FALLTHROUGH:%.*]], label [[YES1:%.*]] ; CHECK: yes1: ; CHECK-NEXT: [[VAL0:%.*]] = sdiv i32 [[D:%.*]], [[C:%.*]] -; CHECK-NEXT: store i32 [[VAL0]], i32* [[P:%.*]], align 4 +; CHECK-NEXT: store i32 [[VAL0]], ptr [[P:%.*]], align 4 ; CHECK-NEXT: br label [[FALLTHROUGH]] ; CHECK: fallthrough: ; CHECK-NEXT: [[X2:%.*]] = icmp eq i32 [[B:%.*]], 0 ; CHECK-NEXT: br i1 [[X2]], label [[END:%.*]], label [[YES2:%.*]] ; CHECK: yes2: ; CHECK-NEXT: [[VAL1:%.*]] = sdiv i32 [[C]], [[D]] -; CHECK-NEXT: store i32 [[VAL1]], i32* [[P]], align 4 +; CHECK-NEXT: store i32 [[VAL1]], ptr [[P]], align 4 ; CHECK-NEXT: br label [[END]] ; CHECK: end: ; CHECK-NEXT: ret void @@ -26,7 +26,7 @@ entry: yes1: %val0 = sdiv i32 %d, %c - store i32 %val0, i32* %p + store i32 %val0, ptr %p br label %fallthrough fallthrough: @@ -35,7 +35,7 @@ fallthrough: yes2: %val1 = sdiv i32 %c, %d - store i32 %val1, i32* %p + store i32 %val1, ptr %p br label %end end: diff --git a/llvm/test/Transforms/SimplifyCFG/X86/pr39187-g.ll b/llvm/test/Transforms/SimplifyCFG/X86/pr39187-g.ll index e5683b93550408..52dc284c795948 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/pr39187-g.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/pr39187-g.ll @@ -33,9 +33,8 @@ ; CHECK-LABEL: entry ; CHECK: %foo = alloca i32, align 4 ; CHECK: %face = alloca i8, align 1 -; CHECK: %foo.0..sroa_cast = bitcast i32* %foo to i8* -; CHECK: store volatile i32 0, i32* %foo, align 4 -; CHECK: %foo.0. = load volatile i32, i32* %foo, align 4, !dbg !16 +; CHECK: store volatile i32 0, ptr %foo, align 4 +; CHECK: %foo.0. = load volatile i32, ptr %foo, align 4, !dbg !16 ; CHECK: %cmp = icmp eq i32 %foo.0., 4, !dbg !16 ; CHECK: %frombool = zext i1 %cmp to i8, !dbg !16 ; CHECK: call void @llvm.dbg.value(metadata i8 %frombool, metadata !13, metadata !DIExpression()), !dbg !16 @@ -53,9 +52,8 @@ define dso_local i32 @main() local_unnamed_addr #0 !dbg !7 { entry: %foo = alloca i32, align 4 %face = alloca i8, align 1 - %foo.0..sroa_cast = bitcast i32* %foo to i8* - store volatile i32 0, i32* %foo, align 4 - %foo.0. = load volatile i32, i32* %foo, align 4, !dbg !26 + store volatile i32 0, ptr %foo, align 4 + %foo.0. = load volatile i32, ptr %foo, align 4, !dbg !26 %cmp = icmp eq i32 %foo.0., 4, !dbg !26 %frombool = zext i1 %cmp to i8, !dbg !26 call void @llvm.dbg.value(metadata i8 %frombool, metadata !15, metadata !DIExpression()), !dbg !26 @@ -72,8 +70,8 @@ if.else: ; preds = %entry if.end: ; preds = %if.else, %if.then %beards.0 = phi i32 [ 8, %if.then ], [ 4, %if.else ] - store volatile i8 %frombool, i8* %face, align 1 - %face.0. = load volatile i8, i8* %face, align 1 + store volatile i8 %frombool, ptr %face, align 1 + %face.0. = load volatile i8, ptr %face, align 1 %0 = and i8 %face.0., 1 %tobool3 = icmp eq i8 %0, 0 %cond4 = select i1 %tobool3, i32 0, i32 %beards.0 diff --git a/llvm/test/Transforms/SimplifyCFG/X86/remove-debug-2.ll b/llvm/test/Transforms/SimplifyCFG/X86/remove-debug-2.ll index 5aaaade050ce2d..ebf07263456dd8 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/remove-debug-2.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/remove-debug-2.ll @@ -26,18 +26,18 @@ target triple = "x86_64-unknown-linux-gnu" define i32 @foo(i32) !dbg !6 { %2 = alloca i32, align 4 %3 = alloca i32, align 4 - store i32 %0, i32* %2, align 4 - store i32 1, i32* %3, align 4, !dbg !14 - %4 = load i32, i32* %2, align 4, !dbg !15 + store i32 %0, ptr %2, align 4 + store i32 1, ptr %3, align 4, !dbg !14 + %4 = load i32, ptr %2, align 4, !dbg !15 %5 = icmp ne i32 %4, 0, !dbg !15 br i1 %5, label %6, label %7, !dbg !17 ;