[PATCH] D69288: [GISel][ArtifactCombiner] Relax the constraint to combine unmerge with concat_vectors

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 17:29:55 PDT 2019


qcolombet created this revision.
qcolombet added reviewers: arsenm, paquette, aemerson, aditya_nandakumar, volkan, dsanders.
Herald added subscribers: Petar.Avramovic, wdng.
Herald added a project: LLVM.

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).

Note: The reason why we had this restriction was I believe to avoid G_UNMERGE_VALUES with scalars as definitions and a vector as input. I.e., an equivalent of a sort of G_UNBUILD_VECTOR. However, we don't have such vector-to-scalar specific opcode, so the limitation was artificial (AFAICT) and we actually already produce such patterns! (See added test case that are derived directly from the added integration test).


Repository:
  rL LLVM

https://reviews.llvm.org/D69288

Files:
  include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
  test/CodeGen/AArch64/GlobalISel/integration-shuffle-vector.ll
  test/CodeGen/AArch64/GlobalISel/legalizer-combiner.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69288.225979.patch
Type: text/x-patch
Size: 7610 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191022/9fa553f0/attachment-0001.bin>


More information about the llvm-commits mailing list