mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
Move more fragments of spill weight calculation into CalcSpillWeights.h
Simplify the spill weight calculation a bit by bypassing getApproximateInstructionCount() and using LiveInterval::getSize() directly. This changes the computed spill weights, but only by a constant factor in each function. It should not affect how spill weights compare against each other, and so it shouldn't affect code generation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125530 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "VirtRegMap.h"
|
||||
#include "llvm/Value.h"
|
||||
#include "llvm/Analysis/AliasAnalysis.h"
|
||||
#include "llvm/CodeGen/CalcSpillWeights.h"
|
||||
#include "llvm/CodeGen/LiveVariables.h"
|
||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||
#include "llvm/CodeGen/MachineInstr.h"
|
||||
@@ -1706,10 +1707,10 @@ LiveIntervals::getSpillWeight(bool isDef, bool isUse, unsigned loopDepth) {
|
||||
return (isDef + isUse) * lc;
|
||||
}
|
||||
|
||||
void
|
||||
LiveIntervals::normalizeSpillWeights(std::vector<LiveInterval*> &NewLIs) {
|
||||
static void normalizeSpillWeights(std::vector<LiveInterval*> &NewLIs) {
|
||||
for (unsigned i = 0, e = NewLIs.size(); i != e; ++i)
|
||||
normalizeSpillWeight(*NewLIs[i]);
|
||||
NewLIs[i]->weight =
|
||||
normalizeSpillWeight(NewLIs[i]->weight, NewLIs[i]->getSize());
|
||||
}
|
||||
|
||||
std::vector<LiveInterval*> LiveIntervals::
|
||||
|
Reference in New Issue
Block a user