[llvm] r194404 - CalcSpillWeights: give a better describing name to calculateSpillWeights
Arnaud A. de Grandmaison
arnaud.adegm at gmail.com
Mon Nov 11 11:04:45 PST 2013
Author: aadg
Date: Mon Nov 11 13:04:45 2013
New Revision: 194404
URL: http://llvm.org/viewvc/llvm-project?rev=194404&view=rev
Log:
CalcSpillWeights: give a better describing name to calculateSpillWeights
Besides, this relates it more obviously to the VirtRegAuxInfo::calculateSpillWeightAndHint.
No functionnal change.
Modified:
llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h
llvm/trunk/lib/CodeGen/CalcSpillWeights.cpp
llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp
llvm/trunk/lib/CodeGen/RegAllocBasic.cpp
llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp
Modified: llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h?rev=194404&r1=194403&r2=194404&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h (original)
+++ llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h Mon Nov 11 13:04:45 2013
@@ -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
Modified: llvm/trunk/lib/CodeGen/CalcSpillWeights.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CalcSpillWeights.cpp?rev=194404&r1=194403&r2=194404&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/CalcSpillWeights.cpp (original)
+++ llvm/trunk/lib/CodeGen/CalcSpillWeights.cpp Mon Nov 11 13:04:45 2013
@@ -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(LiveInt
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 Liv
}
void
-VirtRegAuxInfo::CalculateWeightAndHint(LiveInterval &li) {
+VirtRegAuxInfo::calculateSpillWeightAndHint(LiveInterval &li) {
MachineRegisterInfo &mri = MF.getRegInfo();
const TargetRegisterInfo &tri = *MF.getTarget().getRegisterInfo();
MachineBasicBlock *mbb = 0;
Modified: llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp?rev=194404&r1=194403&r2=194404&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp Mon Nov 11 13:04:45 2013
@@ -414,6 +414,6 @@ LiveRangeEdit::calculateRegClassAndHint(
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);
}
}
Modified: llvm/trunk/lib/CodeGen/RegAllocBasic.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocBasic.cpp?rev=194404&r1=194403&r2=194404&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocBasic.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocBasic.cpp Mon Nov 11 13:04:45 2013
@@ -278,9 +278,9 @@ bool RABasic::runOnMachineFunction(Machi
getAnalysis<LiveIntervals>(),
getAnalysis<LiveRegMatrix>());
- calculateSpillWeights(*LIS, *MF,
- getAnalysis<MachineLoopInfo>(),
- getAnalysis<MachineBlockFrequencyInfo>());
+ calculateSpillWeightsAndHints(*LIS, *MF,
+ getAnalysis<MachineLoopInfo>(),
+ getAnalysis<MachineBlockFrequencyInfo>());
SpillerInstance.reset(createInlineSpiller(*this, *MF, *VRM));
Modified: llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp?rev=194404&r1=194403&r2=194404&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp Mon Nov 11 13:04:45 2013
@@ -1838,7 +1838,7 @@ bool RAGreedy::runOnMachineFunction(Mach
SpillPlacer = &getAnalysis<SpillPlacement>();
DebugVars = &getAnalysis<LiveDebugVariables>();
- calculateSpillWeights(*LIS, mf, *Loops, *MBFI);
+ calculateSpillWeightsAndHints(*LIS, mf, *Loops, *MBFI);
DEBUG(LIS->dump());
Modified: llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp?rev=194404&r1=194403&r2=194404&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp Mon Nov 11 13:04:45 2013
@@ -549,7 +549,8 @@ bool RegAllocPBQP::runOnMachineFunction(
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));
More information about the llvm-commits
mailing list