fixed to test attributes and use better checks
[oota-llvm.git] / test / CodeGen / X86 / x86-fold-pshufb.ll
1 ; RUN: llc -relocation-model=pic -march=x86-64 -mtriple=x86_64-unknown-unknown -mattr=+ssse3 < %s | FileCheck %s
2
3 ; Verify that the backend correctly folds the shuffle in function 'fold_pshufb'
4 ; into a simple load from constant pool.
5
6 define <2 x i64> @fold_pshufb() {
7 ; CHECK-LABEL: fold_pshufb:
8 ; CHECK:       # BB#0:
9 ; CHECK-NEXT:    movaps {{.*#+}} xmm0 = [0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0]
10 ; CHECK-NEXT:    retq
11 entry:
12   %0 = tail call <16 x i8> @llvm.x86.ssse3.pshuf.b.128(<16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 1, i8 0, i8 0, i8 0, i8 2, i8 0, i8 0, i8 0, i8 3, i8 0, i8 0, i8 0>, <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>)
13   %1 = bitcast <16 x i8> %0 to <2 x i64>
14   ret <2 x i64> %1
15 }
16
17 declare <16 x i8> @llvm.x86.ssse3.pshuf.b.128(<16 x i8>, <16 x i8>)