15#ifndef LLVM_CODEGEN_REGALLOCSCORE_H_
16#define LLVM_CODEGEN_REGALLOCSCORE_H_
22class MachineBasicBlock;
23class MachineBlockFrequencyInfo;
29 double CopyCounts = 0.0;
30 double LoadCounts = 0.0;
31 double StoreCounts = 0.0;
32 double CheapRematCounts = 0.0;
33 double LoadStoreCounts = 0.0;
34 double ExpensiveRematCounts = 0.0;
47 void onCopy(
double Freq) { CopyCounts += Freq; }
48 void onLoad(
double Freq) { LoadCounts += Freq; }
49 void onStore(
double Freq) { StoreCounts += Freq; }
64 const MachineBlockFrequencyInfo &MBFI);
68 const MachineFunction &MF,
double copyCounts() const
void onLoadStore(double Freq)
RegAllocScore & operator+=(const RegAllocScore &Other)
void onCheapRemat(double Freq)
bool operator!=(const RegAllocScore &Other) const
double cheapRematCounts() const
void onStore(double Freq)
double storeCounts() const
void onExpensiveRemat(double Freq)
double expensiveRematCounts() const
double loadStoreCounts() const
RegAllocScore(const RegAllocScore &)=default
double loadCounts() const
An efficient, type-erasing, non-owning reference to a callable.
This is an optimization pass for GlobalISel generic memory operations.
RegAllocScore calculateRegAllocScore(const MachineFunction &MF, const MachineBlockFrequencyInfo &MBFI)
Calculate a score.