Andrew Trick | 3a99693 | 2013-10-15 03:39:43 +0000 | [diff] [blame] | 1 | ; 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 Takumi | f845be1 | 2013-10-15 06:36:36 +0000 | [diff] [blame] | 11 | ; CHECK: vcvtsi2sdq %{{r[0-9a-x]+}}, %[[REG]], %{{xmm.}} |
Andrew Trick | 3a99693 | 2013-10-15 03:39:43 +0000 | [diff] [blame] | 12 | define i64 @t1(i64* nocapture %x, double* nocapture %y) nounwind { |
| 13 | entry: |
| 14 | %vx = load i64* %x |
| 15 | br label %loop |
| 16 | loop: |
| 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 |
| 27 | ret: |
| 28 | ret i64 %s2 |
| 29 | } |