1 ; Check that a callee-saved register will be saved correctly if 2 ; the predicate-to-GPR spilling code uses it. 3 ; 4 ; RUN: llc -march=hexagon < %s | FileCheck %s 5 ; 6 ; We expect to spill p0 into a general-purpose register and keep it there, 7 ; without adding an extra spill of that register. 8 ; 9 ; CHECK: PredSpill: 10 ; CHECK-DAG: r{{[0-9]+}} = p0 11 ; CHECK-DAG: p0 = r{{[0-9]+}} 12 ; CHECK-NOT: = memw(r29 13 ; 14 15 define void @PredSpill() { 16 entry: 17 br i1 undef, label %if.then, label %if.else.14 18 19 if.then: ; preds = %entry 20 br i1 undef, label %if.end.57, label %if.else 21 22 if.else: ; preds = %if.then 23 unreachable 24 25 if.else.14: ; preds = %entry 26 br i1 undef, label %if.then.17, label %if.end.57 27 28 if.then.17: ; preds = %if.else.14 29 br i1 undef, label %if.end.57, label %if.then.20 30 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 36 37 if.then.23: ; preds = %if.then.20 38 unreachable 39 40 if.else.42: ; preds = %if.then.20 41 ret void 42 43 if.end.57: ; preds = %if.then.17, %if.else.14, %if.then 44 ret void 45 } 46 47 declare i32 @myfun() 48 49