1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
2 ; RUN: opt -passes=argpromotion -S %s | FileCheck %s
4 %struct.A = type { float, [12 x i8], i64, [8 x i8] }
6 define internal float @callee(ptr byval(%struct.A) align 32 %0) {
7 ; CHECK-LABEL: define {{[^@]+}}@callee
8 ; CHECK-SAME: (float [[DOT0_VAL:%.*]], i64 [[DOT16_VAL:%.*]]) {
9 ; CHECK-NEXT: [[TMP1:%.*]] = fadd float 0.000000e+00, [[DOT0_VAL]]
10 ; CHECK-NEXT: [[TMP2:%.*]] = uitofp i64 [[DOT16_VAL]] to float
11 ; CHECK-NEXT: [[TMP3:%.*]] = fmul float [[TMP1]], [[TMP2]]
12 ; CHECK-NEXT: ret float [[TMP3]]
14 %2 = load float, ptr %0, align 32
15 %3 = fadd float 0.000000e+00, %2
16 %4 = getelementptr inbounds %struct.A, ptr %0, i32 0, i32 2
17 %5 = load i64, ptr %4, align 16
18 %6 = uitofp i64 %5 to float
19 %7 = fmul float %3, %6
23 define float @caller(float %0) {
24 ; CHECK-LABEL: define {{[^@]+}}@caller
25 ; CHECK-SAME: (float [[TMP0:%.*]]) {
26 ; CHECK-NEXT: [[TMP2:%.*]] = alloca [[STRUCT_A:%.*]], align 32
27 ; CHECK-NEXT: store float [[TMP0]], ptr [[TMP2]], align 32
28 ; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT_A]], ptr [[TMP2]], i32 0, i32 2
29 ; CHECK-NEXT: store i64 2, ptr [[TMP3]], align 16
30 ; CHECK-NEXT: [[DOTVAL:%.*]] = load float, ptr [[TMP2]], align 32
31 ; CHECK-NEXT: [[TMP4:%.*]] = getelementptr i8, ptr [[TMP2]], i64 16
32 ; CHECK-NEXT: [[DOTVAL1:%.*]] = load i64, ptr [[TMP4]], align 16
33 ; CHECK-NEXT: [[TMP5:%.*]] = call noundef float @callee(float [[DOTVAL]], i64 [[DOTVAL1]])
34 ; CHECK-NEXT: ret float [[TMP5]]
36 %2 = alloca %struct.A, align 32
37 store float %0, ptr %2, align 32
38 %3 = getelementptr inbounds %struct.A, ptr %2, i32 0, i32 2
39 store i64 2, ptr %3, align 16
40 %4 = call noundef float @callee(ptr byval(%struct.A) align 32 %2)