GlobalISel: Fix matchEqualDefs for instructions with multiple defs
authorPetar Avramovic <Petar.Avramovic@amd.com>
Thu, 5 Aug 2021 11:59:37 +0000 (13:59 +0200)
committerPetar Avramovic <Petar.Avramovic@amd.com>
Thu, 5 Aug 2021 13:05:45 +0000 (15:05 +0200)
commit66de26b1f9ecf22193aea2edfac03db03f138feb
tree9a5b0d6391f7a0eec663d2e50cfdce2871b89006
parent7b73ca3043fecfc5fa6bbf5b28edfee61a83ff9f
GlobalISel: Fix matchEqualDefs for instructions with multiple defs

Instructions that produceSameValue produce same values for operands with
same index. matchEqualDefs used to return true for any two values from
different instructions that produce same values. Fix this by checking if
values are defined by operands with the same index.

Differential Revision: https://reviews.llvm.org/D107362
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/postlegalizercombiner-select.mir