diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/libs/llvm12/include/llvm/CodeGen/CalcSpillWeights.h | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/llvm12/include/llvm/CodeGen/CalcSpillWeights.h')
-rw-r--r-- | contrib/libs/llvm12/include/llvm/CodeGen/CalcSpillWeights.h | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/contrib/libs/llvm12/include/llvm/CodeGen/CalcSpillWeights.h b/contrib/libs/llvm12/include/llvm/CodeGen/CalcSpillWeights.h index 8b7fe2f307..defa1590c1 100644 --- a/contrib/libs/llvm12/include/llvm/CodeGen/CalcSpillWeights.h +++ b/contrib/libs/llvm12/include/llvm/CodeGen/CalcSpillWeights.h @@ -53,57 +53,57 @@ class VirtRegMap; class VirtRegAuxInfo { MachineFunction &MF; LiveIntervals &LIS; - const VirtRegMap &VRM; + const VirtRegMap &VRM; const MachineLoopInfo &Loops; const MachineBlockFrequencyInfo &MBFI; public: - VirtRegAuxInfo(MachineFunction &MF, LiveIntervals &LIS, - const VirtRegMap &VRM, const MachineLoopInfo &Loops, - const MachineBlockFrequencyInfo &MBFI) - : MF(MF), LIS(LIS), VRM(VRM), Loops(Loops), MBFI(MBFI) {} + VirtRegAuxInfo(MachineFunction &MF, LiveIntervals &LIS, + const VirtRegMap &VRM, const MachineLoopInfo &Loops, + const MachineBlockFrequencyInfo &MBFI) + : MF(MF), LIS(LIS), VRM(VRM), Loops(Loops), MBFI(MBFI) {} + + virtual ~VirtRegAuxInfo() = default; - virtual ~VirtRegAuxInfo() = default; - /// (re)compute li's spill weight and allocation hint. - void calculateSpillWeightAndHint(LiveInterval &LI); + void calculateSpillWeightAndHint(LiveInterval &LI); - /// Compute future expected spill weight of a split artifact of LI + /// Compute future expected spill weight of a split artifact of LI /// that will span between start and end slot indexes. - /// \param LI The live interval to be split. - /// \param Start The expected beginning of the split artifact. Instructions + /// \param LI The live interval to be split. + /// \param Start The expected beginning of the split artifact. Instructions /// before start will not affect the weight. - /// \param End The expected end of the split artifact. Instructions + /// \param End The expected end of the split artifact. Instructions /// after end will not affect the weight. /// \return The expected spill weight of the split artifact. Returns - /// negative weight for unspillable LI. - float futureWeight(LiveInterval &LI, SlotIndex Start, SlotIndex End); - - /// Compute spill weights and allocation hints for all virtual register - /// live intervals. - void calculateSpillWeightsAndHints(); - - protected: + /// negative weight for unspillable LI. + float futureWeight(LiveInterval &LI, SlotIndex Start, SlotIndex End); + + /// Compute spill weights and allocation hints for all virtual register + /// live intervals. + void calculateSpillWeightsAndHints(); + + protected: /// Helper function for weight calculations. - /// (Re)compute LI's spill weight and allocation hint, or, for non null + /// (Re)compute LI's spill weight and allocation hint, or, for non null /// start and end - compute future expected spill weight of a split - /// artifact of LI that will span between start and end slot indexes. - /// \param LI The live interval for which to compute the weight. - /// \param Start The expected beginning of the split artifact. Instructions + /// artifact of LI that will span between start and end slot indexes. + /// \param LI The live interval for which to compute the weight. + /// \param Start The expected beginning of the split artifact. Instructions /// before start will not affect the weight. Relevant for /// weight calculation of future split artifact. - /// \param End The expected end of the split artifact. Instructions + /// \param End The expected end of the split artifact. Instructions /// after end will not affect the weight. Relevant for /// weight calculation of future split artifact. - /// \return The spill weight. Returns negative weight for unspillable LI. - float weightCalcHelper(LiveInterval &LI, SlotIndex *Start = nullptr, - SlotIndex *End = nullptr); - - /// Weight normalization function. - virtual float normalize(float UseDefFreq, unsigned Size, - unsigned NumInstr) { - return normalizeSpillWeight(UseDefFreq, Size, NumInstr); - } + /// \return The spill weight. Returns negative weight for unspillable LI. + float weightCalcHelper(LiveInterval &LI, SlotIndex *Start = nullptr, + SlotIndex *End = nullptr); + + /// Weight normalization function. + virtual float normalize(float UseDefFreq, unsigned Size, + unsigned NumInstr) { + return normalizeSpillWeight(UseDefFreq, Size, NumInstr); + } }; } // end namespace llvm |