Go to the documentation of this file.
9 #ifndef LLVM_CODEGEN_REGALLOCEVICTIONADVISOR_H
10 #define LLVM_CODEGEN_REGALLOCEVICTIONADVISOR_H
17 #include "llvm/Config/llvm-config.h"
22 class AllocationOrder;
26 class MachineFunction;
27 class MachineRegisterInfo;
28 class RegisterClassInfo;
29 class TargetRegisterInfo;
92 std::tie(
O.BrokenHints,
O.MaxWeight);
110 uint8_t CostPerUseLimit,
const SmallVirtRegSet &FixedRegisters)
const = 0;
131 unsigned CostPerUseLimit)
const;
153 unsigned NextCascade = 1;
180 virtual std::unique_ptr<RegAllocEvictionAdvisor>
225 #endif // LLVM_CODEGEN_REGALLOCEVICTIONADVISOR_H
This is an optimization pass for GlobalISel generic memory operations.
print lazy value Lazy Value Info Printer Pass
ImmutableAnalysis abstraction for fetching the Eviction Advisor.
ImmutablePass class - This class is used to provide information that does not need to be run.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
virtual ~RegAllocEvictionAdvisor()=default
@ RS_New
Newly created live range that has never been queued.
bool canAllocatePhysReg(unsigned CostPerUseLimit, MCRegister PhysReg) const
@ RS_Split
Attempt live range splitting if assignment is impossible.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
const bool EnableLocalReassign
Run or not the local reassignment heuristic.
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
@ RS_Spill
Live range will be spilled. No more splitting will be attempted.
Pass * callDefaultCtor< RegAllocEvictionAdvisorAnalysis >()
Specialization for the API used by the analysis infrastructure to create an instance of the eviction ...
AdvisorMode getAdvisorMode() const
RegAllocEvictionAdvisor(const RegAllocEvictionAdvisor &)=delete
@ RS_Done
There is nothing more we can do to this live range.
Clang compiles this i1 i64 store i64 i64 store i64 i64 store i64 i64 store i64 align Which gets codegen d xmm0 movaps rbp movaps rbp movaps rbp movaps rbp rbp rbp rbp rbp It would be better to have movq s of instead of the movaps s LLVM produces ret int
Represent the analysis usage information of a pass.
float MaxWeight
Maximum spill weight evicted.
Cost of evicting interference - used by default advisor, and the eviction chain heuristic in RegAlloc...
RegAllocEvictionAdvisorAnalysis * createDevelopmentModeAdvisor()
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
LiveInterval - This class represents the liveness of a register, or stack slot.
const ArrayRef< uint8_t > RegCosts
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
RegAllocEvictionAdvisorAnalysis(AdvisorMode Mode)
const TargetRegisterInfo *const TRI
bool operator<(const EvictionCost &O) const
const MachineFunction & MF
MachineRegisterInfo *const MRI
StringRef - Represent a constant reference to a string, i.e.
DefaultEvictionAdvisor(const MachineFunction &MF, const RAGreedy &RA)
@ RS_Assign
Only attempt assignment and eviction. Then requeue as RS_Split.
unsigned BrokenHints
Total number of broken hints.
Wrapper class representing virtual and physical registers.
RegAllocEvictionAdvisorAnalysis * createReleaseModeAdvisor()
Optional< unsigned > getOrderLimit(const LiveInterval &VirtReg, const AllocationOrder &Order, unsigned CostPerUseLimit) const
void setPreservesAll()
Set by analyses that do not transform their input at all.
@ RS_Memory
Live range is in memory.
virtual bool canEvictHintInterference(const LiveInterval &VirtReg, MCRegister PhysReg, const SmallVirtRegSet &FixedRegisters) const =0
Find out if we can evict the live ranges occupying the given PhysReg, which is a hint (preferred regi...
const RegisterClassInfo & RegClassInfo
Register canReassign(const LiveInterval &VirtReg, Register PrevReg) const
@ RS_Split2
Attempt more aggressive live range splitting that is guaranteed to make progress.
bool isUnusedCalleeSavedReg(MCRegister PhysReg) const
Returns true if the given PhysReg is a callee saved register and has not been used for allocation yet...
void setBrokenHints(unsigned NHints)
LiveRegMatrix *const Matrix
virtual MCRegister tryFindEvictionCandidate(const LiveInterval &VirtReg, const AllocationOrder &Order, uint8_t CostPerUseLimit, const SmallVirtRegSet &FixedRegisters) const =0
Find a physical register that can be freed by evicting the FixedRegisters, or return NoRegister.
virtual std::unique_ptr< RegAllocEvictionAdvisor > getAdvisor(const MachineFunction &MF, const RAGreedy &RA)=0
Get an advisor for the given context (i.e. machine function, etc)
Wrapper class representing physical registers. Should be passed by value.