1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
2 ; RUN: opt < %s -passes=argpromotion -S | FileCheck %s
4 define internal i32 @deref(i32* %x) nounwind {
5 ; CHECK-LABEL: define {{[^@]+}}@deref
6 ; CHECK-SAME: (i32 [[X_VAL:%.*]])
8 ; CHECK-NEXT: ret i32 [[X_VAL]]
11 %tmp2 = load i32, i32* %x, align 4
15 define i32 @f(i32 %x) {
16 ; CHECK-LABEL: define {{[^@]+}}@f
17 ; CHECK-SAME: (i32 [[X:%.*]])
19 ; CHECK-NEXT: [[X_ADDR:%.*]] = alloca i32
20 ; CHECK-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4
21 ; CHECK-NEXT: [[X_ADDR_VAL:%.*]] = load i32, i32* [[X_ADDR]], align 4
22 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @deref(i32 [[X_ADDR_VAL]])
23 ; CHECK-NEXT: ret i32 [[TMP1]]
27 store i32 %x, i32* %x_addr, align 4
28 %tmp1 = call i32 @deref( i32* %x_addr ) nounwind