68class TriggerCrashFunctionLegacyPass :
public FunctionPass {
71 TriggerCrashFunctionLegacyPass() : FunctionPass(ID) {}
76 StringRef getPassName()
const override {
return "TriggerCrashFunctionPass"; }
80char TriggerCrashFunctionLegacyPass::ID = 0;
84 "enable-machine-outliner",
cl::desc(
"Enable the machine outliner"),
88 "Run on all functions guaranteed to be beneficial"),
90 "Outline cold code only. If a code block does not have "
91 "profile data, optimistically assume it is cold."),
93 "Outline cold code only. If a code block does not have "
94 "profile, data, conservatively assume it is hot."),
137 return applyDisable(TargetID, Opts.disable_branch_fold);
140 return applyDisable(TargetID, Opts.disable_tail_duplicate);
143 return applyDisable(TargetID, Opts.disable_early_taildup);
146 return applyDisable(TargetID, Opts.disable_block_placement);
152 return applyDisable(TargetID, Opts.disable_machine_dce);
155 return applyDisable(TargetID, Opts.disable_early_ifcvt);
158 return applyDisable(TargetID, Opts.disable_machine_licm);
161 return applyDisable(TargetID, Opts.disable_machine_cse);
164 return applyDisable(TargetID, Opts.disable_postra_machine_licm);
167 return applyDisable(TargetID, Opts.disable_machine_sink);
170 return applyDisable(TargetID, Opts.disable_postra_machine_sink);
182 if (!Opts.fs_profile_file.empty())
183 return Opts.fs_profile_file.str();
184 const std::optional<PGOOptions> &PGOOpt = TM->
getPGOOption();
186 return std::string();
187 return PGOOpt->ProfileFile;
194 if (!Opts.fs_remapping_file.empty())
195 return Opts.fs_remapping_file.str();
196 const std::optional<PGOOptions> &PGOOpt = TM->
getPGOOption();
198 return std::string();
199 return PGOOpt->ProfileRemappingFile;
207 "Target Pass Configuration",
false,
false)
224 assert(NP &&
"Pass ID not registered");
264 Twine(
"\" pass is not registered."));
273static std::pair<StringRef, unsigned>
276 std::tie(Name, InstanceNumStr) =
PassName.split(
',');
278 unsigned InstanceNum = 0;
282 return std::make_pair(Name, InstanceNum);
285void TargetPassConfig::setStartStopPasses() {
286 StringRef StartBeforeName;
287 std::tie(StartBeforeName, StartBeforeInstanceNum) =
290 StringRef StartAfterName;
291 std::tie(StartAfterName, StartAfterInstanceNum) =
294 StringRef StopBeforeName;
295 std::tie(StopBeforeName, StopBeforeInstanceNum) =
298 StringRef StopAfterName;
299 std::tie(StopAfterName, StopAfterInstanceNum) =
306 if (StartBefore && StartAfter)
309 if (StopBefore && StopAfter)
312 Started = (StartAfter ==
nullptr) && (StartBefore ==
nullptr);
331 const CodeGenOptions &Opts =
getOpts(TM);
340 Opts,
valueOr(Opts.verify_machineinstrs,
false));
342 Opts.disable_atexit_based_global_dtor_lowering;
369 const CodeGenOptions &Opts =
getOpts(TM);
374#define DISABLE_PASS(Option, Name) \
375 if (Option && P.contains(#Name)) \
380 DISABLE_PASS(Opts.disable_early_ifcvt, EarlyIfConverterLegacyPass)
382 DISABLE_PASS(Opts.disable_machine_cse, MachineCSELegacyPass)
399 const CodeGenOptions &Opts =
getOpts(
TM);
400 auto [StartBefore, StartBeforeInstanceNum] =
402 auto [StartAfter, StartAfterInstanceNum] =
404 auto [StopBefore, StopBeforeInstanceNum] =
406 auto [StopAfter, StopAfterInstanceNum] =
409 if (!StartBefore.empty() && !StartAfter.empty())
412 std::make_error_code(std::errc::invalid_argument));
413 if (!StopBefore.empty() && !StopAfter.empty())
416 std::make_error_code(std::errc::invalid_argument));
419 Result.StartPass = StartBefore.empty() ? StartAfter : StartBefore;
420 Result.StopPass = StopBefore.empty() ? StopAfter : StopBefore;
421 Result.StartInstanceNum =
422 StartBefore.empty() ? StartAfterInstanceNum : StartBeforeInstanceNum;
423 Result.StopInstanceNum =
424 StopBefore.empty() ? StopAfterInstanceNum : StopBeforeInstanceNum;
425 Result.StartAfter = !StartAfter.empty();
426 Result.StopAfter = !StopAfter.empty();
427 Result.StartInstanceNum += Result.StartInstanceNum == 0;
428 Result.StopInstanceNum += Result.StopInstanceNum == 0;
453 TM.Options.EnableIPRA |=
TM.useIPRA();
456 if (
TM.Options.EnableIPRA)
460 TM.setEnableTiedFastRegAlloc(Opts.regalloc_fast_tied ==
463 if (Opts.global_isel_abort)
464 TM.Options.GlobalISelAbort = *Opts.global_isel_abort;
467#ifdef EXPENSIVE_CHECKS
473 if (Opts.function_splitting)
474 TM.Options.FunctionSplitting = *Opts.function_splitting;
476 setStartStopPasses();
480 return TM->getOptLevel();
487 TargetPassID != InsertedPassID.
getID()) ||
490 "Insert a pass after itself!");
491 Impl->InsertedPasses.emplace_back(TargetPassID, InsertedPassID);
505 "machine. Scheduling a CodeGen pass without a target "
510 return Opts.stop_before.empty() && Opts.stop_after.empty();
514 return !Opts.start_before.empty() || !Opts.start_after.empty() ||
522 StringRef PassNames[] = {StartAfter, StartBefore, StopAfter, StopBefore};
526 for (
int Idx = 0; Idx < 4; ++Idx)
527 if (!PassNames[Idx].empty()) {
531 Res += OptNames[Idx];
555 Impl->TargetPasses[StandardID] = TargetID;
560 I =
Impl->TargetPasses.find(
ID);
561 if (
I ==
Impl->TargetPasses.end())
587 if (StartBefore == PassID && StartBeforeCount++ == StartBeforeInstanceNum)
589 if (StopBefore == PassID && StopBeforeCount++ == StopBeforeInstanceNum)
591 if (Started && !Stopped) {
592 if (AddingMachinePasses) {
595 std::string(
"After ") + std::string(
P->getPassName());
604 for (
const auto &IP :
Impl->InsertedPasses)
605 if (IP.TargetPassID == PassID)
611 if (StopAfter == PassID && StopAfterCount++ == StopAfterInstanceNum)
614 if (StartAfter == PassID && StartAfterCount++ == StartAfterInstanceNum)
616 if (Stopped && !Started)
651 if (Opts.print_after_isel)
673 if (AllowDebugify && DebugifyIsSafe &&
674 (
valueOr(Opts.debugify_and_strip_all_safe,
false) ||
675 valueOr(Opts.debugify_check_and_strip_all_safe,
false)))
680 if (DebugifyIsSafe) {
681 if (
valueOr(Opts.debugify_check_and_strip_all_safe,
false)) {
684 }
else if (
valueOr(Opts.debugify_and_strip_all_safe,
false))
708 if (!Opts.disable_lsr) {
723 if (
TM->getTargetTriple().isOSBinFormatMachO() &&
724 !Opts.disable_atexit_based_global_dtor_lowering)
735 !Opts.disable_replace_with_vec_lib)
739 !Opts.disable_partial_libcall_inlining)
752 if (!Opts.disable_expand_reductions)
759 if (Opts.enable_global_merge_func)
762 if (
TM->getTargetTriple().isOSWindows())
772 bool HasEHPrep =
false;
840 if (Opts.print_isel_input)
842 dbgs(),
"\n\n*** Final LLVM Code input to ISel ***\n"));
852 TM->setO0WantsFastISel(
valueOr(Opts.fast_isel,
true));
856 SelectorType Selector;
858 if (
valueOr(Opts.fast_isel,
false))
859 Selector = SelectorType::FastISel;
860 else if (
valueOr(Opts.global_isel,
false) ||
861 (
TM->Options.EnableGlobalISel &&
valueOr(Opts.global_isel,
true)))
862 Selector = SelectorType::GlobalISel;
864 TM->getO0WantsFastISel())
865 Selector = SelectorType::FastISel;
867 Selector = SelectorType::SelectionDAG;
870 if (Selector == SelectorType::FastISel) {
871 TM->setFastISel(
true);
872 TM->setGlobalISel(
false);
873 }
else if (Selector == SelectorType::GlobalISel) {
874 TM->setFastISel(
false);
875 TM->setGlobalISel(
true);
889 DebugifyIsSafe =
false;
892 if (Selector == SelectorType::GlobalISel) {
893 SaveAndRestore SavedAddingMachinePasses(AddingMachinePasses,
true);
917 if (Selector == SelectorType::GlobalISel)
938 if (
TM->useEmulatedTLS())
950 if (Opts.codegen_pipeline_trigger_crash)
951 addPass(
new TriggerCrashFunctionLegacyPass());
963 RegisterPassParser<RegisterRegAlloc>>
965 cl::desc(
"Register allocator to use"));
986 AddingMachinePasses =
true;
997 if (
TM->Options.EnableIPRA)
1006 DebugifyIsSafe =
false;
1014 if (!ProfileFile.empty() && !Opts.disable_ra_fsprofile_loader)
1055 if (Opts.enable_implicit_null_checks)
1062 !
TM->targetSchedulesPostRAScheduling()) {
1063 if (Opts.misched_postra)
1084 if (
TM->Options.EnableIPRA)
1098 if (
TM->Options.EnableMachineOutliner &&
1102 TM->supportsDefaultOutlining())
1106 if (Opts.enable_gc_empty_basic_blocks)
1113 const bool SplitFunctionsWithPGO =
1116 if (SplitFunctionsWithPGO || Opts.split_static_data ||
1117 TM->Options.EnableStaticDataPartitioning) {
1119 if (!ProfileFile.empty()) {
1128 <<
"Using AutoFDO without FSDiscriminator for MFS may regress "
1134 if (Opts.split_static_data ||
TM->Options.EnableStaticDataPartitioning) {
1147 TM->Options.BBAddrMap || SplitFunctionsWithPGO) {
1152 TM->getBBSectionsFuncListBuf()));
1155 if (Opts.basic_block_section_match_infer)
1165 if (!Opts.disable_cfi_fixup &&
TM->Options.EnableCFIFixup)
1173 AddingMachinePasses =
false;
1225 "pick register allocator based on -O option",
1289 "Must use fast (default) register allocator for unoptimized regalloc.");
1315 return RegAlloc.getNumOccurrences() == 0;
1322 if (!
TM->enableTiedFastRegAlloc())
1404 if (!
TM->requiresStructuredCFG())
1423 if (!ProfileFile.empty() && !Opts.disable_layout_fsprofile_loader)
1430 if (Opts.enable_block_placement_stats)
1447 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.
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 const char StopBeforeOptName[]
static AnalysisID getPassIDFromName(StringRef PassName)
static std::string formatLimitReason(StringRef StartAfter, StringRef StartBefore, StringRef StopAfter, StringRef StopBefore)
static IdentifyingPassPtr overridePass(const CodeGenOptions &Opts, 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 MachineVerifierMode computeMachineVerifierMode(const CodeGenOptions &Opts, bool VerifyEach)
static const CodeGenOptions & getOpts(const TargetMachine &TM)
static void initializeDefaultRegisterAllocatorOnce()
static std::string getFSRemappingFile(const CodeGenOptions &Opts, const TargetMachine *TM)
static const char StartBeforeOptName[]
static const PassInfo * getPassInfo(StringRef PassName)
static const char StartAfterOptName[]
Option names for limiting the codegen pipeline.
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 std::string getFSProfileFile(const CodeGenOptions &Opts, const TargetMachine *TM)
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
const cl::LibraryOptionsContext * LibraryOptions
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.
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
MCTargetOptions MCOptions
Machine level options.
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.
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)
std::string getLimitedCodeGenPipelineReason() const
If hasLimitedCodeGenPipeline is true, this method returns a string with the name of the options that ...
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...
bool hasLimitedCodeGenPipeline() const
Returns true if one of the -start-after, -start-before, -stop-after or -stop-before options is set.
bool willCompleteCodeGenPipeline() const
Returns true if none of the -stop-before and -stop-after options is set.
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...
AnalysisID addPass(AnalysisID PassID)
Utilities for targets to add passes to the pass manager.
virtual void addPassesToHandleExceptions()
Add passes to lower exception handling for the code generator.
void addStripDebugPass()
Add a pass to remove debug info from the MIR.
static Expected< StartStopInfo > getStartStopInfo(const TargetMachine &TM, PassInstrumentationCallbacks &PIC)
Returns pass name in -stop-before or -stop-after NOTE: New pass manager migration only.
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.
TargetPassConfig(TargetMachine &TM, PassManagerBase &PM)
virtual void addISelPrepare()
Add common passes that perform LLVM IR to IR transforms in preparation for instruction selection.
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.
MachineVerifierMode VerifyMode
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...
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 Pass * callDefaultCtor< TargetPassConfig >()
TargetPassConfig needs a TargetMachine; the pass registry cannot create one.
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 MachineFunctionPass * createBasicBlockSectionsPass(bool SplitWithPGO=false)
createBasicBlockSections Pass - This pass assigns sections to machine basic blocks and is enabled wit...
LLVM_ABI FunctionPass * createSelectOptimizePass()
This pass converts conditional moves to conditional jumps when profitable.
LLVM_ABI FunctionPass * createWasmEHPass()
createWasmEHPass - This pass adapts exception handling code to use WebAssembly's exception handling s...
LLVM_ABI char & FixupStatepointCallerSavedID
The pass fixups statepoint machine instruction to replace usage of caller saved registers with stack ...
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 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 CGPassBuilderOption getCGPassBuilderOption(const TargetMachine &TM)
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 & 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
@ 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 cl::opt< bool > PropellerMatchBBID
Whether to match basic blocks using BBIDs instead of hashes for Propeller inference.
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...
MachineVerifierMode
Specify where the machine verifier runs in the codegen pipeline.
@ Each
Run the machine verifier before and after every machine pass.
@ None
Never run the machine verifier.
@ End
Run the machine verifier once, at the end of the pipeline.
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 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)
bool DisablePartialLibcallInlining
std::optional< bool > EnableIPRA
cl::boolOrDefault EnableGlobalISelOption
bool DisableConstantHoisting
cl::boolOrDefault EnableFastISelOption
RunOutliner EnableMachineOutliner
bool EnableGlobalMergeFunc
cl::boolOrDefault EnableRegAllocFastTied
MachineVerifierMode VerifyMachineCode
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.
LLVM_ABI std::string getLimitReason() const
Returns the names of the options that set the start and stop passes.
The llvm::once_flag structure.