[AVX512] Pull pattern for subvector extract into the instruction definition
authorAdam Nemet <anemet@apple.com>
Thu, 25 Sep 2014 23:48:49 +0000 (23:48 +0000)
committerAdam Nemet <anemet@apple.com>
Thu, 25 Sep 2014 23:48:49 +0000 (23:48 +0000)
commit08f261afbfbc6b1f10b6e64f491f611d3527012b
tree2bd985cc67f4f748b41b88ea2bcf902881ba5857
parent2f3ccfc25710ca7c1241421649d2aaa850a4894d
[AVX512] Pull pattern for subvector extract into the instruction definition

No functional change.

I initially thought that pulling the Pat<> into the instruction pattern was
not possible because it was doing a transform on the index in order to convert
it from a per-element (extract_subvector) index into a per-chunk (vextract*x4)
index.

Turns out this also works inside the pattern because the vextract_extract
PatFrag has an OperandTransform EXTRACT_get_vextract{128,256}_imm, so the
index in $idx goes through the same conversion.

The existing test CodeGen/X86/avx512-insert-extract.ll extended in the
previous commit provides coverage for this change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218480 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrAVX512.td