[DAGCombiner] reduce extract subvector of concat
authorSanjay Patel <spatel@rotateright.com>
Thu, 9 Jan 2020 14:36:22 +0000 (09:36 -0500)
committerSanjay Patel <spatel@rotateright.com>
Thu, 9 Jan 2020 14:38:12 +0000 (09:38 -0500)
commitcb5612e2df893728887bedd41aa2293f454c7845
treee44fdefb72c919dd35ad25916bdb7339dba645a2
parent84ce46269cfda8800346706251ac3587b2d1c9f5
[DAGCombiner] reduce extract subvector of concat

If we are extracting a chunk of a vector that's a fraction of an
operand of the concatenated vector operand, we can extract directly
from one of those original operands.

This is another suggestion from PR42024:
https://bugs.llvm.org/show_bug.cgi?id=42024#c2

But I'm not sure yet if it will make any difference on those patterns.
It seems to help a few existing AVX512 tests though.

Differential Revision: https://reviews.llvm.org/D72361
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/avg.ll
llvm/test/CodeGen/X86/pr34657.ll
llvm/test/CodeGen/X86/x86-interleaved-access.ll