[PATCH] D68970: AMDGPU: Fix infinite searches in SIFixSGPRCopies

Austin Kerbow via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 00:11:56 PDT 2019


kerbowa created this revision.
kerbowa added reviewers: alex-t, rampitec, arsenm.
Herald added subscribers: llvm-commits, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68970

Files:
  llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp
  llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
  llvm/test/CodeGen/AMDGPU/fix-sgpr-copies.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68970.224958.patch
Type: text/x-patch
Size: 3226 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191015/dc0e6c2f/attachment.bin>


More information about the llvm-commits mailing list