[PATCH] D49097: [RegisterCoalescer] Another fix for subrange join unreachable

Tim Renouf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 19 07:13:34 PDT 2018


tpr updated this revision to Diff 156265.
tpr added a comment.

[RegisterCoalescer] Another fix for subrange join unreachable

Summary:
When checking for conflicts, two subreg values can be considered equal
if they are ultimately copies of the same register but one is undefined.

This is a simplified alternative to David's https://reviews.llvm.org/D35073 now that most of the
cases fixed by that are also fixed by Krzysztof's https://reviews.llvm.org/D48102.

The two tests show two different cases:

coalescing-subreg-was-undef-but-became-def.mir shows a case where a
whole reg use point of the whole register was undefined in one subreg,
but after coalescing it became defined but the subrange was not updated
to reflect that. It is arguable that this is correct, in that the subreg
is defined but the use does not care what the value is there, so the use
does not need to be in the subrange.

coalescing-subreg-removed-undef-copy.mir shows a case where a subreg was
defined by a copy from an undef register, and that copy got removed and
the subreg became undef at a later whole reg use.

You probably need https://reviews.llvm.org/D49535 first for the tests to make sense.

V3: Mostly back to the original fix, but only subregs are considered
identical if one is undef, not main regs.


Repository:
  rL LLVM

https://reviews.llvm.org/D49097

Files:
  lib/CodeGen/RegisterCoalescer.cpp
  test/CodeGen/AMDGPU/coalescing-subreg-removed-undef-copy.mir
  test/CodeGen/AMDGPU/coalescing-subreg-was-undef-but-became-def.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49097.156265.patch
Type: text/x-patch
Size: 44126 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180719/2c3cc870/attachment.bin>


More information about the llvm-commits mailing list