CalcSpillWeights: give a better describing name to calculateSpillWeights
authorArnaud A. de Grandmaison <arnaud.adegm@gmail.com>
Mon, 11 Nov 2013 19:04:45 +0000 (19:04 +0000)
committerArnaud A. de Grandmaison <arnaud.adegm@gmail.com>
Mon, 11 Nov 2013 19:04:45 +0000 (19:04 +0000)
Besides, this relates it more obviously to the VirtRegAuxInfo::calculateSpillWeightAndHint.

No functionnal change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194404 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/CalcSpillWeights.h
lib/CodeGen/CalcSpillWeights.cpp
lib/CodeGen/LiveRangeEdit.cpp
lib/CodeGen/RegAllocBasic.cpp
lib/CodeGen/RegAllocGreedy.cpp
lib/CodeGen/RegAllocPBQP.cpp

index 00d9c6a5e627b4b72a35559e5f4f9d2555382a07..60be6115272e85cb98c9d66d8dad7c66488b85ca 100644 (file)
@@ -55,16 +55,14 @@ namespace llvm {
         : MF(mf), LIS(lis), Loops(loops), MBFI(mbfi) {}
 
     /// \brief (re)compute li's spill weight and allocation hint.
-    void CalculateWeightAndHint(LiveInterval &li);
+    void calculateSpillWeightAndHint(LiveInterval &li);
   };
 
   /// \brief Compute spill weights and allocation hints for all virtual register
   /// live intervals.
-  void calculateSpillWeights(LiveIntervals &LIS,
-                             MachineFunction &MF,
-                             const MachineLoopInfo &MLI,
-                             const MachineBlockFrequencyInfo &MBFI);
-
+  void calculateSpillWeightsAndHints(LiveIntervals &LIS, MachineFunction &MF,
+                                     const MachineLoopInfo &MLI,
+                                     const MachineBlockFrequencyInfo &MBFI);
 }
 
 #endif // LLVM_CODEGEN_CALCSPILLWEIGHTS_H
index d02ee03adbd6b66279ec9898bf9dc1550d25c820..087d737ad37dff0972ca397e325fb6c4c53ec5f6 100644 (file)
@@ -22,7 +22,7 @@
 #include "llvm/Target/TargetRegisterInfo.h"
 using namespace llvm;
 
-void llvm::calculateSpillWeights(LiveIntervals &LIS,
+void llvm::calculateSpillWeightsAndHints(LiveIntervals &LIS,
                            MachineFunction &MF,
                            const MachineLoopInfo &MLI,
                            const MachineBlockFrequencyInfo &MBFI) {
@@ -35,7 +35,7 @@ void llvm::calculateSpillWeights(LiveIntervals &LIS,
     unsigned Reg = TargetRegisterInfo::index2VirtReg(i);
     if (MRI.reg_nodbg_empty(Reg))
       continue;
-    VRAI.CalculateWeightAndHint(LIS.getInterval(Reg));
+    VRAI.calculateSpillWeightAndHint(LIS.getInterval(Reg));
   }
 }
 
@@ -92,7 +92,7 @@ static bool isRematerializable(const LiveInterval &LI,
 }
 
 void
-VirtRegAuxInfo::CalculateWeightAndHint(LiveInterval &li) {
+VirtRegAuxInfo::calculateSpillWeightAndHint(LiveInterval &li) {
   MachineRegisterInfo &mri = MF.getRegInfo();
   const TargetRegisterInfo &tri = *MF.getTarget().getRegisterInfo();
   MachineBasicBlock *mbb = 0;
index 09b0cede91db507edb81a1856b9b0817e9a0737f..cb70c43bf551784b74f29e2aaffccc045419eacc 100644 (file)
@@ -414,6 +414,6 @@ LiveRangeEdit::calculateRegClassAndHint(MachineFunction &MF,
     if (MRI.recomputeRegClass(LI.reg, MF.getTarget()))
       DEBUG(dbgs() << "Inflated " << PrintReg(LI.reg) << " to "
                    << MRI.getRegClass(LI.reg)->getName() << '\n');
-    VRAI.CalculateWeightAndHint(LI);
+    VRAI.calculateSpillWeightAndHint(LI);
   }
 }
index 6926a8915a035b5067099f6584af276981b20867..6768e45c6cd305eaf9d592d3a82e766426f67062 100644 (file)
@@ -278,9 +278,9 @@ bool RABasic::runOnMachineFunction(MachineFunction &mf) {
                      getAnalysis<LiveIntervals>(),
                      getAnalysis<LiveRegMatrix>());
 
-  calculateSpillWeights(*LIS, *MF,
-                        getAnalysis<MachineLoopInfo>(),
-                        getAnalysis<MachineBlockFrequencyInfo>());
+  calculateSpillWeightsAndHints(*LIS, *MF,
+                                getAnalysis<MachineLoopInfo>(),
+                                getAnalysis<MachineBlockFrequencyInfo>());
 
   SpillerInstance.reset(createInlineSpiller(*this, *MF, *VRM));
 
index 5db9502d1014ce22c115bec728ac8b5629f090ef..95b30a4823be55e96ce16fbc56f2465530d140c1 100644 (file)
@@ -1838,7 +1838,7 @@ bool RAGreedy::runOnMachineFunction(MachineFunction &mf) {
   SpillPlacer = &getAnalysis<SpillPlacement>();
   DebugVars = &getAnalysis<LiveDebugVariables>();
 
-  calculateSpillWeights(*LIS, mf, *Loops, *MBFI);
+  calculateSpillWeightsAndHints(*LIS, mf, *Loops, *MBFI);
 
   DEBUG(LIS->dump());
 
index 77d78709cf00f560645e32b12654d65058b8179a..88c8201fd4b25242ac0fc2b0256b1b8ea2247eaf 100644 (file)
@@ -549,7 +549,8 @@ bool RegAllocPBQP::runOnMachineFunction(MachineFunction &MF) {
   lss = &getAnalysis<LiveStacks>();
   mbfi = &getAnalysis<MachineBlockFrequencyInfo>();
 
-  calculateSpillWeights(*lis, MF, getAnalysis<MachineLoopInfo>(), *mbfi);
+  calculateSpillWeightsAndHints(*lis, MF, getAnalysis<MachineLoopInfo>(),
+                                *mbfi);
 
   vrm = &getAnalysis<VirtRegMap>();
   spiller.reset(createInlineSpiller(*this, MF, *vrm));