[NFC][Regalloc] Split canEvictInterference into hint and general
authorMircea Trofin <mtrofin@google.com>
Tue, 16 Nov 2021 19:26:37 +0000 (11:26 -0800)
committerMircea Trofin <mtrofin@google.com>
Tue, 30 Nov 2021 00:04:03 +0000 (16:04 -0800)
commite8b8304d76ccefa9880bbb352d9f81f330ef1ea1
treedd4a27eed831c16934ef8de8eb15384b6f025447
parent6f99e1aa58e3566fcce689bc986b7676e818c038
[NFC][Regalloc] Split canEvictInterference into hint and general

There are 2 eviction queries. One is made by tryAssign, when it attempts to
free an interference occupying the hint of the candidate. The other is
during 'regular' interference resolution, where we scan over all
physical registers and try to see if we can evict live ranges in favor
of the candidate. We currently use the same logic in both cases, just
that the former never passes the cost to any subsequent query.
Technically, the 2 decisions could be implemented with different
policies.

This patch splits the 2.

RFC: https://lists.llvm.org/pipermail/llvm-dev/2021-November/153639.html

Differential Revision: https://reviews.llvm.org/D114019
llvm/lib/CodeGen/RegAllocGreedy.cpp