1 ; RUN: llc -march=hexagon -mcpu=hexagonv5 <%s | \
2 ; RUN: FileCheck %s --check-prefix=CHECK-ONE
3 ; RUN: llc -march=hexagon -mcpu=hexagonv5 <%s | \
4 ; RUN: FileCheck %s --check-prefix=CHECK-TWO
5 ; RUN: llc -march=hexagon -mcpu=hexagonv5 <%s | \
6 ; RUN: FileCheck %s --check-prefix=CHECK-THREE
8 %struct.test_struct = type { i32, i8, i64 }
9 %struct.test_struct_long = type { i8, i64 }
11 @mystruct = external global %struct.test_struct*, align 4
13 ; CHECK-ONE: memw(r29+#48) = r2
14 ; CHECK-TWO: memw(r29+#52) = r2
15 ; CHECK-THREE: memw(r29+#56) = r2
16 ; Function Attrs: nounwind
17 define void @foo(%struct.test_struct* noalias sret %agg.result, i32 %a, i8 zeroext %c, %struct.test_struct* byval %s, %struct.test_struct_long* byval %t) #0 {
19 %a.addr = alloca i32, align 4
20 %c.addr = alloca i8, align 1
21 %z = alloca i32, align 4
22 %ret = alloca %struct.test_struct, align 8
23 store i32 %a, i32* %a.addr, align 4
24 store i8 %c, i8* %c.addr, align 1
25 %0 = bitcast i32* %z to i8*
26 call void @llvm.lifetime.start(i64 4, i8* %0) #1
27 store i32 45, i32* %z, align 4
28 %1 = bitcast %struct.test_struct* %ret to i8*
29 call void @llvm.lifetime.start(i64 16, i8* %1) #1
30 %2 = load i32, i32* %z, align 4
31 %3 = load %struct.test_struct*, %struct.test_struct** @mystruct, align 4
32 %4 = load %struct.test_struct*, %struct.test_struct** @mystruct, align 4
33 %5 = load i8, i8* %c.addr, align 1
34 %6 = load i32, i32* %a.addr, align 4
35 %conv = sext i32 %6 to i64
36 %add = add nsw i64 %conv, 1
37 %7 = load i32, i32* %a.addr, align 4
38 %add1 = add nsw i32 %7, 2
39 %8 = load i32, i32* %a.addr, align 4
40 %conv2 = sext i32 %8 to i64
41 %add3 = add nsw i64 %conv2, 3
42 %9 = load i8, i8* %c.addr, align 1
43 %10 = load i8, i8* %c.addr, align 1
44 %11 = load i8, i8* %c.addr, align 1
45 %12 = load i32, i32* %z, align 4
46 call void @bar(%struct.test_struct* sret %ret, i32 %2, %struct.test_struct* byval %3, %struct.test_struct* byval %4, i8 zeroext %5, i64 %add, i32 %add1, i64 %add3, i8 zeroext %9, i8 zeroext %10, i8 zeroext %11, i32 %12)
47 %x = getelementptr inbounds %struct.test_struct, %struct.test_struct* %ret, i32 0, i32 0
48 store i32 20, i32* %x, align 4
49 %13 = bitcast %struct.test_struct* %agg.result to i8*
50 %14 = bitcast %struct.test_struct* %ret to i8*
51 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %13, i8* %14, i32 16, i32 8, i1 false)
52 %15 = bitcast %struct.test_struct* %ret to i8*
53 call void @llvm.lifetime.end(i64 16, i8* %15) #1
54 %16 = bitcast i32* %z to i8*
55 call void @llvm.lifetime.end(i64 4, i8* %16) #1
59 ; Function Attrs: nounwind
60 declare void @llvm.lifetime.start(i64, i8* nocapture) #1
62 declare void @bar(%struct.test_struct* sret, i32, %struct.test_struct* byval, %struct.test_struct* byval, i8 zeroext, i64, i32, i64, i8 zeroext, i8 zeroext, i8 zeroext, i32) #2
64 ; Function Attrs: nounwind
65 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1) #1
67 ; Function Attrs: nounwind
68 declare void @llvm.lifetime.end(i64, i8* nocapture) #1
70 attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="hexagonv4" "unsafe-fp-math"="false" "use-soft-float"="false" }
71 attributes #1 = { nounwind }
72 attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="hexagonv4" "unsafe-fp-math"="false" "use-soft-float"="false" }