62class TriggerCrashFunctionLegacyPass :
public FunctionPass {
65 TriggerCrashFunctionLegacyPass() : FunctionPass(ID) {}
70 StringRef getPassName()
const override {
return "TriggerCrashFunctionPass"; }
74char TriggerCrashFunctionLegacyPass::ID = 0;
78 "enable-machine-outliner",
cl::desc(
"Enable the machine outliner"),
82 "Run on all functions guaranteed to be beneficial"),
84 "Outline cold code only. If a code block does not have "
85 "profile data, optimistically assume it is cold."),
87 "Outline cold code only. If a code block does not have "
88 "profile, data, conservatively assume it is hot."),
126 const CodeGenOptions &Opts = CodeGenOptions::Global;
131 return applyDisable(TargetID, Opts.disable_branch_fold);
134 return applyDisable(TargetID, Opts.disable_tail_duplicate);
137 return applyDisable(TargetID, Opts.disable_early_taildup);
140 return applyDisable(TargetID, Opts.disable_block_placement);
146 return applyDisable(TargetID, Opts.disable_machine_dce);
149 return applyDisable(TargetID, Opts.disable_early_ifcvt);
152 return applyDisable(TargetID, Opts.disable_machine_licm);
155 return applyDisable(TargetID, Opts.disable_machine_cse);
158 return applyDisable(TargetID, Opts.disable_postra_machine_licm);
161 return applyDisable(TargetID, Opts.disable_machine_sink);
164 return applyDisable(TargetID, Opts.disable_postra_machine_sink);
175 const CodeGenOptions &Opts = CodeGenOptions::Global;
176 if (!Opts.fs_profile_file.empty())
177 return Opts.fs_profile_file.str();
178 const std::optional<PGOOptions> &PGOOpt = TM->
getPGOOption();
180 return std::string();
181 return PGOOpt->ProfileFile;
187 const CodeGenOptions &Opts = CodeGenOptions::Global;
188 if (!Opts.fs_remapping_file.empty())
189 return Opts.fs_remapping_file.str();
190 const std::optional<PGOOptions> &PGOOpt = TM->
getPGOOption();
192 return std::string();
193 return PGOOpt->ProfileRemappingFile;
201 "Target Pass Configuration",
false,
false)
218 assert(NP &&
"Pass ID not registered");
258 Twine(
"\" pass is not registered."));
267static std::pair<StringRef, unsigned>
270 std::tie(Name, InstanceNumStr) =
PassName.split(
',');
272 unsigned InstanceNum = 0;
276 return std::make_pair(Name, InstanceNum);
279void TargetPassConfig::setStartStopPasses() {
280 const CodeGenOptions &Opts = CodeGenOptions::Global;
281 StringRef StartBeforeName;
282 std::tie(StartBeforeName, StartBeforeInstanceNum) =
285 StringRef StartAfterName;
286 std::tie(StartAfterName, StartAfterInstanceNum) =
289 StringRef StopBeforeName;
290 std::tie(StopBeforeName, StopBeforeInstanceNum) =
293 StringRef StopAfterName;
294 std::tie(StopAfterName, StopAfterInstanceNum) =
301 if (StartBefore && StartAfter)
304 if (StopBefore && StopAfter)
307 Started = (StartAfter ==
nullptr) && (StartBefore ==
nullptr);
318 const CodeGenOptions &Opts = CodeGenOptions::Global;
328 Opts.disable_atexit_based_global_dtor_lowering;
358 const CodeGenOptions &Opts = CodeGenOptions::Global;
360#define DISABLE_PASS(Option, Name) \
361 if (Option && P.contains(#Name)) \
366 DISABLE_PASS(Opts.disable_early_ifcvt, EarlyIfConverterLegacyPass)
368 DISABLE_PASS(Opts.disable_machine_cse, MachineCSELegacyPass)
384 const CodeGenOptions &Opts = CodeGenOptions::Global;
385 auto [StartBefore, StartBeforeInstanceNum] =
387 auto [StartAfter, StartAfterInstanceNum] =
389 auto [StopBefore, StopBeforeInstanceNum] =
391 auto [StopAfter, StopAfterInstanceNum] =
394 if (!StartBefore.empty() && !StartAfter.empty())
397 std::make_error_code(std::errc::invalid_argument));
398 if (!StopBefore.empty() && !StopAfter.empty())
401 std::make_error_code(std::errc::invalid_argument));
404 Result.StartPass = StartBefore.empty() ? StartAfter : StartBefore;
405 Result.StopPass = StopBefore.empty() ? StopAfter : StopBefore;
406 Result.StartInstanceNum =
407 StartBefore.empty() ? StartAfterInstanceNum : StartBeforeInstanceNum;
408 Result.StopInstanceNum =
409 StopBefore.empty() ? StopAfterInstanceNum : StopBeforeInstanceNum;
410 Result.StartAfter = !StartAfter.empty();
411 Result.StopAfter = !StopAfter.empty();
412 Result.StartInstanceNum += Result.StartInstanceNum == 0;
413 Result.StopInstanceNum += Result.StopInstanceNum == 0;
421 const CodeGenOptions &Opts = CodeGenOptions::Global;
439 TM.Options.EnableIPRA |=
TM.useIPRA();
442 if (
TM.Options.EnableIPRA)
446 TM.setEnableTiedFastRegAlloc(Opts.regalloc_fast_tied ==
449 if (Opts.global_isel_abort)
450 TM.Options.GlobalISelAbort = *Opts.global_isel_abort;
452 if (Opts.function_splitting)
453 TM.Options.FunctionSplitting = *Opts.function_splitting;
455 setStartStopPasses();
459 return TM->getOptLevel();
466 TargetPassID != InsertedPassID.
getID()) ||
469 "Insert a pass after itself!");
470 Impl->InsertedPasses.emplace_back(TargetPassID, InsertedPassID);
485 "machine. Scheduling a CodeGen pass without a target "
490 const CodeGenOptions &Opts = CodeGenOptions::Global;
491 return Opts.stop_before.empty() && Opts.stop_after.empty();
495 const CodeGenOptions &Opts = CodeGenOptions::Global;
496 return !Opts.start_before.empty() || !Opts.start_after.empty() ||
501 const CodeGenOptions &Opts = CodeGenOptions::Global;
503 return std::string();
505 StringRef PassNames[] = {Opts.start_after, Opts.start_before, Opts.stop_after,
510 for (
int Idx = 0; Idx < 4; ++Idx)
511 if (!PassNames[Idx].empty()) {
515 Res += OptNames[Idx];
528 Impl->TargetPasses[StandardID] = TargetID;
533 I =
Impl->TargetPasses.find(
ID);
534 if (
I ==
Impl->TargetPasses.end())
560 if (StartBefore == PassID && StartBeforeCount++ == StartBeforeInstanceNum)
562 if (StopBefore == PassID && StopBeforeCount++ == StopBeforeInstanceNum)
564 if (Started && !Stopped) {
565 if (AddingMachinePasses) {
568 std::string(
"After ") + std::string(
P->getPassName());
577 for (
const auto &IP :
Impl->InsertedPasses)
578 if (IP.TargetPassID == PassID)
584 if (StopAfter == PassID && StopAfterCount++ == StopAfterInstanceNum)
587 if (StartAfter == PassID && StartAfterCount++ == StartAfterInstanceNum)
589 if (Stopped && !Started)
624 if (CodeGenOptions::Global.print_after_isel)
629 const CodeGenOptions &Opts = CodeGenOptions::Global;
631#ifdef EXPENSIVE_CHECKS
633 Verify =
TM->isMachineVerifierClean();
652 const CodeGenOptions &Opts = CodeGenOptions::Global;
653 if (AllowDebugify && DebugifyIsSafe &&
654 (
valueOr(Opts.debugify_and_strip_all_safe,
false) ||
655 valueOr(Opts.debugify_check_and_strip_all_safe,
false)))
660 const CodeGenOptions &Opts = CodeGenOptions::Global;
661 if (DebugifyIsSafe) {
662 if (
valueOr(Opts.debugify_check_and_strip_all_safe,
false)) {
665 }
else if (
valueOr(Opts.debugify_and_strip_all_safe,
false))
674 const CodeGenOptions &Opts = CodeGenOptions::Global;
690 if (!Opts.disable_lsr) {
705 if (
TM->getTargetTriple().isOSBinFormatMachO() &&
706 !Opts.disable_atexit_based_global_dtor_lowering)
717 !Opts.disable_replace_with_vec_lib)
721 !Opts.disable_partial_libcall_inlining)
734 if (!Opts.disable_expand_reductions)
741 if (Opts.enable_global_merge_func)
744 if (
TM->getTargetTriple().isOSWindows())
800 !CodeGenOptions::Global.disable_cgp)
820 if (CodeGenOptions::Global.print_isel_input)
822 dbgs(),
"\n\n*** Final LLVM Code input to ISel ***\n"));
831 const CodeGenOptions &Opts = CodeGenOptions::Global;
833 TM->setO0WantsFastISel(
valueOr(Opts.fast_isel,
true));
837 SelectorType Selector;
839 if (
valueOr(Opts.fast_isel,
false))
840 Selector = SelectorType::FastISel;
841 else if (
valueOr(Opts.global_isel,
false) ||
842 (
TM->Options.EnableGlobalISel &&
valueOr(Opts.global_isel,
true)))
843 Selector = SelectorType::GlobalISel;
845 TM->getO0WantsFastISel())
846 Selector = SelectorType::FastISel;
848 Selector = SelectorType::SelectionDAG;
851 if (Selector == SelectorType::FastISel) {
852 TM->setFastISel(
true);
853 TM->setGlobalISel(
false);
854 }
else if (Selector == SelectorType::GlobalISel) {
855 TM->setFastISel(
false);
856 TM->setGlobalISel(
true);
870 DebugifyIsSafe =
false;
873 if (Selector == SelectorType::GlobalISel) {
874 SaveAndRestore SavedAddingMachinePasses(AddingMachinePasses,
true);
898 if (Selector == SelectorType::GlobalISel)
919 if (
TM->useEmulatedTLS())
931 if (CodeGenOptions::Global.codegen_pipeline_trigger_crash)
932 addPass(
new TriggerCrashFunctionLegacyPass());
946 cl::desc(
"Register allocator to use"));
967 const CodeGenOptions &Opts = CodeGenOptions::Global;
968 AddingMachinePasses =
true;
979 if (
TM->Options.EnableIPRA)
988 DebugifyIsSafe =
false;
996 if (!ProfileFile.empty() && !Opts.disable_ra_fsprofile_loader)
1037 if (Opts.enable_implicit_null_checks)
1044 !
TM->targetSchedulesPostRAScheduling()) {
1045 if (Opts.misched_postra)
1066 if (
TM->Options.EnableIPRA)
1080 if (
TM->Options.EnableMachineOutliner &&
1084 TM->supportsDefaultOutlining())
1088 if (Opts.enable_gc_empty_basic_blocks)
1095 const bool SplitFunctions =
1098 if (SplitFunctions || Opts.split_static_data ||
1099 TM->Options.EnableStaticDataPartitioning) {
1101 if (!ProfileFile.empty()) {
1110 <<
"Using AutoFDO without FSDiscriminator for MFS may regress "
1124 if (Opts.split_static_data ||
TM->Options.EnableStaticDataPartitioning) {
1134 TM->Options.BBAddrMap) {
1139 TM->getBBSectionsFuncListBuf()));
1140 if (Opts.basic_block_section_match_infer)
1152 if (!Opts.disable_cfi_fixup &&
TM->Options.EnableCFIFixup)
1160 AddingMachinePasses =
false;
1212 "pick register allocator based on -O option",
1276 "Must use fast (default) register allocator for unoptimized regalloc.");
1305 return RegAlloc.getNumOccurrences() == 0;
1312 if (!
TM->enableTiedFastRegAlloc())
1402 if (!
TM->requiresStructuredCFG())
1417 const CodeGenOptions &Opts = CodeGenOptions::Global;
1422 if (!ProfileFile.empty() && !Opts.disable_layout_fsprofile_loader)
1429 if (Opts.enable_block_placement_stats)
1446 return std::make_unique<CSEConfigBase>();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This is the interface for LLVM's primary stateless and local alias analysis.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
This file defines the DenseMap class.
static bool runOnFunction(Function &F, bool PostInlining)
This file contains an interface for creating legacy passes to print out IR in various granularities.
ppc ctr loops PowerPC CTR Loops Verify
PassInstrumentationCallbacks PIC
This file defines the Pass Instrumentation classes that provide instrumentation points into the pass ...
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This file provides utility classes that use RAII to save and restore values.
This is the interface for a metadata-based scoped no-alias analysis.
This file defines the SmallVector class.
static const char StopAfterOptName[]
static llvm::once_flag InitializeDefaultRegisterAllocatorFlag
Register Allocation Pass Configuration.
static cl::opt< RegisterRegAlloc::FunctionPassCtor, false, RegisterPassParser< RegisterRegAlloc > > RegAlloc("regalloc", cl::Hidden, cl::init(&useDefaultRegisterAllocator), cl::desc("Register allocator to use"))
static FunctionPass * useDefaultRegisterAllocator()
-regalloc=... command line option.
static cl::opt< RunOutliner > EnableMachineOutliner("enable-machine-outliner", cl::desc("Enable the machine outliner"), cl::Hidden, cl::ValueOptional, cl::init(RunOutliner::TargetDefault), cl::values(clEnumValN(RunOutliner::AlwaysOutline, "always", "Run on all functions guaranteed to be beneficial"), clEnumValN(RunOutliner::OptimisticPGO, "optimistic-pgo", "Outline cold code only. If a code block does not have " "profile data, optimistically assume it is cold."), clEnumValN(RunOutliner::ConservativePGO, "conservative-pgo", "Outline cold code only. If a code block does not have " "profile, data, conservatively assume it is hot."), clEnumValN(RunOutliner::NeverOutline, "never", "Disable all outlining"), clEnumValN(RunOutliner::AlwaysOutline, "", "")))
static std::string getFSRemappingFile(const TargetMachine *TM)
static const char StopBeforeOptName[]
static AnalysisID getPassIDFromName(StringRef PassName)
static IdentifyingPassPtr overridePass(AnalysisID StandardID, IdentifyingPassPtr TargetID)
Allow standard passes to be disabled by the command line, regardless of who is adding the pass.
static std::pair< StringRef, unsigned > getPassNameAndInstanceNum(StringRef PassName)
static void initializeDefaultRegisterAllocatorOnce()
static const char StartBeforeOptName[]
static const PassInfo * getPassInfo(StringRef PassName)
static const char StartAfterOptName[]
Option names for limiting the codegen pipeline.
static std::string getFSProfileFile(const TargetMachine *TM)
static IdentifyingPassPtr applyDisable(IdentifyingPassPtr PassID, bool Override)
Allow standard passes to be disabled by command line options.
#define DISABLE_PASS(Option, Name)
static RegisterRegAlloc defaultRegAlloc("default", "pick register allocator based on -O option", useDefaultRegisterAllocator)
static cl::boolOrDefault toBoolOrDefault(BoolOrDefault B)
Target-Independent Code Generator Pass Configuration Options pass.
This is the interface for a metadata-based TBAA.
Defines the virtual file system interface vfs::FileSystem.
static const char PassName[]
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
DenseMapIterator< KeyT, ValueT, KeyInfoT, BucketT, true > const_iterator
This pass is required by interprocedural register allocation.
Tagged union holding either a T or a Error.
This is a fast-path instruction selection class that generates poor code and doesn't support illegal ...
FunctionPass class - This class is used to implement most global optimizations.
A type-erased reference to the IR unit a pass or analysis is running on, together with the kind of IR...
Discriminated union of Pass ID types.
Pass * getInstance() const
This class is intended to be used as a base class for asm properties and features specific to the tar...
ExceptionHandling getExceptionHandlingType() const
DenseMap< AnalysisID, IdentifyingPassPtr > TargetPasses
SmallVector< InsertedPass, 4 > InsertedPasses
Store the pairs of <AnalysisID, AnalysisID> of which the second pass is inserted after each instance ...
PassInfo class - An instance of this class exists for every pass known by the system,...
const void * getTypeInfo() const
getTypeInfo - Return the id object for the pass... TODO : Rename
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
static LLVM_ABI PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
LLVM_ABI const PassInfo * getPassInfo(const void *TI) const
getPassInfo - Look up a pass' corresponding PassInfo, indexed by the pass' type identifier (&MyPass::...
Pass interface - Implemented by all 'passes'.
static Pass * createPass(AnalysisID ID)
AnalysisID getPassID() const
getPassID - Return the PassID number that corresponds to this pass.
RegisterPassParser class - Handle the addition of new machine passes.
static FunctionPassCtor getDefault()
static void setDefault(FunctionPassCtor C)
FunctionPass *(*)() FunctionPassCtor
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
bool getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
constexpr bool empty() const
Check if the string is empty.
Primary interface to the complete machine description for the target machine.
const std::optional< PGOOptions > & getPGOOption() const
Target-Independent Code Generator Pass Configuration Options.
bool usingDefaultRegAlloc() const
Return true if the default global register allocator is in use and has not be overriden on the comman...
bool requiresCodeGenSCCOrder() const
void addCheckDebugPass()
Add a pass to check synthesized debug info for MIR.
virtual void addPreLegalizeMachineIR()
This method may be implemented by targets that want to run passes immediately before legalization.
void addPrintPass(const std::string &Banner)
Add a pass to print the machine function if printing is enabled.
virtual void addPreEmitPass2()
Targets may add passes immediately before machine code is emitted in this callback.
virtual std::unique_ptr< CSEConfigBase > getCSEConfig() const
Returns the CSEConfig object to use for the current optimization level.
bool EnableLoopTermFold
Enable LoopTermFold immediately after LSR.
void printAndVerify(const std::string &Banner)
printAndVerify - Add a pass to dump then verify the machine function, if those steps are enabled.
static bool hasLimitedCodeGenPipeline()
Returns true if one of the -start-after, -start-before, -stop-after or -stop-before options is set.
static Expected< StartStopInfo > getStartStopInfo(PassInstrumentationCallbacks &PIC)
Returns pass name in -stop-before or -stop-after NOTE: New pass manager migration only.
bool EnableSSAMachineScheduler
Enable insertion of SSAMachineScheduler pass, this triggers early computation of live intervals.
~TargetPassConfig() override
virtual void addCodeGenPrepare()
Add pass to prepare the LLVM IR for code generation.
void insertPass(AnalysisID TargetPassID, IdentifyingPassPtr InsertedPassID)
Insert InsertedPassID pass after TargetPassID pass.
void addMachinePostPasses(const std::string &Banner)
Add standard passes after a pass that has just been added.
virtual void addPreSched2()
This method may be implemented by targets that want to run passes after prolog-epilog insertion and b...
virtual bool addILPOpts()
Add passes that optimize instruction level parallelism for out-of-order targets.
virtual void addPostRegAlloc()
This method may be implemented by targets that want to run passes after register allocation pass pipe...
void addDebugifyPass()
Add a pass to add synthesized debug info to the MIR.
virtual bool addInstSelector()
addInstSelector - This method should install an instruction selector pass, which converts from LLVM c...
CodeGenOptLevel getOptLevel() const
virtual bool addPreISel()
Methods with trivial inline returns are convenient points in the common codegen pass pipeline where t...
void setOpt(bool &Opt, bool Val)
virtual void addBlockPlacement()
Add standard basic block placement passes.
virtual FunctionPass * createRegAllocPass(bool Optimized)
addMachinePasses helper to create the target-selected or overriden regalloc pass.
virtual void addPostBBSections()
This pass may be implemented by targets that want to run passes immediately after basic block section...
virtual void addOptimizedRegAlloc()
addOptimizedRegAlloc - Add passes related to register allocation.
virtual bool addRegAssignAndRewriteFast()
Add core register allocator passes which do the actual register assignment and rewriting.
virtual void addPreEmitPass()
This pass may be implemented by targets that want to run passes immediately before machine code is em...
bool isGlobalISelAbortEnabled() const
Check whether or not GlobalISel should abort on error.
bool getOptimizeRegAlloc() const
Return true if the optimized regalloc pipeline is enabled.
bool isCustomizedRegAlloc()
Return true if register allocator is specified by -regalloc=override.
virtual void addPreRegBankSelect()
This method may be implemented by targets that want to run passes immediately before the register ban...
virtual bool reportDiagnosticWhenGlobalISelFallback() const
Check whether or not a diagnostic should be emitted when GlobalISel uses the fallback path.
virtual bool addPreRewrite()
addPreRewrite - Add passes to the optimized register allocation pipeline after register allocation is...
virtual bool addRegBankSelect()
This method should install a register bank selector pass, which assigns register banks to virtual reg...
void setRequiresCodeGenSCCOrder(bool Enable=true)
virtual void addMachineLateOptimization()
Add passes that optimize machine instructions after register allocation.
virtual void addMachinePasses()
Add the complete, standard set of LLVM CodeGen passes.
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
virtual void addPreGlobalInstructionSelect()
This method may be implemented by targets that want to run passes immediately before the (global) ins...
virtual void addFastRegAlloc()
addFastRegAlloc - Add the minimum set of target-independent passes that are required for fast registe...
virtual bool addLegalizeMachineIR()
This method should install a legalize pass, which converts the instruction sequence into one that can...
virtual void addMachineSSAOptimization()
addMachineSSAOptimization - Add standard passes that optimize machine instructions in SSA form.
void substitutePass(AnalysisID StandardID, IdentifyingPassPtr TargetID)
Allow the target to override a specific pass without overriding the pass pipeline.
virtual bool addRegAssignAndRewriteOptimized()
virtual bool addGlobalInstructionSelect()
This method should install a (global) instruction selector pass, which converts possibly generic inst...
virtual void addPreRegAlloc()
This method may be implemented by targets that want to run passes immediately before register allocat...
static std::string getLimitedCodeGenPipelineReason()
If hasLimitedCodeGenPipeline is true, this method returns a string with the name of the options that ...
AnalysisID addPass(AnalysisID PassID)
Utilities for targets to add passes to the pass manager.
void addPassesToHandleExceptions()
Add passes to lower exception handling for the code generator.
void addStripDebugPass()
Add a pass to remove debug info from the MIR.
bool isPassSubstitutedOrOverridden(AnalysisID ID) const
Return true if the pass has been substituted by the target or overridden on the command line.
bool addCoreISelPasses()
Add the actual instruction selection passes.
virtual void addISelPrepare()
Add common passes that perform LLVM IR to IR transforms in preparation for instruction selection.
static bool willCompleteCodeGenPipeline()
Returns true if none of the -stop-before and -stop-after options is set.
void addMachinePrePasses(bool AllowDebugify=true)
Add standard passes before a pass that's about to be added.
virtual bool addGCPasses()
addGCPasses - Add late codegen passes that analyze code for garbage collection.
virtual bool addIRTranslator()
This method should install an IR translator pass, which converts from LLVM code to machine instructio...
void addVerifyPass(const std::string &Banner)
Add a pass to perform basic verification of the machine function if verification is enabled.
virtual FunctionPass * createTargetRegisterAllocator(bool Optimized)
createTargetRegisterAllocator - Create the register allocator pass for this target at the current opt...
virtual bool addPostFastRegAllocRewrite()
addPostFastRegAllocRewrite - Add passes to the optimized register allocation pipeline after fast regi...
IdentifyingPassPtr getPassSubstitution(AnalysisID StandardID) const
Return the pass substituted for StandardID by the target.
bool addISelPasses()
High level function that adds all passes necessary to go from llvm IR representation to the MI repres...
virtual void addPostRewrite()
Add passes to be run immediately after virtual registers are rewritten to physical registers.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static LLVM_ABI raw_ostream & warning()
Convenience method for printing "warning: " to stderr.
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
#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.
LLVM_ABI ModulePass * createLowerGlobalDtorsLegacyPass()
LLVM_ABI FunctionPass * createFastRegisterAllocator()
FastRegisterAllocation Pass - This pass register allocates as fast as possible.
LLVM_ABI char & EarlyMachineLICMID
This pass performs loop invariant code motion on machine instructions.
LLVM_ABI FunctionPass * createWinEHPass()
createWinEHPass - Prepares personality functions used by MSVC on Windows, in addition to the Itanium ...
LLVM_ABI char & GCMachineCodeAnalysisID
GCMachineCodeAnalysis - Target-independent pass to mark safe points in machine code.
LLVM_ABI bool shouldEmitBBHash()
Returns whether -emit-bb-hash is set.
LLVM_ABI char & FEntryInserterID
This pass inserts FEntry calls.
LLVM_ABI char & GCLoweringID
GCLowering Pass - Used by gc.root to perform its default lowering operations.
LLVM_ABI void initializeBasicAAWrapperPassPass(PassRegistry &)
LLVM_ABI void registerCodeGenCallback(PassInstrumentationCallbacks &PIC, TargetMachine &)
LLVM_ABI char & InitUndefID
LLVM_ABI char & RegisterCoalescerID
RegisterCoalescer - This pass merges live ranges to eliminate copies.
LLVM_ABI FunctionPass * createGreedyRegisterAllocator()
Greedy register allocation pass - This pass implements a global register allocator for optimized buil...
LLVM_ABI FunctionPass * createConstantHoistingPass()
LLVM_ABI FunctionPass * createSafeStackPass()
This pass splits the stack into a safe stack and an unsafe stack to protect against stack-based overf...
LLVM_ABI ModulePass * createStaticDataAnnotatorLegacyPass()
createStaticDataAnnotatorPASS - This is a module pass that reads from StaticDataProfileInfoWrapperPas...
LLVM_ABI cl::opt< bool > EnableFSDiscriminator
LLVM_ABI FunctionPass * createSelectOptimizePass()
This pass converts conditional moves to conditional jumps when profitable.
LLVM_ABI char & FixupStatepointCallerSavedID
The pass fixups statepoint machine instruction to replace usage of caller saved registers with stack ...
LLVM_ABI MachineFunctionPass * createBasicBlockSectionsPass()
createBasicBlockSections Pass - This pass assigns sections to machine basic blocks and is enabled wit...
LLVM_ABI FunctionPass * createPostInlineEntryExitInstrumenterPass()
LLVM_ABI MachineFunctionPass * createPrologEpilogInserterPass()
LLVM_ABI char & TailDuplicateLegacyID
TailDuplicate - Duplicate blocks with unconditional branches into tails of their predecessors.
LLVM_ABI char & ExpandPostRAPseudosID
ExpandPostRAPseudos - This pass expands pseudo instructions after register allocation.
LLVM_ABI ModulePass * createStripDebugMachineModuleLegacyPass(bool OnlyDebugified)
Creates MIR Strip Debug pass.
LLVM_ABI char & PatchableFunctionID
This pass implements the "patchable-function" attribute.
LLVM_ABI MachineFunctionPass * createResetMachineFunctionLegacyPass(bool EmitFallbackDiag, bool AbortOnFailedISel)
This pass resets a MachineFunction when it has the FailedISel property as if it was just created.
LLVM_ABI FunctionPass * createScalarizeMaskedMemIntrinLegacyPass()
LLVM_ABI char & PostRASchedulerID
PostRAScheduler - This pass performs post register allocation scheduling.
LLVM_ABI char & RemoveLoadsIntoFakeUsesID
RemoveLoadsIntoFakeUses pass.
LLVM_ABI MachineFunctionPass * createStackFrameLayoutAnalysisPass()
StackFramePrinter pass - This pass prints out the machine function's stack frame to the given stream ...
LLVM_ABI ModulePass * createGlobalMergeFuncPass()
This pass performs merging similar functions globally.
LLVM_ABI char & MachineSanitizerBinaryMetadataID
LLVM_ABI FunctionPass * createStackProtectorPass()
createStackProtectorPass - This pass adds stack protectors to functions.
LLVM_ABI Pass * createLoopTermFoldPass()
LLVM_ABI char & MachineSchedulerID
MachineScheduler - This pass schedules machine instructions.
LLVM_ABI char & PostMachineSchedulerID
PostMachineScheduler - This pass schedules machine instructions postRA.
LLVM_ABI char & PeepholeOptimizerLegacyID
PeepholeOptimizer - This pass performs peephole optimizations - like extension and comparison elimina...
LLVM_ABI char & LiveDebugValuesID
LiveDebugValues pass.
LLVM_ABI char & PrologEpilogCodeInserterID
PrologEpilogCodeInserter - This pass inserts prolog and epilog code, and eliminates abstract frame re...
LLVM_ABI FunctionPass * createExpandIRInstsPass(CodeGenOptLevel)
LLVM_ABI char & EarlyIfConverterLegacyID
EarlyIfConverter - This pass performs if-conversion on SSA form by inserting cmov instructions.
LLVM_ABI MachineFunctionPass * createMachineFunctionSplitterPass()
createMachineFunctionSplitterPass - This pass splits machine functions using profile information.
LLVM_ABI FunctionPass * createMachineVerifierPass(const std::string &Banner)
createMachineVerifierPass - This pass verifies cenerated machine code instructions for correctness.
LLVM_ABI ImmutablePass * createBasicBlockSectionsProfileReaderWrapperPass(const MemoryBuffer *Buf)
LLVM_ABI char & MachineLoopInfoID
MachineLoopInfo - This pass is a loop analysis pass.
LLVM_ABI char & ShadowStackGCLoweringID
ShadowStackGCLowering - Implements the custom lowering mechanism used by the shadow stack GC.
LLVM_ABI char & ImplicitNullChecksID
ImplicitNullChecks - This pass folds null pointer checks into nearby memory operations.
LLVM_ABI FunctionPass * createMIRAddFSDiscriminatorsPass(sampleprof::FSDiscriminatorPass P)
Add Flow Sensitive Discriminators.
LLVM_ABI ModulePass * createPreISelIntrinsicLoweringPass()
This pass lowers the @llvm.load.relative and @llvm.objc.
LLVM_ABI char & ShrinkWrapID
ShrinkWrap pass. Look for the best place to insert save and restore.
LLVM_ABI char & MachineLateInstrsCleanupID
MachineLateInstrsCleanup - This pass removes redundant identical instructions after register allocati...
LLVM_ABI char & UnreachableMachineBlockElimID
UnreachableMachineBlockElimination - This pass removes unreachable machine basic blocks.
LLVM_ABI FunctionPass * createLowerInvokePass()
LLVM_ABI FunctionPass * createRegUsageInfoCollector()
This pass is executed POST-RA to collect which physical registers are preserved by given machine func...
LLVM_ABI ImmutablePass * createScopedNoAliasAAWrapperPass()
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
LLVM_ABI char & XRayInstrumentationID
This pass inserts the XRay instrumentation sleds if they are supported by the target platform.
LLVM_ABI char & OptimizePHIsLegacyID
OptimizePHIs - This pass optimizes machine instruction PHIs to take advantage of opportunities create...
LLVM_ABI char & StackMapLivenessID
StackMapLiveness - This pass analyses the register live-out set of stackmap/patchpoint intrinsics and...
LLVM_ABI char & FuncletLayoutID
This pass lays out funclets contiguously.
LLVM_ABI FunctionPass * createCodeGenPrepareLegacyPass()
createCodeGenPrepareLegacyPass - Transform the code to expose more pattern matching during instructio...
LLVM_ABI MachineFunctionPass * createMachineFunctionPrinterPass(raw_ostream &OS, const std::string &Banner="")
MachineFunctionPrinter pass - This pass prints out the machine function to the given stream as a debu...
LLVM_ABI char & RemoveRedundantDebugValuesID
RemoveRedundantDebugValues pass.
LLVM_ABI FunctionPass * createBasicAAWrapperPass()
LLVM_ABI char & DetectDeadLanesID
This pass adds dead/undef flags after analyzing subregister lanes.
LLVM_ABI char & PostRAMachineSinkingID
This pass perform post-ra machine sink for COPY instructions.
LLVM_ABI FunctionPass * createDwarfEHPass(CodeGenOptLevel OptLevel)
createDwarfEHPass - This pass mulches exception handling code into a form adapted to code generation.
LLVM_ABI FunctionPass * createRegAllocScoringPass()
When learning an eviction policy, extract score(reward) information, otherwise this does nothing.
CodeGenOptLevel
Code generation optimization level.
LLVM_ABI char & StackSlotColoringID
StackSlotColoring - This pass performs stack slot coloring.
LLVM_ABI ModulePass * createMachineOutlinerPass(RunOutliner RunOutlinerMode)
This pass performs outlining on machine instructions directly before printing assembly.
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
LLVM_ABI ModulePass * createLowerEmuTLSPass()
LowerEmuTLS - This pass generates __emutls_[vt].xyz variables for all TLS variables for the emulated ...
LLVM_ABI char & ProcessImplicitDefsID
ProcessImpicitDefs pass - This pass removes IMPLICIT_DEFs.
LLVM_ABI ImmutablePass * createTargetTransformInfoWrapperPass(TargetIRAnalysis TIRA)
Create an analysis pass wrapper around a TTI object.
LLVM_ABI MachineFunctionPass * createInsertCodePrefetchPass()
createInsertCodePrefetchPass - This pass enables inserting code prefetch hints based on the basic blo...
LLVM_ABI FunctionPass * createMIRProfileLoaderPass(std::string File, std::string RemappingFile, sampleprof::FSDiscriminatorPass P, IntrusiveRefCntPtr< vfs::FileSystem > FS)
Read Flow Sensitive Profile.
LLVM_ABI FunctionPass * createVerifierPass(bool FatalErrors=true)
LLVM_ABI char & SSAMachineSchedulerID
SSAMachineScheduler - This pass schedules machine instructions in SSA.
LLVM_ABI char & MachineCSELegacyID
MachineCSE - This pass performs global CSE on machine instructions.
LLVM_ABI ImmutablePass * createTypeBasedAAWrapperPass()
LLVM_ABI Pass * createLoopStrengthReducePass()
LLVM_ABI MachineFunctionPass * createMachineBlockHashInfoPass()
createMachineBlockHashInfoPass - This pass computes basic block hashes.
LLVM_ABI char & LiveVariablesID
LiveVariables pass - This pass sets dead flags on register definitions.
LLVM_ABI char & EarlyTailDuplicateLegacyID
Duplicate blocks with unconditional branches into tails of their predecessors.
LLVM_ABI void initializeAAResultsWrapperPassPass(PassRegistry &)
LLVM_ABI FunctionPass * createExpandReductionsPass()
This pass expands the reduction intrinsics into sequences of shuffles.
LLVM_ABI MachineFunctionPass * createStaticDataSplitterLegacyPass()
createStaticDataSplitterPass - This is a machine-function pass that categorizes static data hotness u...
void call_once(once_flag &flag, Function &&F, Args &&... ArgList)
Execute the function specified as a parameter once.
LLVM_ABI FunctionPass * createSjLjEHPreparePass(const TargetMachine *TM)
createSjLjEHPreparePass - This pass adapts exception handling code to use the GCC-style builtin setjm...
LLVM_ABI MachineFunctionPass * createBasicBlockPathCloningPass()
@ SjLj
setjmp/longjmp based exceptions
@ ZOS
z/OS MVS Exception Handling.
@ Emscripten
Emscripten JavaScript-based exception handling.
@ None
No exception support.
@ Default
Not specified; resolve to the target's default model.
@ AIX
AIX Exception Handling.
@ DwarfCFI
DWARF-like instruction based exceptions.
@ WinEH
Windows Exception Handling.
@ Wasm
WebAssembly Exception Handling.
LLVM_ABI char & StackColoringLegacyID
StackSlotColoring - This pass performs stack coloring and merging.
LLVM_ABI char & VirtRegRewriterID
VirtRegRewriter pass.
LLVM_ABI FunctionPass * createReplaceWithVeclibLegacyPass()
LLVM_ABI FunctionPass * createInlineAsmPreparePass()
LLVM_ABI char & FinalizeISelID
This pass expands pseudo-instructions, reserves registers and adjusts machine frame information.
constexpr bool valueOr(BoolOrDefault X, bool Default)
LLVM_ABI char & MachineSinkingLegacyID
MachineSinking - This pass performs sinking on machine instructions.
LLVM_ABI FunctionPass * createRegUsageInfoPropPass()
Return a MachineFunction pass that identifies call sites and propagates register usage information of...
LLVM_ABI FunctionPass * createPartiallyInlineLibCallsPass()
LLVM_ABI void initializeLibcallLoweringInfoWrapperPass(PassRegistry &)
LLVM_ABI char & MachineBlockPlacementID
MachineBlockPlacement - This pass places basic blocks based on branch probabilities.
LLVM_ABI char & TwoAddressInstructionPassID
TwoAddressInstruction - This pass reduces two-address instructions to use two operands.
LLVM_ABI MachineFunctionPass * createBasicBlockMatchingAndInferencePass()
createBasicBlockMatchingAndInferencePass - This pass enables matching and inference when using propel...
LLVM_ABI ModulePass * createCheckDebugMachineModuleLegacyPass()
Creates MIR Check Debug pass.
LLVM_ABI Pass * createCanonicalizeFreezeInLoopsPass()
LLVM_ABI char & LocalStackSlotAllocationID
LocalStackSlotAllocation - This pass assigns local frame indices to stack slots relative to one anoth...
LLVM_ABI char & BranchFolderPassID
BranchFolding - This pass performs machine code CFG based optimizations to delete branches to branche...
LLVM_ABI char & PHIEliminationID
PHIElimination - This pass eliminates machine instruction PHI nodes by inserting copy instructions.
LLVM_ABI Pass * createObjCARCContractPass()
LLVM_ABI ModulePass * createDebugifyMachineModulePass()
Creates MIR Debugify pass.
LLVM_ABI FunctionPass * createPrintFunctionPass(raw_ostream &OS, const std::string &Banner="")
Create and return a pass that prints functions to the specified raw_ostream as they are processed.
LLVM_ABI ModulePass * createWindowsSecureHotPatchingPass()
Creates Windows Secure Hot Patch pass.
LLVM_ABI FunctionPass * createCFIFixupLegacy()
Creates CFI Fixup pass.
LLVM_ABI char & RenameIndependentSubregsID
This pass detects subregister lanes in a virtual register that are used independently of other lanes ...
LLVM_ABI char & MachineLICMID
This pass performs loop invariant code motion on machine instructions.
LLVM_ABI char & MachineBlockPlacementStatsID
MachineBlockPlacementStats - This pass collects statistics about the basic block placement using bran...
LLVM_ABI MachineFunctionPass * createGCEmptyBasicBlocksLegacyPass()
createGCEmptyBasicblocksPass - Empty basic blocks (basic blocks without real code) appear as the resu...
LLVM_ABI char & LiveIntervalsID
LiveIntervals - This analysis keeps track of the live ranges of virtual and physical registers.
LLVM_ABI char & MachineCopyPropagationID
MachineCopyPropagation - This pass performs copy propagation on machine instructions.
LLVM_ABI char & DeadMachineInstructionElimID
DeadMachineInstructionElim - This pass removes dead machine instructions.
LLVM_ABI void initializeCodeGen(PassRegistry &)
Initialize all passes linked into the CodeGen library.
LLVM_ABI FunctionPass * createUnreachableBlockEliminationPass()
createUnreachableBlockEliminationPass - The LLVM code generator does not work well with unreachable b...
LLVM_ABI CGPassBuilderOption getCGPassBuilderOption()
LLVM_ABI void reportFatalUsageError(Error Err)
Report a fatal error that does not indicate a bug in LLVM.
IdentifyingPassPtr InsertedPassID
Pass * getInsertedPass() const
InsertedPass(AnalysisID TargetPassID, IdentifyingPassPtr InsertedPassID)
cl::boolOrDefault VerifyMachineCode
bool DisablePartialLibcallInlining
std::optional< bool > EnableIPRA
cl::boolOrDefault EnableGlobalISelOption
bool DisableConstantHoisting
cl::boolOrDefault EnableFastISelOption
RunOutliner EnableMachineOutliner
bool EnableGlobalMergeFunc
cl::boolOrDefault EnableRegAllocFastTied
std::string FSProfileFile
bool DisableAtExitBasedGlobalDtorLowering
cl::boolOrDefault DebugifyCheckAndStripAll
std::optional< GlobalISelAbortMode > EnableGlobalISelAbort
cl::boolOrDefault DebugifyAndStripAll
bool DisableExpandReductions
bool EnableImplicitNullChecks
bool EnableBlockPlacementStats
bool DisableRAFSProfileLoader
bool DisableSelectOptimize
A utility class that uses RAII to save and restore the value of a variable.
The llvm::once_flag structure.