]> granicus.if.org Git - llvm/commit
[RABasic] Properly update the LiveRegMatrix when LR splitting occur
authorQuentin Colombet <qcolombet@apple.com>
Fri, 2 Jun 2017 22:46:31 +0000 (22:46 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Fri, 2 Jun 2017 22:46:31 +0000 (22:46 +0000)
commit1067c966a6db3f398b861a9e789931ed5195f133
tree12ea534d3e4726a5257b4f4f0434a99f9c6f18ac
parent9f43f266be5d693e1d93bb4de5faaadf131710b0
[RABasic] Properly update the LiveRegMatrix when LR splitting occur

Prior to this patch we used to not touch the LiveRegMatrix while doing
live-range splitting. In other words, when live-range splitting was
occurring, the LiveRegMatrix was not reflecting the changes.
This is generally fine because it means the query to the LiveRegMatrix
will be conservately correct. However, when decisions are taken based on
what is going to happen on the interferences (e.g., when we spill a
register and know that it is going to be available for another one), we
might hit an assertion that the color used for the assignment is still
in use.

This patch makes sure the changes on the live-ranges are properly
reflected in the LiveRegMatrix, so the assertions don't break.
An alternative could have been to remove the assertion, but it would
make the invariants of the code and the general reasoning more
complicated in my opnion.

http://llvm.org/PR33057

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304603 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/RegAllocBasic.cpp
test/CodeGen/SystemZ/RAbasic-invalid-LR-update.mir [new file with mode: 0644]