[DAG] BUILD_VECTOR: absorb ZERO_EXTEND of a single first operand if all other ops...
authorRoman Lebedev <lebedev.ri@gmail.com>
Fri, 30 Dec 2022 00:49:48 +0000 (03:49 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Fri, 30 Dec 2022 21:58:11 +0000 (00:58 +0300)
commite4d25a9c234b1501bc4ac01f4e40d75f6ebee172
treecd64b36e81b253bdd702939ebd849aef4f774094
parent6bb4b2d00221658b3fac421957e2905a13579c68
[DAG] BUILD_VECTOR: absorb ZERO_EXTEND of a single first operand if all other ops are zeros

This kind of pattern seems to come up as regressions
with better ZERO_EXTEND_VECTOR_INREG recognition.

For initial implementation, this is quite restricted
to the minimal viable transform, otherwise there are
too many regressions to be dealt with.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/build-vector-extract.ll
llvm/test/CodeGen/X86/buildvec-extract.ll