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 -pass-remarks-output=%t | FileCheck %s
3 ; RUN: cat %t | FileCheck -check-prefix=REMARK %s
5 define internal i32 @deref(ptr %x) nounwind {
6 ; CHECK-LABEL: define {{[^@]+}}@deref
7 ; CHECK-SAME: (i32 [[X_0_VAL:%.*]]) #[[ATTR0:[0-9]+]] {
9 ; CHECK-NEXT: ret i32 [[X_0_VAL]]
11 ; REMARK-LABEL: Function: deref
13 ; REMARK-NEXT: - String: 'promoting argument '
14 ; REMARK-NEXT: - ArgName: x
15 ; REMARK-NEXT: - String: '('
16 ; REMARK-NEXT: - ArgIndex: '0'
17 ; REMARK-NEXT: - String: ')'
18 ; REMARK-NEXT: - String: ' to pass by value'
21 %temp2 = load i32, ptr %x, align 4
25 define i32 @f(i32 %x) {
26 ; CHECK-LABEL: define {{[^@]+}}@f
27 ; CHECK-SAME: (i32 [[X:%.*]]) {
29 ; CHECK-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4
30 ; CHECK-NEXT: store i32 [[X]], ptr [[X_ADDR]], align 4
31 ; CHECK-NEXT: [[X_ADDR_VAL:%.*]] = load i32, ptr [[X_ADDR]], align 4
32 ; CHECK-NEXT: [[TEMP1:%.*]] = call i32 @deref(i32 [[X_ADDR_VAL]])
33 ; CHECK-NEXT: ret i32 [[TEMP1]]
37 store i32 %x, ptr %x_addr, align 4
38 %temp1 = call i32 @deref( ptr %x_addr ) nounwind