[X86][SSE] Add support for target shuffle constant folding
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 30 Nov 2016 16:33:46 +0000 (16:33 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 30 Nov 2016 16:33:46 +0000 (16:33 +0000)
commit288c088c177f0a9a994d37b3d7006c2c99f3df57
tree1054471f179ad31803f220c453bd36a4d7523685
parentc6d8b4c044c06ee3ecdecaac67193b179207e25f
[X86][SSE] Add support for target shuffle constant folding

Initial support for target shuffle constant folding in cases where all shuffle inputs are constant. We may be able to relax this and merge shuffles with only some constant inputs in the future.

I've added the helper function getTargetConstantBitsFromNode (based off a similar function in X86ShuffleDecodeConstantPool.cpp) that could be reused for other cases requiring constant vector extraction.

Differential Revision: https://reviews.llvm.org/D27220

llvm-svn: 288250
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-shuffle-combining-avx.ll
llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll
llvm/test/CodeGen/X86/vector-shuffle-combining-ssse3.ll
llvm/test/CodeGen/X86/vector-shuffle-combining-xop.ll
llvm/test/CodeGen/X86/vector-shuffle-mmx.ll
llvm/test/CodeGen/X86/vselect-avx.ll
llvm/test/CodeGen/X86/widen_load-2.ll
llvm/test/CodeGen/X86/widen_shuffle-1.ll