[GlobalISel] Enable artifact combiner to combine starting from a G_MERGE_VALUES.
authorAmara Emerson <aemerson@apple.com>
Sat, 11 Apr 2020 05:39:49 +0000 (22:39 -0700)
committerAmara Emerson <aemerson@apple.com>
Wed, 15 Apr 2020 17:34:13 +0000 (10:34 -0700)
commitc22cb5bd31ca6a2d1253cedc3f8cc872fb93c17b
tree90365ebf5b946fb6c43339a3bd1d9966be66b7a6
parenta0d92248eaed41a8cbf68cdd4221df5afa4729bf
[GlobalISel] Enable artifact combiner to combine starting from a G_MERGE_VALUES.

We generally only combine starting from users to defs in the artifact combiner,
but this doesn't catch cases where at the point of combining a G_UNMERGE we don't
yet have the opposite G_MERGE on input yet since we haven't legalized that far.

This change adds the users of a G_MERGE to the artifact combiner worklist if one
of the uses is a G_UNMERGE or G_TRUNC.

Differential Revision: https://reviews.llvm.org/D77931
12 files changed:
llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
llvm/test/CodeGen/AArch64/GlobalISel/legalize-sext-zext-128.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalizer-combiner.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-ashr.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-lshr.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-shl.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/zextload.ll
llvm/test/CodeGen/Mips/GlobalISel/legalizer/ctlz.mir
llvm/test/CodeGen/Mips/GlobalISel/legalizer/ctpop.mir
llvm/test/CodeGen/Mips/GlobalISel/legalizer/cttz.mir
llvm/test/CodeGen/Mips/GlobalISel/legalizer/zextLoad_and_sextLoad.mir
llvm/test/CodeGen/Mips/GlobalISel/legalizer/zext_and_sext.mir