projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[Stackmaps] Record the stack size of each function that contains a stackmap/patchpoin...
[oota-llvm.git]
/
include
/
llvm
/
CodeGen
/
CalcSpillWeights.h
diff --git
a/include/llvm/CodeGen/CalcSpillWeights.h
b/include/llvm/CodeGen/CalcSpillWeights.h
index 60be6115272e85cb98c9d66d8dad7c66488b85ca..0d79b1d41bdbc5c13289969612314dd4162ce00b 100644
(file)
--- a/
include/llvm/CodeGen/CalcSpillWeights.h
+++ b/
include/llvm/CodeGen/CalcSpillWeights.h
@@
-43,16
+43,23
@@
namespace llvm {
/// \brief Calculate auxiliary information for a virtual register such as its
/// spill weight and allocation hint.
class VirtRegAuxInfo {
/// \brief Calculate auxiliary information for a virtual register such as its
/// spill weight and allocation hint.
class VirtRegAuxInfo {
+ public:
+ typedef float (*NormalizingFn)(float, unsigned);
+
+ private:
MachineFunction &MF;
LiveIntervals &LIS;
const MachineLoopInfo &Loops;
const MachineBlockFrequencyInfo &MBFI;
DenseMap<unsigned, float> Hint;
MachineFunction &MF;
LiveIntervals &LIS;
const MachineLoopInfo &Loops;
const MachineBlockFrequencyInfo &MBFI;
DenseMap<unsigned, float> Hint;
+ NormalizingFn normalize;
+
public:
VirtRegAuxInfo(MachineFunction &mf, LiveIntervals &lis,
const MachineLoopInfo &loops,
public:
VirtRegAuxInfo(MachineFunction &mf, LiveIntervals &lis,
const MachineLoopInfo &loops,
- const MachineBlockFrequencyInfo &mbfi)
- : MF(mf), LIS(lis), Loops(loops), MBFI(mbfi) {}
+ const MachineBlockFrequencyInfo &mbfi,
+ NormalizingFn norm = normalizeSpillWeight)
+ : MF(mf), LIS(lis), Loops(loops), MBFI(mbfi), normalize(norm) {}
/// \brief (re)compute li's spill weight and allocation hint.
void calculateSpillWeightAndHint(LiveInterval &li);
/// \brief (re)compute li's spill weight and allocation hint.
void calculateSpillWeightAndHint(LiveInterval &li);
@@
-62,7
+69,9
@@
namespace llvm {
/// live intervals.
void calculateSpillWeightsAndHints(LiveIntervals &LIS, MachineFunction &MF,
const MachineLoopInfo &MLI,
/// live intervals.
void calculateSpillWeightsAndHints(LiveIntervals &LIS, MachineFunction &MF,
const MachineLoopInfo &MLI,
- const MachineBlockFrequencyInfo &MBFI);
+ const MachineBlockFrequencyInfo &MBFI,
+ VirtRegAuxInfo::NormalizingFn norm =
+ normalizeSpillWeight);
}
#endif // LLVM_CODEGEN_CALCSPILLWEIGHTS_H
}
#endif // LLVM_CODEGEN_CALCSPILLWEIGHTS_H