[X86] Look for scalar through one bitcast when lowering to VBROADCAST.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Thu, 20 Aug 2015 21:02:39 +0000 (21:02 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Thu, 20 Aug 2015 21:02:39 +0000 (21:02 +0000)
commit14fea5bf0df997aff940953a8d35181d6e5c88ba
tree749f1b7734b9b476098d83e50c519380d58521ba
parented7eb85a5d881d54570854b49fda5abacb13ed6c
[X86] Look for scalar through one bitcast when lowering to VBROADCAST.

Fixes PR23464: one way to use the broadcast intrinsics is:

  _mm256_broadcastw_epi16(_mm_cvtsi32_si128(*(int*)src));

We don't currently fold this, but now that we use native IR for
the intrinsics (r245605), we can look through one bitcast to find
the broadcast scalar.

Differential Revision: http://reviews.llvm.org/D10557

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245613 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86InstrSSE.td
test/CodeGen/X86/vector-shuffle-128-v16.ll
test/CodeGen/X86/vector-shuffle-128-v8.ll
test/CodeGen/X86/vector-shuffle-256-v16.ll
test/CodeGen/X86/vector-shuffle-256-v32.ll