diff options
author | Mircea Trofin <mtrofin@google.com> | 2022-02-03 09:07:42 -0800 |
---|---|---|
committer | Mircea Trofin <mtrofin@google.com> | 2022-02-03 12:35:36 -0800 |
commit | 592f52de33040630472bb49b6ed6be434d2b95e6 (patch) | |
tree | aab04345801b81514a479e7a72472c80f80831ce /llvm/lib/CodeGen/RegAllocBase.cpp | |
parent | 9fa3243ffc6f81b15709dba69526404eb442f5ac (diff) | |
download | llvm-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.cpp | 4 |
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"); |