Merging r259740:
[oota-llvm.git] / test / CodeGen / PowerPC / swaps-le-3.ll
1 ; RUN: llc -mcpu=pwr8 -mtriple=powerpc64le-unknown-linux-gnu -O3 < %s | FileCheck %s
2
3 ; This test verifies that VSX swap optimization works for the
4 ; doubleword splat idiom.
5
6 @a = external global <2 x double>, align 16
7 @b = external global <2 x double>, align 16
8
9 define void @test(double %s) {
10 entry:
11   %0 = insertelement <2 x double> undef, double %s, i32 0
12   %1 = shufflevector <2 x double> %0, <2 x double> undef, <2 x i32> zeroinitializer
13   %2 = load <2 x double>, <2 x double>* @a, align 16
14   %3 = fadd <2 x double> %0, %2
15   store <2 x double> %3, <2 x double>* @b, align 16
16   ret void
17 }
18
19 ; CHECK-LABEL: @test
20 ; CHECK-DAG: xxspltd
21 ; CHECK-DAG: lxvd2x
22 ; CHECK: xvadddp
23 ; CHECK: stxvd2x
24 ; CHECK-NOT: xxswapd