[AVX512] Bring back vector-shuffle lowering support through broadcasts
[oota-llvm.git] / test / CodeGen / X86 / 2012-07-15-broadcastfold.ll
1 ; RUN: llc < %s -march=x86 -mcpu=corei7 -mattr=+avx2 | FileCheck %s
2 ; RUN: llc < %s -march=x86 -mcpu=corei7 -mattr=+avx2 -x86-experimental-vector-shuffle-lowering | FileCheck %s
3
4 declare x86_fastcallcc i64 @barrier()
5
6 ;CHECK-LABEL: bcast_fold:
7 ;CHECK: vmov{{[au]}}ps %xmm{{[0-9]+}}, [[SPILLED:[^\)]+\)]]
8 ;CHECK: barrier
9 ;CHECK: vbroadcastss [[SPILLED]], %ymm0
10 ;CHECK: ret
11 define <8 x float> @bcast_fold( float* %A) {
12 BB:
13   %A0 = load float* %A
14   %tt3 = call x86_fastcallcc i64 @barrier()
15   br i1 undef, label %work, label %exit
16
17 work:
18   %A1 = insertelement <8 x float> undef, float %A0, i32 0
19   %A2 = shufflevector <8 x float> %A1, <8 x float> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
20   ret <8 x float> %A2
21
22 exit:
23   ret <8 x float> undef
24 }