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 i8*
28 ; Function Attrs: noreturn
29 define void @f0(i64 %a0) #0 personality i8* bitcast (i32 (...)* @f2 to i8*) {
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 %v4 = getelementptr inbounds %s.0, %s.0* %v0, i32 0, i32 0
36 store i32 0, i32* %v4, align 4, !tbaa !0
37 %v5 = load i32, i32* @g0, align 4, !tbaa !5
39 store i32 %v6, i32* @g0, align 4, !tbaa !5
40 %v7 = call i8* @f1(i32 4) #1
41 %v8 = bitcast i8* %v7 to i32*
42 %v9 = bitcast %s.0* %v0 to i8*
43 %v10 = getelementptr inbounds i8, i8* %v9, i32 %v3
44 %v11 = bitcast i8* %v10 to %s.0*
46 %v13 = icmp eq i32 %v12, 0
47 br i1 %v13, label %b2, label %b1
50 %v14 = bitcast i8* %v10 to i8**
51 %v15 = load i8*, i8** %v14, align 4
52 %v16 = add i32 %v1, -1
53 %v17 = getelementptr i8, i8* %v15, i32 %v16
54 %v18 = bitcast i8* %v17 to i32 (%s.0*)**
55 %v19 = load i32 (%s.0*)*, i32 (%s.0*)** %v18, align 4
59 %v20 = inttoptr i32 %v1 to i32 (%s.0*)*
62 b3: ; preds = %b2, %b1
63 %v21 = phi i32 (%s.0*)* [ %v19, %b1 ], [ %v20, %b2 ]
64 %v22 = invoke i32 %v21(%s.0* %v11)
65 to label %b4 unwind label %b5
68 store i32 %v22, i32* %v8, align 4, !tbaa !5
69 call void @f4(i8* %v7, i8* bitcast (i8** @g1 to i8*), i8* null) #2
73 %v23 = landingpad { i8*, i32 }
75 call void @f3(i8* %v7) #1
76 resume { i8*, i32 } %v23
85 declare void @f4(i8*, i8*, i8*)
87 attributes #0 = { noreturn "target-cpu"="hexagonv55" }
88 attributes #1 = { nounwind }
89 attributes #2 = { noreturn }
92 !1 = !{!"_ZTS1A", !2, i64 0}
93 !2 = !{!"int", !3, i64 0}
94 !3 = !{!"omnipotent char", !4, i64 0}
95 !4 = !{!"Simple C/C++ TBAA"}