24 "regalloc-enable-priority-advisor",
cl::Hidden,
25 cl::init(RegAllocPriorityAdvisorAnalysis::AdvisorMode::Default),
26 cl::desc(
"Enable regalloc advisor mode"),
28 clEnumValN(RegAllocPriorityAdvisorAnalysis::AdvisorMode::Default,
29 "default",
"Default"),
30 clEnumValN(RegAllocPriorityAdvisorAnalysis::AdvisorMode::Release,
31 "release",
"precompiled"),
32 clEnumValN(RegAllocPriorityAdvisorAnalysis::AdvisorMode::Development,
33 "development",
"for training")));
37 "Regalloc priority policy",
false,
true)
40class DefaultPriorityAdvisorAnalysis final
43 DefaultPriorityAdvisorAnalysis(
bool NotAsRequested)
45 NotAsRequested(NotAsRequested) {}
57 std::unique_ptr<RegAllocPriorityAdvisor>
59 return std::make_unique<DefaultPriorityAdvisor>(
60 MF,
RA, &getAnalysis<SlotIndexesWrapperPass>().getSI());
64 M.getContext().emitError(
"Requested regalloc priority advisor analysis "
65 "could be created. Using default");
68 const bool NotAsRequested;
75 case RegAllocPriorityAdvisorAnalysis::AdvisorMode::Default:
76 Ret =
new DefaultPriorityAdvisorAnalysis(
false);
78 case RegAllocPriorityAdvisorAnalysis::AdvisorMode::Development:
79#if defined(LLVM_HAVE_TFLITE)
83 case RegAllocPriorityAdvisorAnalysis::AdvisorMode::Release:
89 return new DefaultPriorityAdvisorAnalysis(
true);
92StringRef RegAllocPriorityAdvisorAnalysis::getPassName()
const {
95 return "Default Regalloc Priority Advisor";
97 return "Release mode Regalloc Priority Advisor";
99 return "Development mode Regalloc Priority Advisor";
107 :
RA(
RA), LIS(
RA.getLiveIntervals()), VRM(
RA.getVirtRegMap()),
108 MRI(&VRM->getRegInfo()),
TRI(MF.getSubtarget().getRegisterInfo()),
109 RegClassInfo(
RA.getRegClassInfo()), Indexes(Indexes),
110 RegClassPriorityTrumpsGlobalness(
111 RA.getRegClassPriorityTrumpsGlobalness()),
112 ReverseLocalAssignment(
RA.getReverseLocalAssignment()) {}
unsigned const MachineRegisterInfo * MRI
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
Module.h This file contains the declarations for the Module class.
unsigned const TargetRegisterInfo * TRI
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
static cl::opt< RegAllocPriorityAdvisorAnalysis::AdvisorMode > Mode("regalloc-enable-priority-advisor", cl::Hidden, cl::init(RegAllocPriorityAdvisorAnalysis::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocPriorityAdvisorAnalysis::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocPriorityAdvisorAnalysis::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocPriorityAdvisorAnalysis::AdvisorMode::Development, "development", "for training")))
SI optimize exec mask operations pre RA
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
A Module instance is used to store all the information related to an LLVM module.
Pass interface - Implemented by all 'passes'.
virtual bool doInitialization(Module &)
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
AdvisorMode getAdvisorMode() const
virtual std::unique_ptr< RegAllocPriorityAdvisor > getAdvisor(const MachineFunction &MF, const RAGreedy &RA)=0
Get an advisor for the given context (i.e. machine function, etc)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
RegAllocPriorityAdvisor(const RegAllocPriorityAdvisor &)=delete
StringRef - Represent a constant reference to a string, i.e.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
ValuesClass values(OptsTy... Options)
Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
RegAllocPriorityAdvisorAnalysis * createReleaseModePriorityAdvisor()
RegAllocPriorityAdvisorAnalysis * createDevelopmentModePriorityAdvisor()
Pass * callDefaultCtor< RegAllocPriorityAdvisorAnalysis >()
Specialization for the API used by the analysis infrastructure to create an instance of the priority ...