aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/RegAllocBasic.cpp
diff options
context:
space:
mode:
authorMircea Trofin <mtrofin@google.com>2020-09-29 09:09:25 -0700
committerMircea Trofin <mtrofin@google.com>2020-09-30 08:13:05 -0700
commitd6de40f8865e2c016731f9b63d8a0a218ce1b74f (patch)
tree8497eac03259411fe2b738b5aa3d9de23aa98a5f /llvm/lib/CodeGen/RegAllocBasic.cpp
parentf425418fc4ebd989c6c3d59d20e7fe37cb29259c (diff)
downloadllvm-d6de40f8865e2c016731f9b63d8a0a218ce1b74f.zip
llvm-d6de40f8865e2c016731f9b63d8a0a218ce1b74f.tar.gz
llvm-d6de40f8865e2c016731f9b63d8a0a218ce1b74f.tar.bz2
[NFC][regalloc] Make VirtRegAuxInfo part of allocator state
All the state of VRAI is allocator-wide, so we can avoid creating it every time we need it. In addition, the normalization function is allocator-specific. In a next change, we can simplify that design in favor of just having it as a virtual member. Differential Revision: https://reviews.llvm.org/D88499
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocBasic.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocBasic.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/RegAllocBasic.cpp b/llvm/lib/CodeGen/RegAllocBasic.cpp
index 0fa50d9..8bbbbeb 100644
--- a/llvm/lib/CodeGen/RegAllocBasic.cpp
+++ b/llvm/lib/CodeGen/RegAllocBasic.cpp
@@ -311,10 +311,9 @@ bool RABasic::runOnMachineFunction(MachineFunction &mf) {
RegAllocBase::init(getAnalysis<VirtRegMap>(),
getAnalysis<LiveIntervals>(),
getAnalysis<LiveRegMatrix>());
-
- calculateSpillWeightsAndHints(*LIS, *MF, VRM,
- getAnalysis<MachineLoopInfo>(),
- getAnalysis<MachineBlockFrequencyInfo>());
+ VirtRegAuxInfo VRAI(*MF, *LIS, VRM, getAnalysis<MachineLoopInfo>(),
+ getAnalysis<MachineBlockFrequencyInfo>());
+ VRAI.calculateSpillWeightsAndHints();
SpillerInstance.reset(createInlineSpiller(*this, *MF, *VRM));