summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArnaud A. de Grandmaison <arnaud.adegm@gmail.com>2013-11-10 17:46:31 +0000
committerArnaud A. de Grandmaison <arnaud.adegm@gmail.com>2013-11-10 17:46:31 +0000
commita77da0579bc141eba62760e21a216e5d3eafd792 (patch)
tree5eff822ea3d802fead34e48f3b70d5225e606fbe /include
parenta22657f45757bd11603bec893aa041425d089819 (diff)
downloadllvm-a77da0579bc141eba62760e21a216e5d3eafd792.tar.gz
llvm-a77da0579bc141eba62760e21a216e5d3eafd792.tar.bz2
llvm-a77da0579bc141eba62760e21a216e5d3eafd792.tar.xz
CalculateSpillWeights does not need to be a pass
Based on discussions with Lang Hames and Jakob Stoklund Olesen at the hacker's lab, and in the light of upcoming work on the PBQP register allocator, it was though that CalcSpillWeights does not need to be a pass. This change will enable to customize / tune the spill weight computation depending on the allocator. Update the documentation style while there. No functionnal change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194356 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/CalcSpillWeights.h33
-rw-r--r--include/llvm/InitializePasses.h1
2 files changed, 11 insertions, 23 deletions
diff --git a/include/llvm/CodeGen/CalcSpillWeights.h b/include/llvm/CodeGen/CalcSpillWeights.h
index c8ec76410c..00d9c6a5e6 100644
--- a/include/llvm/CodeGen/CalcSpillWeights.h
+++ b/include/llvm/CodeGen/CalcSpillWeights.h
@@ -21,7 +21,9 @@ namespace llvm {
class MachineBlockFrequencyInfo;
class MachineLoopInfo;
- /// normalizeSpillWeight - The spill weight of a live interval is computed as:
+ /// \brief Normalize the spill weight of a live interval
+ ///
+ /// The spill weight of a live interval is computed as:
///
/// (sum(use freq) + sum(def freq)) / (K + size)
///
@@ -38,8 +40,8 @@ namespace llvm {
return UseDefFreq / (Size + 25*SlotIndex::InstrDist);
}
- /// VirtRegAuxInfo - Calculate auxiliary information for a virtual
- /// register such as its spill weight and allocation hint.
+ /// \brief Calculate auxiliary information for a virtual register such as its
+ /// spill weight and allocation hint.
class VirtRegAuxInfo {
MachineFunction &MF;
LiveIntervals &LIS;
@@ -52,29 +54,16 @@ namespace llvm {
const MachineBlockFrequencyInfo &mbfi)
: MF(mf), LIS(lis), Loops(loops), MBFI(mbfi) {}
- /// CalculateWeightAndHint - (re)compute li's spill weight and allocation
- /// hint.
+ /// \brief (re)compute li's spill weight and allocation hint.
void CalculateWeightAndHint(LiveInterval &li);
};
- /// CalculateSpillWeights - Compute spill weights for all virtual register
+ /// \brief Compute spill weights and allocation hints for all virtual register
/// live intervals.
- class CalculateSpillWeights : public MachineFunctionPass {
- public:
- static char ID;
-
- CalculateSpillWeights() : MachineFunctionPass(ID) {
- initializeCalculateSpillWeightsPass(*PassRegistry::getPassRegistry());
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &au) const;
-
- virtual bool runOnMachineFunction(MachineFunction &fn);
-
- private:
- /// Returns true if the given live interval is zero length.
- bool isZeroLengthInterval(LiveInterval *li) const;
- };
+ void calculateSpillWeights(LiveIntervals &LIS,
+ MachineFunction &MF,
+ const MachineLoopInfo &MLI,
+ const MachineBlockFrequencyInfo &MBFI);
}
diff --git a/include/llvm/InitializePasses.h b/include/llvm/InitializePasses.h
index fe26c2381a..68825a33a1 100644
--- a/include/llvm/InitializePasses.h
+++ b/include/llvm/InitializePasses.h
@@ -89,7 +89,6 @@ void initializeCFGSimplifyPassPass(PassRegistry&);
void initializeFlattenCFGPassPass(PassRegistry&);
void initializeStructurizeCFGPass(PassRegistry&);
void initializeCFGViewerPass(PassRegistry&);
-void initializeCalculateSpillWeightsPass(PassRegistry&);
void initializeCodeGenPreparePass(PassRegistry&);
void initializeConstantMergePass(PassRegistry&);
void initializeConstantPropagationPass(PassRegistry&);