aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/RegAllocBase.cpp
diff options
context:
space:
mode:
authorMircea Trofin <mtrofin@google.com>2022-02-03 09:07:42 -0800
committerMircea Trofin <mtrofin@google.com>2022-02-03 12:35:36 -0800
commit592f52de33040630472bb49b6ed6be434d2b95e6 (patch)
treeaab04345801b81514a479e7a72472c80f80831ce /llvm/lib/CodeGen/RegAllocBase.cpp
parent9fa3243ffc6f81b15709dba69526404eb442f5ac (diff)
downloadllvm-592f52de33040630472bb49b6ed6be434d2b95e6.zip
llvm-592f52de33040630472bb49b6ed6be434d2b95e6.tar.gz
llvm-592f52de33040630472bb49b6ed6be434d2b95e6.tar.bz2
[nfc][regalloc] const LiveIntervals within the allocator
Once built, LiveIntervals are immutable. This patch captures that. Differential Revision: https://reviews.llvm.org/D118918
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocBase.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocBase.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocBase.cpp b/llvm/lib/CodeGen/RegAllocBase.cpp
index d891d4c..8b36394 100644
--- a/llvm/lib/CodeGen/RegAllocBase.cpp
+++ b/llvm/lib/CodeGen/RegAllocBase.cpp
@@ -85,7 +85,7 @@ void RegAllocBase::allocatePhysRegs() {
seedLiveRegs();
// Continue assigning vregs one at a time to available physical registers.
- while (LiveInterval *VirtReg = dequeue()) {
+ while (const LiveInterval *VirtReg = dequeue()) {
assert(!VRM->hasPhys(VirtReg->reg()) && "Register already assigned");
// Unused registers can appear when the spiller coalesces snippets.
@@ -176,7 +176,7 @@ void RegAllocBase::postOptimization() {
DeadRemats.clear();
}
-void RegAllocBase::enqueue(LiveInterval *LI) {
+void RegAllocBase::enqueue(const LiveInterval *LI) {
const Register Reg = LI->reg();
assert(Reg.isVirtual() && "Can only enqueue virtual registers");