[GlobalISel] LegalizationArtifactCombiner: Fix a bug in tryCombineMerges
authorVolkan Keles <vkeles@apple.com>
Fri, 14 Feb 2020 18:43:12 +0000 (10:43 -0800)
committerVolkan Keles <vkeles@apple.com>
Fri, 14 Feb 2020 18:45:58 +0000 (10:45 -0800)
commit187686a22f97662c981b9bffb998b6010ae1c401
tree2c8bde013cbe39871ab1b81d8ba80c307f8d2ba2
parentbf3b86bc2f1020fc1b3a69803e6c3df7ffe8694d
[GlobalISel] LegalizationArtifactCombiner: Fix a bug in tryCombineMerges

Like COPY instructions explained in D70616, we don't check the constraints
when combining G_UNMERGE_VALUES. Use the same logic used in D70616 to check
if registers can be replaced, or a COPY instruction needs to be built.

https://reviews.llvm.org/D70564
llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
llvm/include/llvm/CodeGen/GlobalISel/Utils.h
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/lib/CodeGen/GlobalISel/Utils.cpp
llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp
llvm/test/CodeGen/AArch64/GlobalISel/artifact-combine-unmerge.mir [new file with mode: 0644]