[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128 (reapplied)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 22 Jul 2016 13:58:44 +0000 (13:58 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 22 Jul 2016 13:58:44 +0000 (13:58 +0000)
commitea0d4f9962fbc1741a730ec74b655940ea15424b
tree47e47fd7351dc3615c9c33add8a694638cec173d
parent22c9e931470fea2e25bef1f52128e54ec96da403
[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128 (reapplied)

As reported on PR26235, we don't currently make use of the VBROADCASTF128/VBROADCASTI128 instructions (or the AVX512 equivalents) to load+splat a 128-bit vector to both lanes of a 256-bit vector.

This patch enables lowering from subvector insertion/concatenation patterns and auto-upgrades the llvm.x86.avx.vbroadcastf128.pd.256 / llvm.x86.avx.vbroadcastf128.ps.256 intrinsics to match.

We could possibly investigate using VBROADCASTF128/VBROADCASTI128 to load repeated constants as well (similar to how we already do for scalar broadcasts).

Reapplied with fix for PR28657 - removed intrinsic definitions (clang companion patch to be be submitted shortly).

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

llvm-svn: 276416
13 files changed:
llvm/include/llvm/IR/IntrinsicsX86.td
llvm/lib/IR/AutoUpgrade.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86InstrAVX512.td
llvm/lib/Target/X86/X86InstrSSE.td
llvm/test/CodeGen/X86/avx-intrinsics-fast-isel.ll
llvm/test/CodeGen/X86/avx-intrinsics-x86-upgrade.ll
llvm/test/CodeGen/X86/avx-intrinsics-x86.ll
llvm/test/CodeGen/X86/avx-vbroadcastf128.ll
llvm/test/CodeGen/X86/avx2-intrinsics-fast-isel.ll
llvm/test/CodeGen/X86/avx2-vbroadcasti128.ll
llvm/test/CodeGen/X86/avx512-vbroadcasti128.ll
llvm/test/CodeGen/X86/vector-shuffle-256-v4.ll