1 ; Check that a callee-saved register will be saved correctly if
2 ; the predicate-to-GPR spilling code uses it.
4 ; RUN: llc -march=hexagon -hexagon-initial-cfg-cleanup=0 < %s | FileCheck %s
6 ; We expect to spill p0 into a general-purpose register and keep it there,
7 ; without adding an extra spill of that register.
10 ; CHECK-DAG: r{{[0-9]+}} = p0
11 ; CHECK-DAG: p0 = r{{[0-9]+}}
12 ; CHECK-NOT: = memw(r29
15 define void @PredSpill() {
17 br i1 undef, label %if.then, label %if.else.14
19 if.then: ; preds = %entry
20 br i1 undef, label %if.end.57, label %if.else
22 if.else: ; preds = %if.then
25 if.else.14: ; preds = %entry
26 br i1 undef, label %if.then.17, label %if.end.57
28 if.then.17: ; preds = %if.else.14
29 br i1 undef, label %if.end.57, label %if.then.20
31 if.then.20: ; preds = %if.then.17
32 %call21 = tail call i32 @myfun()
33 %tobool22 = icmp eq i32 %call21, 0
34 %0 = tail call i32 @myfun()
35 br i1 %tobool22, label %if.else.42, label %if.then.23
37 if.then.23: ; preds = %if.then.20
40 if.else.42: ; preds = %if.then.20
43 if.end.57: ; preds = %if.then.17, %if.else.14, %if.then