[DAGCombiner] Add a most basic `combineShuffleToZeroExtendVectorInReg()`
authorRoman Lebedev <lebedev.ri@gmail.com>
Sun, 25 Dec 2022 19:16:30 +0000 (22:16 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Mon, 26 Dec 2022 19:54:03 +0000 (22:54 +0300)
commit62fc5f16405a7d39e62044bc461752f3f31bdca0
tree04f8067adfe2c923fb5c10fc004f390dcccbf9b9
parent46458aadd427aae2254a6f219e6180252d677e45
[DAGCombiner] Add a most basic `combineShuffleToZeroExtendVectorInReg()`

Sometimes we end up with a shuffles in DAG that would be
better represented as a `ISD::ZERO_EXTEND_VECTOR_INREG`,
and a failure to do so causes suboptimal codegen in a number of cases,
especially when we will then cast vector to scalar.

I acknowledge, the test changes here are rather underwhelming,
but as with all of codegen, it's always a yak shawing,
and this is the most stripped down version of the patch
that shows *some* effect without having insurmountable amount
of fallout to deal with. The next change resolves this regression.

The transformation will be extended in follow-ups.
llvm/include/llvm/CodeGen/SelectionDAG.h
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/AArch64/aarch64-vuzp.ll