1 ; RUN: llc -O3 -march=hexagon -hexagon-small-data-threshold=0 -disable-packetizer < %s | FileCheck %s
3 ; This test was orignally written to test that we don't save an entire double
4 ; register if only one of the integer registers needs to be saved. The problem
5 ; occurs in exception handling, which only emit information for the registers
6 ; in the callee saved list (and not complete double registers unless both
7 ; parts of the double registers are used).
8 ; Overtime, we evolved in to saving the double register and updating the debug
9 ; information to cover the entire double register.
11 ; Disable the packetizer to avoid complications caused by potentially
12 ; packetizing one of the stores with allocframe, which would change the
13 ; relative order of the stores with the CFI instructions.
15 ; CHECK: cfi_startproc
16 ; CHECK-DAG: cfi_offset r16
17 ; CHECK-DAG: cfi_offset r17
18 ; CHECK-DAG: cfi_offset r18
19 ; CHECK-DAG: cfi_offset r19
20 ; CHECK: memd(r29+{{.*}}) = r17:16
21 ; CHECK: memd(r29+{{.*}}) = r19:18
25 @g0 = global i32 0, align 4
26 @g1 = external constant ptr
28 ; Function Attrs: noreturn
29 define void @f0(i64 %a0) #0 personality ptr @f2 {
31 %v0 = alloca %s.0, align 4
32 %v1 = trunc i64 %a0 to i32
33 %v2 = lshr i64 %a0, 32
34 %v3 = trunc i64 %v2 to i32
35 store i32 0, ptr %v0, align 4, !tbaa !0
36 %v5 = load i32, ptr @g0, align 4, !tbaa !5
38 store i32 %v6, ptr @g0, align 4, !tbaa !5
39 %v7 = call ptr @f1(i32 4) #1
40 %v10 = getelementptr inbounds i8, ptr %v0, i32 %v3
42 %v13 = icmp eq i32 %v12, 0
43 br i1 %v13, label %b2, label %b1
46 %v15 = load ptr, ptr %v10, align 4
47 %v16 = add i32 %v1, -1
48 %v17 = getelementptr i8, ptr %v15, i32 %v16
49 %v19 = load ptr, ptr %v17, align 4
53 %v20 = inttoptr i32 %v1 to ptr
56 b3: ; preds = %b2, %b1
57 %v21 = phi ptr [ %v19, %b1 ], [ %v20, %b2 ]
58 %v22 = invoke i32 %v21(ptr %v10)
59 to label %b4 unwind label %b5
62 store i32 %v22, ptr %v7, align 4, !tbaa !5
63 call void @f4(ptr %v7, ptr @g1, ptr null) #2
67 %v23 = landingpad { ptr, i32 }
69 call void @f3(ptr %v7) #1
70 resume { ptr, i32 } %v23
79 declare void @f4(ptr, ptr, ptr)
81 attributes #0 = { noreturn "target-cpu"="hexagonv55" }
82 attributes #1 = { nounwind }
83 attributes #2 = { noreturn }
86 !1 = !{!"_ZTS1A", !2, i64 0}
87 !2 = !{!"int", !3, i64 0}
88 !3 = !{!"omnipotent char", !4, i64 0}
89 !4 = !{!"Simple C/C++ TBAA"}