[NFC][Regalloc] Ensure Query::interferingVRegs is accurate.
authorMircea Trofin <mtrofin@google.com>
Sun, 31 Oct 2021 03:47:22 +0000 (20:47 -0700)
committerMircea Trofin <mtrofin@google.com>
Wed, 3 Nov 2021 01:26:54 +0000 (18:26 -0700)
commit34f4fe3a9009d4443ff166a36d7ddb07e3ebb512
treef42ac91452d5c8ec440a93117666a644b1ae81d7
parent1b108ab975c6000068a2e191f71aeaca880b49db
[NFC][Regalloc] Ensure Query::interferingVRegs is accurate.

To correctly use Query, one had to first call collectInterferingVRegs to
pre-cache the query result, then call interferingVRegs. Failing the
former, interferingVRegs could be stale. This did cause a bug which was
addressed in D98232, but the underlying usability issue of the Query API
wasn't.

This patch addresses the latter by making collectInterferingVRegs an
implementation detail, and having interferingVRegs play both roles. One
side-effect of this is that interferingVRegs is not const anymore.

Differential Revision: https://reviews.llvm.org/D112882
llvm/include/llvm/CodeGen/LiveIntervalUnion.h
llvm/lib/CodeGen/LiveIntervalUnion.cpp
llvm/lib/CodeGen/RegAllocBasic.cpp
llvm/lib/CodeGen/RegAllocGreedy.cpp