GlobalISel: Combine g_extract with g_merge_values
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 4 Feb 2019 23:41:59 +0000 (23:41 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 4 Feb 2019 23:41:59 +0000 (23:41 +0000)
commit24f14993e8743a4944756a8acc68d8c6fa7de9a6
tree1277f0b9a843501ccc924e3e14b8507a079eea7c
parent98b9f5b4b3863f8b4f206556ca167b808f46e420
GlobalISel: Combine g_extract with g_merge_values

Try to use the underlying source registers.

This enables legalization in more cases where some irregular
operations are widened and others narrowed.

This seems to make the test_combines_2 AArch64 test worse, since the
MERGE_VALUES has multiple uses. Since this should be required for
legalization, a hasOneUse check is probably inappropriate (or maybe
should only be used if the merge is legal?).

llvm-svn: 353121
llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
llvm/test/CodeGen/AArch64/GlobalISel/legalize-combines.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-extracts.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/artifact-combiner-extract.mir [new file with mode: 0644]