1 ; RUN: llc < %s -mtriple=arm-apple-darwin -mcpu=cortex-a8 | FileCheck %s
3 ; Adjust if-converter heuristics to avoid predicating vmrs which can cause
4 ; significant regression.
6 %struct.xyz_t = type { double, double, double }
8 define i32 @effie(i32 %tsets, %struct.xyz_t* nocapture %p, i32 %a, i32 %b, i32 %c) nounwind readonly noinline {
11 %0 = icmp sgt i32 %tsets, 0
12 br i1 %0, label %bb.nph, label %bb6
14 bb.nph: ; preds = %entry
15 %1 = add nsw i32 %b, %a
16 %2 = add nsw i32 %1, %c
19 bb: ; preds = %bb4, %bb.nph
21 ; CHECK: vmrs APSR_nzcv, fpscr
22 %r.19 = phi i32 [ 0, %bb.nph ], [ %r.0, %bb4 ]
23 %n.08 = phi i32 [ 0, %bb.nph ], [ %10, %bb4 ]
24 %scevgep10 = getelementptr inbounds %struct.xyz_t, %struct.xyz_t* %p, i32 %n.08, i32 0
25 %scevgep11 = getelementptr %struct.xyz_t, %struct.xyz_t* %p, i32 %n.08, i32 1
26 %3 = load double, double* %scevgep10, align 4
27 %4 = load double, double* %scevgep11, align 4
28 %5 = fcmp uge double %3, %4
29 br i1 %5, label %bb3, label %bb1
36 ; CHECK: vmrs APSR_nzcv, fpscr
37 %scevgep12 = getelementptr %struct.xyz_t, %struct.xyz_t* %p, i32 %n.08, i32 2
38 %6 = load double, double* %scevgep12, align 4
39 %7 = fcmp uge double %3, %6
40 br i1 %7, label %bb3, label %bb2
43 %8 = add nsw i32 %2, %r.19
46 bb3: ; preds = %bb1, %bb
47 %9 = add nsw i32 %r.19, 1
50 bb4: ; preds = %bb3, %bb2
51 %r.0 = phi i32 [ %9, %bb3 ], [ %8, %bb2 ]
52 %10 = add nsw i32 %n.08, 1
53 %exitcond = icmp eq i32 %10, %tsets
54 br i1 %exitcond, label %bb6, label %bb
56 bb6: ; preds = %bb4, %entry
57 %r.1.lcssa = phi i32 [ 0, %entry ], [ %r.0, %bb4 ]