本文整理汇总了C++中TargetPassConfig::addRegBankSelect方法的典型用法代码示例。如果您正苦于以下问题:C++ TargetPassConfig::addRegBankSelect方法的具体用法?C++ TargetPassConfig::addRegBankSelect怎么用?C++ TargetPassConfig::addRegBankSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TargetPassConfig
的用法示例。
在下文中一共展示了TargetPassConfig::addRegBankSelect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MachineModuleInfo
/// addPassesToX helper drives creation and initialization of TargetPassConfig.
static MCContext *
addPassesToGenerateCode(LLVMTargetMachine *TM, PassManagerBase &PM,
bool DisableVerify, AnalysisID StartBefore,
AnalysisID StartAfter, AnalysisID StopBefore,
AnalysisID StopAfter,
MachineFunctionInitializer *MFInitializer = nullptr) {
// When in emulated TLS mode, add the LowerEmuTLS pass.
if (TM->Options.EmulatedTLS)
PM.add(createLowerEmuTLSPass(TM));
PM.add(createPreISelIntrinsicLoweringPass());
// Add internal analysis passes from the target machine.
PM.add(createTargetTransformInfoWrapperPass(TM->getTargetIRAnalysis()));
// Targets may override createPassConfig to provide a target-specific
// subclass.
TargetPassConfig *PassConfig = TM->createPassConfig(PM);
PassConfig->setStartStopPasses(StartBefore, StartAfter, StopBefore,
StopAfter);
// Set PassConfig options provided by TargetMachine.
PassConfig->setDisableVerify(DisableVerify);
PM.add(PassConfig);
PassConfig->addIRPasses();
PassConfig->addCodeGenPrepare();
PassConfig->addPassesToHandleExceptions();
PassConfig->addISelPrepare();
MachineModuleInfo *MMI = new MachineModuleInfo(TM);
MMI->setMachineFunctionInitializer(MFInitializer);
PM.add(MMI);
// Enable FastISel with -fast, but allow that to be overridden.
TM->setO0WantsFastISel(EnableFastISelOption != cl::BOU_FALSE);
if (EnableFastISelOption == cl::BOU_TRUE ||
(TM->getOptLevel() == CodeGenOpt::None &&
TM->getO0WantsFastISel()))
TM->setFastISel(true);
// Ask the target for an isel.
if (LLVM_UNLIKELY(EnableGlobalISel)) {
if (PassConfig->addIRTranslator())
return nullptr;
PassConfig->addPreLegalizeMachineIR();
if (PassConfig->addLegalizeMachineIR())
return nullptr;
// Before running the register bank selector, ask the target if it
// wants to run some passes.
PassConfig->addPreRegBankSelect();
if (PassConfig->addRegBankSelect())
return nullptr;
PassConfig->addPreGlobalInstructionSelect();
if (PassConfig->addGlobalInstructionSelect())
return nullptr;
// Pass to reset the MachineFunction if the ISel failed.
PM.add(createResetMachineFunctionPass(
PassConfig->reportDiagnosticWhenGlobalISelFallback()));
// Provide a fallback path when we do not want to abort on
// not-yet-supported input.
if (LLVM_UNLIKELY(!PassConfig->isGlobalISelAbortEnabled()) &&
PassConfig->addInstSelector())
return nullptr;
} else if (PassConfig->addInstSelector())
return nullptr;
PassConfig->addMachinePasses();
PassConfig->setInitialized();
return &MMI->getContext();
}