blob: 210bda136b57e7ebf61beed8e1b550940543e889 [file] [log] [blame]
Andrew Trick3a996932013-10-15 03:39:43 +00001; RUN: llc < %s -march=x86-64 -mattr=+avx | FileCheck %s
2;
3; rdar:15221834 False AVX register dependencies cause 5x slowdown on
4; flops-6. Make sure the unused register read by vcvtsi2sdq is zeroed
5; to avoid cyclic dependence on a write to the same register in a
6; previous iteration.
7
8; CHECK-LABEL: t1:
9; CHECK-LABEL: %loop
10; CHECK: vxorps %[[REG:xmm.]], %{{xmm.}}, %{{xmm.}}
NAKAMURA Takumif845be12013-10-15 06:36:36 +000011; CHECK: vcvtsi2sdq %{{r[0-9a-x]+}}, %[[REG]], %{{xmm.}}
Andrew Trick3a996932013-10-15 03:39:43 +000012define i64 @t1(i64* nocapture %x, double* nocapture %y) nounwind {
13entry:
14 %vx = load i64* %x
15 br label %loop
16loop:
17 %i = phi i64 [ 1, %entry ], [ %inc, %loop ]
18 %s1 = phi i64 [ %vx, %entry ], [ %s2, %loop ]
19 %fi = sitofp i64 %i to double
20 %vy = load double* %y
21 %fipy = fadd double %fi, %vy
22 %iipy = fptosi double %fipy to i64
23 %s2 = add i64 %s1, %iipy
24 %inc = add nsw i64 %i, 1
25 %exitcond = icmp eq i64 %inc, 156250000
26 br i1 %exitcond, label %ret, label %loop
27ret:
28 ret i64 %s2
29}