]> granicus.if.org Git - llvm/commit
AMDGPU: Fix infinite searches in SIFixSGPRCopies
authorAustin Kerbow <Austin.Kerbow@amd.com>
Tue, 15 Oct 2019 19:59:45 +0000 (19:59 +0000)
committerAustin Kerbow <Austin.Kerbow@amd.com>
Tue, 15 Oct 2019 19:59:45 +0000 (19:59 +0000)
commit1f3d0040fc8ed27a8adb7a2466864b1fa0b80889
tree03ef60be8dcbf4e4e26142cbc3635d41c2e33ce7
parent382c1a971c6ec2f14ca30ed5ca9af0a90e3828cb
AMDGPU: Fix infinite searches in SIFixSGPRCopies

Summary:
Two conditions could lead to infinite loops when processing PHI nodes in
SIFixSGPRCopies.

The first condition involves a REG_SEQUENCE that uses registers defined by both
a PHI and a COPY.

The second condition arises when a physical register is copied to a virtual
register which is then used in a PHI node. If the same virtual register is
copied to the same physical register, the result is an endless loop.

%0:sgpr_64 = COPY $sgpr0_sgpr1
%2 = PHI %0, %bb.0, %1, %bb.1
$sgpr0_sgpr1 = COPY %0

Reviewers: alex-t, rampitec, arsenm

Reviewed By: rampitec

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68970

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374944 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/SIFixSGPRCopies.cpp
lib/Target/AMDGPU/SIInstrInfo.cpp
test/CodeGen/AMDGPU/fix-sgpr-copies.mir