OSDN Git Service

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)
commit757bf95c735592b985636fcc24c2ca49362da65c
tree9d700b742d5eceb444fa1df757f935e2e7a7f2a4
parente16cbae234bf7cffc12140453c173f3152330496
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?).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353121 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
lib/CodeGen/GlobalISel/Legalizer.cpp
test/CodeGen/AArch64/GlobalISel/legalize-combines.mir
test/CodeGen/AArch64/GlobalISel/legalize-extracts.mir
test/CodeGen/AMDGPU/GlobalISel/artifact-combiner-extract.mir [new file with mode: 0644]