[PATCH] D52061: [RegisterCoalescer] Only look at main ranges in valuesIdentical/followCopyChain

Tim Renouf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 13 14:41:54 PDT 2018


tpr created this revision.
Herald added subscribers: llvm-commits, nhaehnle, jvesely, qcolombet, MatzeB.

valuesIdentical is called to determine whether a def can be considered
an "identical erase" because following copy chains proves that the value
being copied is the same value as the value of the other register.

The tests show up problems where the main range decides that a def is
an "identical erase" but a subrange disagrees, because following the
copy chain leads to a def that does not define all subregs in the
subrange (in the case of one test) or a different def to that found in
the main range (in the case of the other test).

The fix here is to only detect an "identical erase" in the main range.
If it is found, it is automatically inherited by the corresponding def
in any subrange, without further analysis of that subrange value.

This fix supersedes https://reviews.llvm.org/D49535/https://reviews.llvm.org/rL338070 and https://reviews.llvm.org/D51848.

Change-Id: I059b5b2273ed6f186d134b98c118fef0494e02f8


Repository:
  rL LLVM

https://reviews.llvm.org/D52061

Files:
  lib/CodeGen/RegisterCoalescer.cpp
  test/CodeGen/AMDGPU/regcoal-followcopychain-bogus-subrange-comparison.mir
  test/CodeGen/AMDGPU/regcoal-followcopychain-different-subreg-diffs.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52061.165387.patch
Type: text/x-patch
Size: 20445 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180913/496de771/attachment.bin>


More information about the llvm-commits mailing list