mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Symbolize the default instruction distance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127013 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e90756d8a0
commit
bee41501fa
@ -11,7 +11,7 @@
|
||||
#ifndef LLVM_CODEGEN_CALCSPILLWEIGHTS_H
|
||||
#define LLVM_CODEGEN_CALCSPILLWEIGHTS_H
|
||||
|
||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||
#include "llvm/CodeGen/SlotIndexes.h"
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
|
||||
namespace llvm {
|
||||
@ -29,15 +29,12 @@ namespace llvm {
|
||||
/// @param Size Size of live interval as returnexd by getSize()
|
||||
///
|
||||
static inline float normalizeSpillWeight(float UseDefFreq, unsigned Size) {
|
||||
// The magic constant 200 corresponds to approx. 25 instructions since
|
||||
// SlotIndexes allocate 8 slots per instruction.
|
||||
//
|
||||
// The constant is added to avoid depending too much on accidental SlotIndex
|
||||
// gaps for small intervals. The effect is that small intervals have a spill
|
||||
// weight that is mostly proportional to the number of uses, while large
|
||||
// intervals get a spill weight that is closer to a use density.
|
||||
//
|
||||
return UseDefFreq / (Size + 200);
|
||||
// The constant 25 instructions is added to avoid depending too much on
|
||||
// accidental SlotIndex gaps for small intervals. The effect is that small
|
||||
// intervals have a spill weight that is mostly proportional to the number
|
||||
// of uses, while large intervals get a spill weight that is closer to a use
|
||||
// density.
|
||||
return UseDefFreq / (Size + 25*SlotIndex::InstrDist);
|
||||
}
|
||||
|
||||
/// VirtRegAuxInfo - Calculate auxiliary information for a virtual
|
||||
|
@ -110,6 +110,12 @@ namespace llvm {
|
||||
}
|
||||
|
||||
public:
|
||||
enum {
|
||||
/// The default distance between instructions as returned by distance().
|
||||
/// This may vary as instructions are inserted and removed.
|
||||
InstrDist = 2*NUM
|
||||
};
|
||||
|
||||
static inline SlotIndex getEmptyKey() {
|
||||
return SlotIndex(0, 1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user