LLVM: include/llvm/CodeGen/CalcSpillWeights.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9#ifndef LLVM_CODEGEN_CALCSPILLWEIGHTS_H

10#define LLVM_CODEGEN_CALCSPILLWEIGHTS_H

11

13

14namespace llvm {

15

23

24

25

26

27

28

29

30

31

32

33

35 unsigned NumInstr) {

36

37

38

39

40

42 }

43

44

45

53

54

55

56 bool isLiveAtStatepointVarArg(LiveInterval &LI);

57

58 public:

63 : MF(MF), LIS(LIS), VRM(VRM), Loops(Loops), PSI(PSI), MBFI(MBFI) {}

64

66

67

69

70

71

73

74

75

79

80

86

87

88

93

94 protected:

95

96

97

98

99

100

101

102

103

104

105

106

109

110

112 unsigned NumInstr) {

114 }

115 };

116}

117

118#endif

unsigned const MachineRegisterInfo * MRI

const HexagonInstrInfo * TII

Register const TargetRegisterInfo * TRI

LiveInterval - This class represents the liveness of a register, or stack slot.

MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...

Representation of each machine instruction.

MachineRegisterInfo - Keep track of information for virtual and physical registers,...

Analysis providing profile information.

Wrapper class representing virtual and physical registers.

SlotIndex - An opaque wrapper around machine indexes.

@ InstrDist

The default distance between instructions as returned by distance().

TargetInstrInfo - Interface to description of machine instruction set.

TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...

static bool allUsesAvailableAt(const MachineInstr *MI, SlotIndex UseIdx, const LiveIntervals &LIS, const MachineRegisterInfo &MRI, const TargetInstrInfo &TII)

float weightCalcHelper(LiveInterval &LI, SlotIndex *Start=nullptr, SlotIndex *End=nullptr)

Helper function for weight calculations.

virtual ~VirtRegAuxInfo()=default

void calculateSpillWeightsAndHints()

Compute spill weights and allocation hints for all virtual register live intervals.

VirtRegAuxInfo(MachineFunction &MF, LiveIntervals &LIS, const VirtRegMap &VRM, const MachineLoopInfo &Loops, const MachineBlockFrequencyInfo &MBFI, ProfileSummaryInfo *PSI=nullptr)

Definition CalcSpillWeights.h:59

static bool isRematerializable(const LiveInterval &LI, const LiveIntervals &LIS, const VirtRegMap &VRM, const MachineRegisterInfo &MRI, const TargetInstrInfo &TII)

Determine if all values in LI are rematerializable.

virtual float normalize(float UseDefFreq, unsigned Size, unsigned NumInstr)

Weight normalization function.

Definition CalcSpillWeights.h:111

static Register copyHint(const MachineInstr *MI, Register Reg, const TargetRegisterInfo &TRI, const MachineRegisterInfo &MRI)

Return the preferred allocation register for reg, given a COPY instruction.

void calculateSpillWeightAndHint(LiveInterval &LI)

(re)compute li's spill weight and allocation hint.

This is an optimization pass for GlobalISel generic memory operations.

static float normalizeSpillWeight(float UseDefFreq, unsigned Size, unsigned NumInstr)

Normalize the spill weight of a live interval.

Definition CalcSpillWeights.h:34