brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · ac50bdf Raw
69 lines · plain
1; RUN: llc < %s -enable-tail-merge | FileCheck %s2; Check that calls to baz and quux are tail-merged.3; PR16284 5; CHECK: bl _baz6; CHECK-NOT: bl _baz7; CHECK: bl _quux8; CHECK-NOT: bl _quux9 10; ModuleID = 'tail.c'11target triple = "arm-apple-darwin8"12 13define i32 @f(i32 %i, i32 %q) {14entry:15	%i_addr = alloca i32		; <ptr> [#uses=2]16	%q_addr = alloca i32		; <ptr> [#uses=2]17	%retval = alloca i32, align 4		; <ptr> [#uses=1]18	store i32 %i, ptr %i_addr19	store i32 %q, ptr %q_addr20	%tmp = load i32, ptr %i_addr		; <i32> [#uses=1]21	%tmp1 = icmp ne i32 %tmp, 0		; <i1> [#uses=1]22	%tmp12 = zext i1 %tmp1 to i8		; <i8> [#uses=1]23	%toBool = icmp ne i8 %tmp12, 0		; <i1> [#uses=1]24	br i1 %toBool, label %cond_true, label %cond_false25 26cond_true:		; preds = %entry27	%tmp3 = call i32 (...) @bar( )		; <i32> [#uses=0]28	%tmp4 = call i32 (...) @baz( i32 5, i32 6 )		; <i32> [#uses=0]29	br label %cond_next30 31cond_false:		; preds = %entry32	%tmp5 = call i32 (...) @foo( )		; <i32> [#uses=0]33	%tmp6 = call i32 (...) @baz( i32 5, i32 6 )		; <i32> [#uses=0]34	br label %cond_next35 36cond_next:		; preds = %cond_false, %cond_true37	%tmp7 = load i32, ptr %q_addr		; <i32> [#uses=1]38	%tmp8 = icmp ne i32 %tmp7, 0		; <i1> [#uses=1]39	%tmp89 = zext i1 %tmp8 to i8		; <i8> [#uses=1]40	%toBool10 = icmp ne i8 %tmp89, 0		; <i1> [#uses=1]41	br i1 %toBool10, label %cond_true11, label %cond_false1542 43cond_true11:		; preds = %cond_next44	%tmp13 = call i32 (...) @foo( )		; <i32> [#uses=0]45	%tmp14 = call i32 (...) @quux( i32 3, i32 4 )		; <i32> [#uses=0]46	br label %cond_next1847 48cond_false15:		; preds = %cond_next49	%tmp16 = call i32 (...) @bar( )		; <i32> [#uses=0]50	%tmp17 = call i32 (...) @quux( i32 3, i32 4 )		; <i32> [#uses=0]51	br label %cond_next1852 53cond_next18:		; preds = %cond_false15, %cond_true1154	%tmp19 = call i32 (...) @bar( )		; <i32> [#uses=0]55	br label %return56 57return:		; preds = %cond_next1858	%retval20 = load i32, ptr %retval		; <i32> [#uses=1]59	ret i32 %retval2060}61 62declare i32 @bar(...)63 64declare i32 @baz(...)65 66declare i32 @foo(...)67 68declare i32 @quux(...)69