GlobalISel: Artifact combine merge-like and unmerges into merge-like
authorPetar Avramovic <Petar.Avramovic@amd.com>
Mon, 24 Oct 2022 10:54:41 +0000 (12:54 +0200)
committerPetar Avramovic <Petar.Avramovic@amd.com>
Mon, 24 Oct 2022 11:33:06 +0000 (13:33 +0200)
commitcbc378ecb87e3f31dd5aff91f2a621d500640412
tree5e6b120db90c03cb6a08770309208f7b6f914ad6
parente6c778f861ccb43064fb0e17790e3ee4fff4880f
GlobalISel: Artifact combine merge-like and unmerges into merge-like

Recognize when sub-vectors have been split to elements which are used to
build large vector.
This happens when instructions have different vector sizes available.
For example a few arithmetic instruction are required to process all
elements of larger vector that can be stored using one instruction.

Differential Revision: https://reviews.llvm.org/D109242
llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
llvm/test/CodeGen/AMDGPU/GlobalISel/artifact-combiner-build-vector.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-insert-vector-elt.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-flat.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-zext.mir