[GISel][ArtifactCombiner] Relax the constraint to combine unmerge with concat_vectors
authorQuentin Colombet <qcolombet@apple.com>
Wed, 6 Nov 2019 19:09:12 +0000 (11:09 -0800)
committerQuentin Colombet <qcolombet@apple.com>
Wed, 6 Nov 2019 19:27:50 +0000 (11:27 -0800)
commit52af7aedfe5dd5cfb1a6f486040a2549bbdbcf93
treeb3b0b5b8e4a2e777daf08865bea20ef6598e1fa4
parent6da58e7e0fac1e421d6a5a6e48ed8836c67ac543
[GISel][ArtifactCombiner] Relax the constraint to combine unmerge with concat_vectors

The combine G_UNMERGE_VALUES with G_CONCAT_VECTORS used to only be performed
when the result type of the G_UNMERGE_VALUES was a vector type.
In other words, we were expecting that the G_UNMERGE_VALUES was effectively
the exact opposite of the G_CONCAT_VECTORS.

Lift that constraint by allowing any G_UNMERGE_VALUES to be combined
with any G_CONCAT_VECTORS (as long as the size of the different pieces
that we merge/unmerge match).

Differential Revision: https://reviews.llvm.org/D69288
llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
llvm/test/CodeGen/AArch64/GlobalISel/integration-shuffle-vector.ll [new file with mode: 0644]
llvm/test/CodeGen/AArch64/GlobalISel/legalizer-combiner.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/artifact-combiner-unmerge-values.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-phi.mir