OSDN Git Service

Fix register coalescer failure to prune value
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Tue, 21 May 2019 19:32:41 +0000 (19:32 +0000)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Tue, 21 May 2019 19:32:41 +0000 (19:32 +0000)
commitc2f9472abca52e22a88349217115a5505f6732e0
tree5abf9a47de1df87b4f07d88ce4acdbd61a19ea79
parentab52e01f3728ce1f7e3c80ad8105572171e8bcb9
Fix register coalescer failure to prune value

Register coalescer fails for the test in the patch with the assertion in
JoinVals::ConflictResolution `DefMI != nullptr'. It attempts to join
live intervals for two adjacent instructions and erase the copy:

    %2:vreg_256 = COPY %1
    %3:vreg_256 = COPY killed %1

The LI needs to be adjusted to kill subrange for the erased instruction
and extend the subrange of the original def. That was done for the main
interval only but not for the subrange. As a result subrange had a VNI
pointing to the erased slot resulting in the above failure.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361293 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/RegisterCoalescer.cpp
test/CodeGen/AMDGPU/coalescer-subranges-prune-kill-copy.mir [new file with mode: 0644]