1 ; RUN: opt < %s -inline -S | grep "define internal i32 @bar" 2 @llvm.noinline = appending global [1 x i8*] [ i8* bitcast (i32 (i32, i32)* @bar to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] 3 4 define internal i32 @bar(i32 %x, i32 %y) { 5 entry: 6 %x_addr = alloca i32 ; <i32*> [#uses=2] 7 %y_addr = alloca i32 ; <i32*> [#uses=2] 8 %retval = alloca i32, align 4 ; <i32*> [#uses=2] 9 %tmp = alloca i32, align 4 ; <i32*> [#uses=2] 10 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] 11 store i32 %x, i32* %x_addr 12 store i32 %y, i32* %y_addr 13 %tmp1 = load i32* %x_addr ; <i32> [#uses=1] 14 %tmp2 = load i32* %y_addr ; <i32> [#uses=1] 15 %tmp3 = add i32 %tmp1, %tmp2 ; <i32> [#uses=1] 16 store i32 %tmp3, i32* %tmp 17 %tmp4 = load i32* %tmp ; <i32> [#uses=1] 18 store i32 %tmp4, i32* %retval 19 br label %return 20 21 return: ; preds = %entry 22 %retval5 = load i32* %retval ; <i32> [#uses=1] 23 ret i32 %retval5 24 } 25 26 define i32 @foo(i32 %a, i32 %b) { 27 entry: 28 %a_addr = alloca i32 ; <i32*> [#uses=2] 29 %b_addr = alloca i32 ; <i32*> [#uses=2] 30 %retval = alloca i32, align 4 ; <i32*> [#uses=2] 31 %tmp = alloca i32, align 4 ; <i32*> [#uses=2] 32 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] 33 store i32 %a, i32* %a_addr 34 store i32 %b, i32* %b_addr 35 %tmp1 = load i32* %b_addr ; <i32> [#uses=1] 36 %tmp2 = load i32* %a_addr ; <i32> [#uses=1] 37 %tmp3 = call i32 @bar( i32 %tmp1, i32 %tmp2 ) ; <i32> [#uses=1] 38 store i32 %tmp3, i32* %tmp 39 %tmp4 = load i32* %tmp ; <i32> [#uses=1] 40 store i32 %tmp4, i32* %retval 41 br label %return 42 43 return: ; preds = %entry 44 %retval5 = load i32* %retval ; <i32> [#uses=1] 45 ret i32 %retval5 46 } 47