[RegisterCoalescer] Fix crash on early clobbered subreg operands.
authorDaniil Fukalov <1671137+dfukalov@users.noreply.github.com>
Tue, 6 Sep 2022 05:42:27 +0000 (08:42 +0300)
committerDaniil Fukalov <1671137+dfukalov@users.noreply.github.com>
Tue, 6 Sep 2022 05:42:37 +0000 (08:42 +0300)
commit51d33afcbe0a81bb8508d5685f38dc9fdb2b60c9
tree8493ccfc5671cec0c70b41af72e2e4c5a3b58e4a
parentd5fa8b1c2c3f604d225fbe369b3c4c867473c030
[RegisterCoalescer] Fix crash on early clobbered subreg operands.

The issue was with processing two subregs of the same reg are used in the same
instruction (e.g. inline asm): "def early-clobber" and other just "def".
Register coalescer ran in bad recursion if the early clobbered subreg is second
in the following sequence of COPYs.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D127136
llvm/lib/CodeGen/RegisterCoalescer.cpp
llvm/test/CodeGen/AMDGPU/coalescer-early-clobber-subreg.mir [new file with mode: 0644]