1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mcpu=corei7-avx -mtriple=x86_64-linux | FileCheck %s
4 ; A test from pifft (after SLP-vectorization) that fails when we drop the chain on newly merged loads.
5 define void @cftx020(ptr nocapture %a) {
6 ; CHECK-LABEL: cftx020:
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
9 ; CHECK-NEXT: vmovsd {{.*#+}} xmm1 = mem[0],zero
10 ; CHECK-NEXT: vmovhpd {{.*#+}} xmm0 = xmm0[0],mem[0]
11 ; CHECK-NEXT: vmovhpd {{.*#+}} xmm1 = xmm1[0],mem[0]
12 ; CHECK-NEXT: vaddpd %xmm1, %xmm0, %xmm0
13 ; CHECK-NEXT: vmovupd (%rdi), %xmm1
14 ; CHECK-NEXT: vmovupd %xmm0, (%rdi)
15 ; CHECK-NEXT: vsubpd 16(%rdi), %xmm1, %xmm0
16 ; CHECK-NEXT: vmovupd %xmm0, 16(%rdi)
19 %0 = load double, ptr %a, align 8
20 %arrayidx1 = getelementptr inbounds double, ptr %a, i64 2
21 %1 = load double, ptr %arrayidx1, align 8
22 %arrayidx2 = getelementptr inbounds double, ptr %a, i64 1
23 %2 = load double, ptr %arrayidx2, align 8
24 %arrayidx3 = getelementptr inbounds double, ptr %a, i64 3
25 %3 = load double, ptr %arrayidx3, align 8
26 %4 = insertelement <2 x double> undef, double %0, i32 0
27 %5 = insertelement <2 x double> %4, double %3, i32 1
28 %6 = insertelement <2 x double> undef, double %1, i32 0
29 %7 = insertelement <2 x double> %6, double %2, i32 1
30 %8 = fadd <2 x double> %5, %7
31 store <2 x double> %8, ptr %a, align 8
32 %9 = insertelement <2 x double> undef, double %0, i32 0
33 %10 = insertelement <2 x double> %9, double %2, i32 1
34 %11 = insertelement <2 x double> undef, double %1, i32 0
35 %12 = insertelement <2 x double> %11, double %3, i32 1
36 %13 = fsub <2 x double> %10, %12
37 store <2 x double> %13, ptr %arrayidx1, align 8