1; RUN: llc -mtriple=arm64-apple-ios -mcpu=cyclone < %s | FileCheck %s -check-prefix=CYCLONE --check-prefix=ALL 2; RUN: llc -mtriple=aarch64-gnu-linux -mcpu=kryo < %s | FileCheck %s -check-prefix=KRYO --check-prefix=ALL 3 4; rdar://11481771 5; rdar://13713797 6 7define void @t1() nounwind ssp { 8entry: 9; ALL-LABEL: t1: 10; ALL-NOT: fmov 11; CYCLONE: movi.2d v0, #0000000000000000 12; CYCLONE: movi.2d v1, #0000000000000000 13; CYCLONE: movi.2d v2, #0000000000000000 14; CYCLONE: movi.2d v3, #0000000000000000 15; KRYO: movi v0.2d, #0000000000000000 16; KRYO: movi v1.2d, #0000000000000000 17; KRYO: movi v2.2d, #0000000000000000 18; KRYO: movi v3.2d, #0000000000000000 19 tail call void @bar(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00) nounwind 20 ret void 21} 22 23define void @t2() nounwind ssp { 24entry: 25; ALL-LABEL: t2: 26; ALL-NOT: mov w0, wzr 27; ALL: mov w0, #0 28; ALL: mov w1, #0 29 tail call void @bari(i32 0, i32 0) nounwind 30 ret void 31} 32 33define void @t3() nounwind ssp { 34entry: 35; ALL-LABEL: t3: 36; ALL-NOT: mov x0, xzr 37; ALL: mov x0, #0 38; ALL: mov x1, #0 39 tail call void @barl(i64 0, i64 0) nounwind 40 ret void 41} 42 43define void @t4() nounwind ssp { 44; ALL-LABEL: t4: 45; ALL-NOT: fmov 46; CYCLONE: movi.2d v0, #0000000000000000 47; CYCLONE: movi.2d v1, #0000000000000000 48; KRYO: movi v0.2d, #0000000000000000 49; KRYO: movi v1.2d, #0000000000000000 50 tail call void @barf(float 0.000000e+00, float 0.000000e+00) nounwind 51 ret void 52} 53 54declare void @bar(double, double, double, double) 55declare void @bari(i32, i32) 56declare void @barl(i64, i64) 57declare void @barf(float, float) 58 59; We used to produce spills+reloads for a Q register with zero cycle zeroing 60; enabled. 61; ALL-LABEL: foo: 62; ALL-NOT: str {{q[0-9]+}} 63; ALL-NOT: ldr {{q[0-9]+}} 64define double @foo(i32 %n) { 65entry: 66 br label %for.body 67 68for.body: 69 %phi0 = phi double [ 1.0, %entry ], [ %v0, %for.body ] 70 %i.076 = phi i32 [ 0, %entry ], [ %inc, %for.body ] 71 %conv21 = sitofp i32 %i.076 to double 72 %call = tail call fast double @sin(double %conv21) 73 %cmp.i = fcmp fast olt double %phi0, %call 74 %v0 = select i1 %cmp.i, double %call, double %phi0 75 %inc = add nuw nsw i32 %i.076, 1 76 %cmp = icmp slt i32 %inc, %n 77 br i1 %cmp, label %for.body, label %for.end 78 79for.end: 80 ret double %v0 81} 82 83declare double @sin(double) 84