#include "RegAllocPriorityAdvisor.h"
#include "RegAllocGreedy.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/VirtRegMap.h"
#include "llvm/IR/Module.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
usingnamespacellvm;
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")));
char RegAllocPriorityAdvisorAnalysis::ID = …;
INITIALIZE_PASS(…)
namespace {
class DefaultPriorityAdvisorAnalysis final
: public RegAllocPriorityAdvisorAnalysis { … };
}
template <> Pass *llvm::callDefaultCtor<RegAllocPriorityAdvisorAnalysis>() { … }
StringRef RegAllocPriorityAdvisorAnalysis::getPassName() const { … }
RegAllocPriorityAdvisor::RegAllocPriorityAdvisor(const MachineFunction &MF,
const RAGreedy &RA,
SlotIndexes *const Indexes)
: … { … }