[PATCH] D92665: RegisterCoalescer: Remove phi-only subranges when erasing identity copies

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 4 09:42:06 PST 2020


arsenm created this revision.
arsenm added reviewers: qcolombet, MatzeB, foad, tpr, dstuttard, rampitec.
Herald added subscribers: kerbowa, hiraditya, nhaehnle, jvesely.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

Undef subranges are not present in the live range values, except when
they cross block boundaries. In this situation, a identity copy is
inside a loop, and one of the lanes is undefined. It only appears
alive inside the loop due to the copy. Once the copy was erased, it
would leave behind a segment inside the loop body with no
corresponding def anywhere in the program.

      

When RenameIndependentSubregs processed this dummy interval, it would
introduce a "Multiple connected components in live interval" verifier
error when IMPLICIT_DEFs were added to the other two blocks. I believe
there is a missing verifier check for this type of dummy interval.

      

I have found additional cases from the same fundamental problem in
other areas I haven't managed to fix yet (e.g. the commented out
prune_subrange_phi_value_* cases).


https://reviews.llvm.org/D92665

Files:
  llvm/lib/CodeGen/RegisterCoalescer.cpp
  llvm/test/CodeGen/AMDGPU/coalesce-identity-copies-undef-subregs.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92665.309555.patch
Type: text/x-patch
Size: 14711 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201204/75ffac02/attachment.bin>


More information about the llvm-commits mailing list