LLVM 19.0.0git
PassBuilder.h
Go to the documentation of this file.
1//===- Parsing, selection, and construction of pass pipelines --*- C++ -*--===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8/// \file
9///
10/// Interfaces for registering analysis passes, producing common pass manager
11/// configurations, and parsing of pass pipelines.
12///
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_PASSES_PASSBUILDER_H
16#define LLVM_PASSES_PASSBUILDER_H
17
21#include "llvm/IR/PassManager.h"
23#include "llvm/Support/Error.h"
30#include <vector>
31
32namespace llvm {
33class StringRef;
34class AAManager;
35class TargetMachine;
36class ModuleSummaryIndex;
37template <typename T> class IntrusiveRefCntPtr;
38namespace vfs {
39class FileSystem;
40} // namespace vfs
41
42/// Tunable parameters for passes in the default pipelines.
44public:
45 /// Constructor sets pipeline tuning defaults based on cl::opts. Each option
46 /// can be set in the PassBuilder when using a LLVM as a library.
48
49 /// Tuning option to set loop interleaving on/off, set based on opt level.
51
52 /// Tuning option to enable/disable loop vectorization, set based on opt
53 /// level.
55
56 /// Tuning option to enable/disable slp loop vectorization, set based on opt
57 /// level.
59
60 /// Tuning option to enable/disable loop unrolling. Its default value is true.
62
63 /// Tuning option to forget all SCEV loops in LoopUnroll. Its default value
64 /// is that of the flag: `-forget-scev-loop-unroll`.
66
67 /// Tuning option to cap the number of calls to retrive clobbering accesses in
68 /// MemorySSA, in LICM.
70
71 /// Tuning option to disable promotion to scalars in LICM with MemorySSA, if
72 /// the number of access is too large.
74
75 /// Tuning option to enable/disable call graph profile. Its default value is
76 /// that of the flag: `-enable-npm-call-graph-profile`.
78
79 // Add LTO pipeline tuning option to enable the unified LTO pipeline.
81
82 /// Tuning option to enable/disable function merging. Its default value is
83 /// false.
85
86 /// Tuning option to override the default inliner threshold.
88
89 // Experimental option to eagerly invalidate more analyses. This has the
90 // potential to decrease max memory usage in exchange for more compile time.
91 // This may affect codegen due to either passes using analyses only when
92 // cached, or invalidating and recalculating an analysis that was
93 // stale/imprecise but still valid. Currently this invalidates all function
94 // analyses after various module->function or cgscc->function adaptors in the
95 // default pipelines.
97};
98
99/// This class provides access to building LLVM's passes.
100///
101/// Its members provide the baseline state available to passes during their
102/// construction. The \c PassRegistry.def file specifies how to construct all
103/// of the built-in passes, and those may reference these members during
104/// construction.
106 TargetMachine *TM;
108 std::optional<PGOOptions> PGOOpt;
110
111public:
112 /// A struct to capture parsed pass pipeline names.
113 ///
114 /// A pipeline is defined as a series of names, each of which may in itself
115 /// recursively contain a nested pipeline. A name is either the name of a pass
116 /// (e.g. "instcombine") or the name of a pipeline type (e.g. "cgscc"). If the
117 /// name is the name of a pass, the InnerPipeline is empty, since passes
118 /// cannot contain inner pipelines. See parsePassPipeline() for a more
119 /// detailed description of the textual pipeline format.
122 std::vector<PipelineElement> InnerPipeline;
123 };
124
125 explicit PassBuilder(TargetMachine *TM = nullptr,
127 std::optional<PGOOptions> PGOOpt = std::nullopt,
128 PassInstrumentationCallbacks *PIC = nullptr);
129
130 /// Cross register the analysis managers through their proxies.
131 ///
132 /// This is an interface that can be used to cross register each
133 /// AnalysisManager with all the others analysis managers.
138 MachineFunctionAnalysisManager *MFAM = nullptr);
139
140 /// Registers all available module analysis passes.
141 ///
142 /// This is an interface that can be used to populate a \c
143 /// ModuleAnalysisManager with all registered module analyses. Callers can
144 /// still manually register any additional analyses. Callers can also
145 /// pre-register analyses and this will not override those.
147
148 /// Registers all available CGSCC analysis passes.
149 ///
150 /// This is an interface that can be used to populate a \c CGSCCAnalysisManager
151 /// with all registered CGSCC analyses. Callers can still manually register any
152 /// additional analyses. Callers can also pre-register analyses and this will
153 /// not override those.
155
156 /// Registers all available function analysis passes.
157 ///
158 /// This is an interface that can be used to populate a \c
159 /// FunctionAnalysisManager with all registered function analyses. Callers can
160 /// still manually register any additional analyses. Callers can also
161 /// pre-register analyses and this will not override those.
163
164 /// Registers all available loop analysis passes.
165 ///
166 /// This is an interface that can be used to populate a \c LoopAnalysisManager
167 /// with all registered loop analyses. Callers can still manually register any
168 /// additional analyses.
170
171 /// Registers all available machine function analysis passes.
172 ///
173 /// This is an interface that can be used to populate a \c
174 /// MachineFunctionAnalysisManager with all registered function analyses.
175 /// Callers can still manually register any additional analyses. Callers can
176 /// also pre-register analyses and this will not override those.
178
179 /// Construct the core LLVM function canonicalization and simplification
180 /// pipeline.
181 ///
182 /// This is a long pipeline and uses most of the per-function optimization
183 /// passes in LLVM to canonicalize and simplify the IR. It is suitable to run
184 /// repeatedly over the IR and is not expected to destroy important
185 /// information about the semantics of the IR.
186 ///
187 /// Note that \p Level cannot be `O0` here. The pipelines produced are
188 /// only intended for use when attempting to optimize code. If frontends
189 /// require some transformations for semantic reasons, they should explicitly
190 /// build them.
191 ///
192 /// \p Phase indicates the current ThinLTO phase.
196
197 /// Construct the core LLVM module canonicalization and simplification
198 /// pipeline.
199 ///
200 /// This pipeline focuses on canonicalizing and simplifying the entire module
201 /// of IR. Much like the function simplification pipeline above, it is
202 /// suitable to run repeatedly over the IR and is not expected to destroy
203 /// important information. It does, however, perform inlining and other
204 /// heuristic based simplifications that are not strictly reversible.
205 ///
206 /// Note that \p Level cannot be `O0` here. The pipelines produced are
207 /// only intended for use when attempting to optimize code. If frontends
208 /// require some transformations for semantic reasons, they should explicitly
209 /// build them.
210 ///
211 /// \p Phase indicates the current ThinLTO phase.
214
215 /// Construct the module pipeline that performs inlining as well as
216 /// the inlining-driven cleanups.
219
220 /// Construct the module pipeline that performs inlining with
221 /// module inliner pass.
224
225 /// Construct the core LLVM module optimization pipeline.
226 ///
227 /// This pipeline focuses on optimizing the execution speed of the IR. It
228 /// uses cost modeling and thresholds to balance code growth against runtime
229 /// improvements. It includes vectorization and other information destroying
230 /// transformations. It also cannot generally be run repeatedly on a module
231 /// without potentially seriously regressing either runtime performance of
232 /// the code or serious code size growth.
233 ///
234 /// Note that \p Level cannot be `O0` here. The pipelines produced are
235 /// only intended for use when attempting to optimize code. If frontends
236 /// require some transformations for semantic reasons, they should explicitly
237 /// build them.
240 ThinOrFullLTOPhase LTOPhase);
241
242 /// Build a per-module default optimization pipeline.
243 ///
244 /// This provides a good default optimization pipeline for per-module
245 /// optimization and code generation without any link-time optimization. It
246 /// typically correspond to frontend "-O[123]" options for optimization
247 /// levels \c O1, \c O2 and \c O3 resp.
249 bool LTOPreLink = false);
250
251 /// Build a fat object default optimization pipeline.
252 ///
253 /// This builds a pipeline that runs the LTO/ThinLTO pre-link pipeline, and
254 /// emits a section containing the pre-link bitcode along side the object code
255 /// generated in non-LTO compilation.
257 bool ThinLTO, bool EmitSummary);
258
259 /// Build a pre-link, ThinLTO-targeting default optimization pipeline to
260 /// a pass manager.
261 ///
262 /// This adds the pre-link optimizations tuned to prepare a module for
263 /// a ThinLTO run. It works to minimize the IR which needs to be analyzed
264 /// without making irreversible decisions which could be made better during
265 /// the LTO run.
267
268 /// Build a ThinLTO default optimization pipeline to a pass manager.
269 ///
270 /// This provides a good default optimization pipeline for link-time
271 /// optimization and code generation. It is particularly tuned to fit well
272 /// when IR coming into the LTO phase was first run through \c
273 /// buildThinLTOPreLinkDefaultPipeline, and the two coordinate closely.
276 const ModuleSummaryIndex *ImportSummary);
277
278 /// Build a pre-link, LTO-targeting default optimization pipeline to a pass
279 /// manager.
280 ///
281 /// This adds the pre-link optimizations tuned to work well with a later LTO
282 /// run. It works to minimize the IR which needs to be analyzed without
283 /// making irreversible decisions which could be made better during the LTO
284 /// run.
286
287 /// Build an LTO default optimization pipeline to a pass manager.
288 ///
289 /// This provides a good default optimization pipeline for link-time
290 /// optimization and code generation. It is particularly tuned to fit well
291 /// when IR coming into the LTO phase was first run through \c
292 /// buildLTOPreLinkDefaultPipeline, and the two coordinate closely.
294 ModuleSummaryIndex *ExportSummary);
295
296 /// Build an O0 pipeline with the minimal semantically required passes.
297 ///
298 /// This should only be used for non-LTO and LTO pre-link pipelines.
300 bool LTOPreLink = false);
301
302 /// Build the default `AAManager` with the default alias analysis pipeline
303 /// registered.
304 ///
305 /// This also adds target-specific alias analyses registered via
306 /// TargetMachine::registerDefaultAliasAnalyses().
308
309 /// Parse a textual pass pipeline description into a \c
310 /// ModulePassManager.
311 ///
312 /// The format of the textual pass pipeline description looks something like:
313 ///
314 /// module(function(instcombine,sroa),dce,cgscc(inliner,function(...)),...)
315 ///
316 /// Pass managers have ()s describing the nest structure of passes. All passes
317 /// are comma separated. As a special shortcut, if the very first pass is not
318 /// a module pass (as a module pass manager is), this will automatically form
319 /// the shortest stack of pass managers that allow inserting that first pass.
320 /// So, assuming function passes 'fpassN', CGSCC passes 'cgpassN', and loop
321 /// passes 'lpassN', all of these are valid:
322 ///
323 /// fpass1,fpass2,fpass3
324 /// cgpass1,cgpass2,cgpass3
325 /// lpass1,lpass2,lpass3
326 ///
327 /// And they are equivalent to the following (resp.):
328 ///
329 /// module(function(fpass1,fpass2,fpass3))
330 /// module(cgscc(cgpass1,cgpass2,cgpass3))
331 /// module(function(loop(lpass1,lpass2,lpass3)))
332 ///
333 /// This shortcut is especially useful for debugging and testing small pass
334 /// combinations.
335 ///
336 /// The sequence of passes aren't necessarily the exact same kind of pass.
337 /// You can mix different levels implicitly if adaptor passes are defined to
338 /// make them work. For example,
339 ///
340 /// mpass1,fpass1,fpass2,mpass2,lpass1
341 ///
342 /// This pipeline uses only one pass manager: the top-level module manager.
343 /// fpass1,fpass2 and lpass1 are added into the top-level module manager
344 /// using only adaptor passes. No nested function/loop pass managers are
345 /// added. The purpose is to allow easy pass testing when the user
346 /// specifically want the pass to run under a adaptor directly. This is
347 /// preferred when a pipeline is largely of one type, but one or just a few
348 /// passes are of different types(See PassBuilder.cpp for examples).
350
351 /// {{@ Parse a textual pass pipeline description into a specific PassManager
352 ///
353 /// Automatic deduction of an appropriate pass manager stack is not supported.
354 /// For example, to insert a loop pass 'lpass' into a FunctionPassManager,
355 /// this is the valid pipeline text:
356 ///
357 /// function(lpass)
361 /// @}}
362
363 /// Parse a textual MIR pipeline into the provided \c MachineFunctionPass
364 /// manager.
365 /// The format of the textual machine pipeline is a comma separated list of
366 /// machine pass names:
367 ///
368 /// machine-funciton-pass,machine-module-pass,...
369 ///
370 /// There is no need to specify the pass nesting, and this function
371 /// currently cannot handle the pass nesting.
373 StringRef PipelineText);
374
375 /// Parse a textual alias analysis pipeline into the provided AA manager.
376 ///
377 /// The format of the textual AA pipeline is a comma separated list of AA
378 /// pass names:
379 ///
380 /// basic-aa,globals-aa,...
381 ///
382 /// The AA manager is set up such that the provided alias analyses are tried
383 /// in the order specified. See the \c AAManaager documentation for details
384 /// about the logic used. This routine just provides the textual mapping
385 /// between AA names and the analyses to register with the manager.
386 ///
387 /// Returns false if the text cannot be parsed cleanly. The specific state of
388 /// the \p AA manager is unspecified if such an error is encountered and this
389 /// returns false.
390 Error parseAAPipeline(AAManager &AA, StringRef PipelineText);
391
392 /// Parse RegClassFilterName to get RegClassFilterFunc.
394
395 /// Print pass names.
397
398 /// Register a callback for a default optimizer pipeline extension
399 /// point
400 ///
401 /// This extension point allows adding passes that perform peephole
402 /// optimizations similar to the instruction combiner. These passes will be
403 /// inserted after each instance of the instruction combiner pass.
405 const std::function<void(FunctionPassManager &, OptimizationLevel)> &C) {
406 PeepholeEPCallbacks.push_back(C);
407 }
408
409 /// Register a callback for a default optimizer pipeline extension
410 /// point
411 ///
412 /// This extension point allows adding late loop canonicalization and
413 /// simplification passes. This is the last point in the loop optimization
414 /// pipeline before loop deletion. Each pass added
415 /// here must be an instance of LoopPass.
416 /// This is the place to add passes that can remove loops, such as target-
417 /// specific loop idiom recognition.
419 const std::function<void(LoopPassManager &, OptimizationLevel)> &C) {
420 LateLoopOptimizationsEPCallbacks.push_back(C);
421 }
422
423 /// Register a callback for a default optimizer pipeline extension
424 /// point
425 ///
426 /// This extension point allows adding loop passes to the end of the loop
427 /// optimizer.
429 const std::function<void(LoopPassManager &, OptimizationLevel)> &C) {
430 LoopOptimizerEndEPCallbacks.push_back(C);
431 }
432
433 /// Register a callback for a default optimizer pipeline extension
434 /// point
435 ///
436 /// This extension point allows adding optimization passes after most of the
437 /// main optimizations, but before the last cleanup-ish optimizations.
439 const std::function<void(FunctionPassManager &, OptimizationLevel)> &C) {
440 ScalarOptimizerLateEPCallbacks.push_back(C);
441 }
442
443 /// Register a callback for a default optimizer pipeline extension
444 /// point
445 ///
446 /// This extension point allows adding CallGraphSCC passes at the end of the
447 /// main CallGraphSCC passes and before any function simplification passes run
448 /// by CGPassManager.
450 const std::function<void(CGSCCPassManager &, OptimizationLevel)> &C) {
451 CGSCCOptimizerLateEPCallbacks.push_back(C);
452 }
453
454 /// Register a callback for a default optimizer pipeline extension
455 /// point
456 ///
457 /// This extension point allows adding optimization passes before the
458 /// vectorizer and other highly target specific optimization passes are
459 /// executed.
461 const std::function<void(FunctionPassManager &, OptimizationLevel)> &C) {
462 VectorizerStartEPCallbacks.push_back(C);
463 }
464
465 /// Register a callback for a default optimizer pipeline extension point.
466 ///
467 /// This extension point allows adding optimization once at the start of the
468 /// pipeline. This does not apply to 'backend' compiles (LTO and ThinLTO
469 /// link-time pipelines).
471 const std::function<void(ModulePassManager &, OptimizationLevel)> &C) {
472 PipelineStartEPCallbacks.push_back(C);
473 }
474
475 /// Register a callback for a default optimizer pipeline extension point.
476 ///
477 /// This extension point allows adding optimization right after passes that do
478 /// basic simplification of the input IR.
480 const std::function<void(ModulePassManager &, OptimizationLevel)> &C) {
481 PipelineEarlySimplificationEPCallbacks.push_back(C);
482 }
483
484 /// Register a callback for a default optimizer pipeline extension point
485 ///
486 /// This extension point allows adding optimizations before the function
487 /// optimization pipeline.
489 const std::function<void(ModulePassManager &, OptimizationLevel)> &C) {
490 OptimizerEarlyEPCallbacks.push_back(C);
491 }
492
493 /// Register a callback for a default optimizer pipeline extension point
494 ///
495 /// This extension point allows adding optimizations at the very end of the
496 /// function optimization pipeline.
498 const std::function<void(ModulePassManager &, OptimizationLevel)> &C) {
499 OptimizerLastEPCallbacks.push_back(C);
500 }
501
502 /// Register a callback for a default optimizer pipeline extension point
503 ///
504 /// This extension point allows adding optimizations at the start of the full
505 /// LTO pipeline.
507 const std::function<void(ModulePassManager &, OptimizationLevel)> &C) {
508 FullLinkTimeOptimizationEarlyEPCallbacks.push_back(C);
509 }
510
511 /// Register a callback for a default optimizer pipeline extension point
512 ///
513 /// This extension point allows adding optimizations at the end of the full
514 /// LTO pipeline.
516 const std::function<void(ModulePassManager &, OptimizationLevel)> &C) {
517 FullLinkTimeOptimizationLastEPCallbacks.push_back(C);
518 }
519
520 /// Register a callback for parsing an AliasAnalysis Name to populate
521 /// the given AAManager \p AA
523 const std::function<bool(StringRef Name, AAManager &AA)> &C) {
524 AAParsingCallbacks.push_back(C);
525 }
526
527 /// {{@ Register callbacks for analysis registration with this PassBuilder
528 /// instance.
529 /// Callees register their analyses with the given AnalysisManager objects.
531 const std::function<void(CGSCCAnalysisManager &)> &C) {
532 CGSCCAnalysisRegistrationCallbacks.push_back(C);
533 }
535 const std::function<void(FunctionAnalysisManager &)> &C) {
536 FunctionAnalysisRegistrationCallbacks.push_back(C);
537 }
539 const std::function<void(LoopAnalysisManager &)> &C) {
540 LoopAnalysisRegistrationCallbacks.push_back(C);
541 }
543 const std::function<void(ModuleAnalysisManager &)> &C) {
544 ModuleAnalysisRegistrationCallbacks.push_back(C);
545 }
547 const std::function<void(MachineFunctionAnalysisManager &)> &C) {
548 MachineFunctionAnalysisRegistrationCallbacks.push_back(C);
549 }
550 /// @}}
551
552 /// {{@ Register pipeline parsing callbacks with this pass builder instance.
553 /// Using these callbacks, callers can parse both a single pass name, as well
554 /// as entire sub-pipelines, and populate the PassManager instance
555 /// accordingly.
557 const std::function<bool(StringRef Name, CGSCCPassManager &,
559 CGSCCPipelineParsingCallbacks.push_back(C);
560 }
562 const std::function<bool(StringRef Name, FunctionPassManager &,
564 FunctionPipelineParsingCallbacks.push_back(C);
565 }
567 const std::function<bool(StringRef Name, LoopPassManager &,
569 LoopPipelineParsingCallbacks.push_back(C);
570 }
572 const std::function<bool(StringRef Name, ModulePassManager &,
574 ModulePipelineParsingCallbacks.push_back(C);
575 }
577 const std::function<bool(StringRef Name, MachineFunctionPassManager &,
579 MachineFunctionPipelineParsingCallbacks.push_back(C);
580 }
581 /// @}}
582
583 /// Register callbacks to parse target specific filter field if regalloc pass
584 /// needs it. E.g. AMDGPU requires regalloc passes can handle sgpr and vgpr
585 /// separately.
587 const std::function<RegClassFilterFunc(StringRef)> &C) {
588 RegClassFilterParsingCallbacks.push_back(C);
589 }
590
591 /// Register a callback for a top-level pipeline entry.
592 ///
593 /// If the PassManager type is not given at the top level of the pipeline
594 /// text, this Callback should be used to determine the appropriate stack of
595 /// PassManagers and populate the passed ModulePassManager.
597 const std::function<bool(ModulePassManager &, ArrayRef<PipelineElement>)>
598 &C);
599
600 /// Add PGOInstrumenation passes for O0 only.
601 void addPGOInstrPassesForO0(ModulePassManager &MPM, bool RunProfileGen,
602 bool IsCS, bool AtomicCounterUpdate,
603 std::string ProfileFile,
604 std::string ProfileRemappingFile,
606
607 /// Returns PIC. External libraries can use this to register pass
608 /// instrumentation callbacks.
610 return PIC;
611 }
612
613 // Invoke the callbacks registered for the various extension points.
614 // Custom pipelines should use these to invoke the callbacks registered
615 // by TargetMachines and other clients.
617 OptimizationLevel Level);
619 OptimizationLevel Level);
621 OptimizationLevel Level);
623 OptimizationLevel Level);
625 OptimizationLevel Level);
627 OptimizationLevel Level);
629 OptimizationLevel Level);
631 OptimizationLevel Level);
633 OptimizationLevel Level);
635 OptimizationLevel Level);
637 OptimizationLevel Level);
639 OptimizationLevel Level);
640
642 if (!Name.consume_front(PassName))
643 return false;
644 // normal pass name w/o parameters == default parameters
645 if (Name.empty())
646 return true;
647 return Name.starts_with("<") && Name.ends_with(">");
648 }
649
650 /// This performs customized parsing of pass name with parameters.
651 ///
652 /// We do not need parametrization of passes in textual pipeline very often,
653 /// yet on a rare occasion ability to specify parameters right there can be
654 /// useful.
655 ///
656 /// \p Name - parameterized specification of a pass from a textual pipeline
657 /// is a string in a form of :
658 /// PassName '<' parameter-list '>'
659 ///
660 /// Parameter list is being parsed by the parser callable argument, \p Parser,
661 /// It takes a string-ref of parameters and returns either StringError or a
662 /// parameter list in a form of a custom parameters type, all wrapped into
663 /// Expected<> template class.
664 ///
665 template <typename ParametersParseCallableT>
666 static auto parsePassParameters(ParametersParseCallableT &&Parser,
668 -> decltype(Parser(StringRef{})) {
669 using ParametersT = typename decltype(Parser(StringRef{}))::value_type;
670
671 StringRef Params = Name;
672 if (!Params.consume_front(PassName)) {
674 "unable to strip pass name from parametrized pass specification");
675 }
676 if (!Params.empty() &&
677 (!Params.consume_front("<") || !Params.consume_back(">"))) {
678 llvm_unreachable("invalid format for parametrized pass name");
679 }
680
681 Expected<ParametersT> Result = Parser(Params);
682 assert((Result || Result.template errorIsA<StringError>()) &&
683 "Pass parameter parser can only return StringErrors.");
684 return Result;
685 }
686
687 /// Handle passes only accept one bool-valued parameter.
688 ///
689 /// \return false when Params is empty.
690 static Expected<bool> parseSinglePassOption(StringRef Params,
691 StringRef OptionName,
692 StringRef PassName);
693
694private:
695 // O1 pass pipeline
697 buildO1FunctionSimplificationPipeline(OptimizationLevel Level,
699
700 void addRequiredLTOPreLinkPasses(ModulePassManager &MPM);
701
702 void addVectorPasses(OptimizationLevel Level, FunctionPassManager &FPM,
703 bool IsFullLTO);
704
705 static std::optional<std::vector<PipelineElement>>
706 parsePipelineText(StringRef Text);
707
708 Error parseModulePass(ModulePassManager &MPM, const PipelineElement &E);
709 Error parseCGSCCPass(CGSCCPassManager &CGPM, const PipelineElement &E);
710 Error parseFunctionPass(FunctionPassManager &FPM, const PipelineElement &E);
711 Error parseLoopPass(LoopPassManager &LPM, const PipelineElement &E);
712 Error parseMachinePass(MachineFunctionPassManager &MFPM,
713 const PipelineElement &E);
714 bool parseAAPassName(AAManager &AA, StringRef Name);
715
716 Error parseMachinePassPipeline(MachineFunctionPassManager &MFPM,
717 ArrayRef<PipelineElement> Pipeline);
718 Error parseLoopPassPipeline(LoopPassManager &LPM,
719 ArrayRef<PipelineElement> Pipeline);
720 Error parseFunctionPassPipeline(FunctionPassManager &FPM,
721 ArrayRef<PipelineElement> Pipeline);
722 Error parseCGSCCPassPipeline(CGSCCPassManager &CGPM,
723 ArrayRef<PipelineElement> Pipeline);
724 Error parseModulePassPipeline(ModulePassManager &MPM,
725 ArrayRef<PipelineElement> Pipeline);
726
727 // Adds passes to do pre-inlining and related cleanup passes before
728 // profile instrumentation/matching (to enable better context sensitivity),
729 // and for memprof to enable better matching with missing debug frames.
730 void addPreInlinerPasses(ModulePassManager &MPM, OptimizationLevel Level,
731 ThinOrFullLTOPhase LTOPhase);
732
733 void addPGOInstrPasses(ModulePassManager &MPM, OptimizationLevel Level,
734 bool RunProfileGen, bool IsCS,
735 bool AtomicCounterUpdate, std::string ProfileFile,
736 std::string ProfileRemappingFile,
737 IntrusiveRefCntPtr<vfs::FileSystem> FS);
738 void addPostPGOLoopRotation(ModulePassManager &MPM, OptimizationLevel Level);
739
740 // Extension Point callbacks
741 SmallVector<std::function<void(FunctionPassManager &, OptimizationLevel)>, 2>
742 PeepholeEPCallbacks;
743 SmallVector<std::function<void(LoopPassManager &, OptimizationLevel)>, 2>
744 LateLoopOptimizationsEPCallbacks;
745 SmallVector<std::function<void(LoopPassManager &, OptimizationLevel)>, 2>
746 LoopOptimizerEndEPCallbacks;
747 SmallVector<std::function<void(FunctionPassManager &, OptimizationLevel)>, 2>
748 ScalarOptimizerLateEPCallbacks;
749 SmallVector<std::function<void(CGSCCPassManager &, OptimizationLevel)>, 2>
750 CGSCCOptimizerLateEPCallbacks;
751 SmallVector<std::function<void(FunctionPassManager &, OptimizationLevel)>, 2>
752 VectorizerStartEPCallbacks;
753 // Module callbacks
754 SmallVector<std::function<void(ModulePassManager &, OptimizationLevel)>, 2>
755 OptimizerEarlyEPCallbacks;
756 SmallVector<std::function<void(ModulePassManager &, OptimizationLevel)>, 2>
757 OptimizerLastEPCallbacks;
758 SmallVector<std::function<void(ModulePassManager &, OptimizationLevel)>, 2>
759 FullLinkTimeOptimizationEarlyEPCallbacks;
760 SmallVector<std::function<void(ModulePassManager &, OptimizationLevel)>, 2>
761 FullLinkTimeOptimizationLastEPCallbacks;
762 SmallVector<std::function<void(ModulePassManager &, OptimizationLevel)>, 2>
763 PipelineStartEPCallbacks;
764 SmallVector<std::function<void(ModulePassManager &, OptimizationLevel)>, 2>
765 PipelineEarlySimplificationEPCallbacks;
766
767 SmallVector<std::function<void(ModuleAnalysisManager &)>, 2>
768 ModuleAnalysisRegistrationCallbacks;
769 SmallVector<std::function<bool(StringRef, ModulePassManager &,
770 ArrayRef<PipelineElement>)>,
771 2>
772 ModulePipelineParsingCallbacks;
774 std::function<bool(ModulePassManager &, ArrayRef<PipelineElement>)>, 2>
775 TopLevelPipelineParsingCallbacks;
776 // CGSCC callbacks
777 SmallVector<std::function<void(CGSCCAnalysisManager &)>, 2>
778 CGSCCAnalysisRegistrationCallbacks;
779 SmallVector<std::function<bool(StringRef, CGSCCPassManager &,
780 ArrayRef<PipelineElement>)>,
781 2>
782 CGSCCPipelineParsingCallbacks;
783 // Function callbacks
784 SmallVector<std::function<void(FunctionAnalysisManager &)>, 2>
785 FunctionAnalysisRegistrationCallbacks;
786 SmallVector<std::function<bool(StringRef, FunctionPassManager &,
787 ArrayRef<PipelineElement>)>,
788 2>
789 FunctionPipelineParsingCallbacks;
790 // Loop callbacks
791 SmallVector<std::function<void(LoopAnalysisManager &)>, 2>
792 LoopAnalysisRegistrationCallbacks;
793 SmallVector<std::function<bool(StringRef, LoopPassManager &,
794 ArrayRef<PipelineElement>)>,
795 2>
796 LoopPipelineParsingCallbacks;
797 // AA callbacks
798 SmallVector<std::function<bool(StringRef Name, AAManager &AA)>, 2>
799 AAParsingCallbacks;
800 // Machine pass callbackcs
801 SmallVector<std::function<void(MachineFunctionAnalysisManager &)>, 2>
802 MachineFunctionAnalysisRegistrationCallbacks;
803 SmallVector<std::function<bool(StringRef, MachineFunctionPassManager &,
804 ArrayRef<PipelineElement>)>,
805 2>
806 MachineFunctionPipelineParsingCallbacks;
807 // Callbacks to parse `filter` parameter in register allocation passes
808 SmallVector<std::function<RegClassFilterFunc(StringRef)>, 2>
809 RegClassFilterParsingCallbacks;
810};
811
812/// This utility template takes care of adding require<> and invalidate<>
813/// passes for an analysis to a given \c PassManager. It is intended to be used
814/// during parsing of a pass pipeline when parsing a single PipelineName.
815/// When registering a new function analysis FancyAnalysis with the pass
816/// pipeline name "fancy-analysis", a matching ParsePipelineCallback could look
817/// like this:
818///
819/// static bool parseFunctionPipeline(StringRef Name, FunctionPassManager &FPM,
820/// ArrayRef<PipelineElement> P) {
821/// if (parseAnalysisUtilityPasses<FancyAnalysis>("fancy-analysis", Name,
822/// FPM))
823/// return true;
824/// return false;
825/// }
826template <typename AnalysisT, typename IRUnitT, typename AnalysisManagerT,
827 typename... ExtraArgTs>
829 StringRef AnalysisName, StringRef PipelineName,
831 if (!PipelineName.ends_with(">"))
832 return false;
833 // See if this is an invalidate<> pass name
834 if (PipelineName.starts_with("invalidate<")) {
835 PipelineName = PipelineName.substr(11, PipelineName.size() - 12);
836 if (PipelineName != AnalysisName)
837 return false;
839 return true;
840 }
841
842 // See if this is a require<> pass name
843 if (PipelineName.starts_with("require<")) {
844 PipelineName = PipelineName.substr(8, PipelineName.size() - 9);
845 if (PipelineName != AnalysisName)
846 return false;
847 PM.addPass(RequireAnalysisPass<AnalysisT, IRUnitT, AnalysisManagerT,
848 ExtraArgTs...>());
849 return true;
850 }
851
852 return false;
853}
854
855// These are special since they are only for testing purposes.
856
857/// No-op module pass which does nothing.
858struct NoOpModulePass : PassInfoMixin<NoOpModulePass> {
860 return PreservedAnalyses::all();
861 }
862};
863
864/// No-op module analysis.
865class NoOpModuleAnalysis : public AnalysisInfoMixin<NoOpModuleAnalysis> {
867 static AnalysisKey Key;
868
869public:
870 struct Result {};
872};
873
874/// No-op CGSCC pass which does nothing.
875struct NoOpCGSCCPass : PassInfoMixin<NoOpCGSCCPass> {
878 return PreservedAnalyses::all();
879 }
880};
881
882/// No-op CGSCC analysis.
883class NoOpCGSCCAnalysis : public AnalysisInfoMixin<NoOpCGSCCAnalysis> {
885 static AnalysisKey Key;
886
887public:
888 struct Result {};
890 return Result();
891 }
892};
893
894/// No-op function pass which does nothing.
895struct NoOpFunctionPass : PassInfoMixin<NoOpFunctionPass> {
897 return PreservedAnalyses::all();
898 }
899};
900
901/// No-op function analysis.
902class NoOpFunctionAnalysis : public AnalysisInfoMixin<NoOpFunctionAnalysis> {
904 static AnalysisKey Key;
905
906public:
907 struct Result {};
909};
910
911/// No-op loop nest pass which does nothing.
912struct NoOpLoopNestPass : PassInfoMixin<NoOpLoopNestPass> {
915 return PreservedAnalyses::all();
916 }
917};
918
919/// No-op loop pass which does nothing.
920struct NoOpLoopPass : PassInfoMixin<NoOpLoopPass> {
923 return PreservedAnalyses::all();
924 }
925};
926
927/// No-op machine function pass which does nothing.
928struct NoOpMachineFunctionPass : public PassInfoMixin<NoOpMachineFunctionPass> {
930 return PreservedAnalyses::all();
931 }
932};
933
934/// No-op loop analysis.
935class NoOpLoopAnalysis : public AnalysisInfoMixin<NoOpLoopAnalysis> {
937 static AnalysisKey Key;
938
939public:
940 struct Result {};
942 return Result();
943 }
944};
945}
946
947#endif
aarch64 falkor hwpf fix Falkor HW Prefetch Fix Late Phase
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This header provides classes for managing passes over SCCs of the call graph.
std::string Name
This header provides classes for managing a pipeline of passes over loops in LLVM IR.
#define F(x, y, z)
Definition: MD5.cpp:55
#define G(x, y, z)
Definition: MD5.cpp:56
This header enumerates the LLVM-provided high-level optimization levels.
Define option tunables for PGO.
CGSCCAnalysisManager CGAM
ModulePassManager MPM
LoopAnalysisManager LAM
FunctionAnalysisManager FAM
ModuleAnalysisManager MAM
PassInstrumentationCallbacks PIC
This header defines various interfaces for pass management in LLVM.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
raw_pwrite_stream & OS
static const char PassName[]
A manager for alias analyses.
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:321
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCount...
This class provides an interface for updating the loop pass manager based on mutations to the loop ne...
An SCC of the call graph.
A lazily constructed view of the call graph of a module.
This class represents a loop nest and can be used to query its properties.
Represents a single loop in the control flow graph.
Definition: LoopInfo.h:44
Module pass, wrapping the inliner pass.
Definition: Inliner.h:62
Class to hold module path string table and global value map, and encapsulate methods for operating on...
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
No-op CGSCC analysis.
Definition: PassBuilder.h:883
Result run(LazyCallGraph::SCC &, CGSCCAnalysisManager &, LazyCallGraph &G)
Definition: PassBuilder.h:889
No-op function analysis.
Definition: PassBuilder.h:902
Result run(Function &, FunctionAnalysisManager &)
Definition: PassBuilder.h:908
No-op loop analysis.
Definition: PassBuilder.h:935
Result run(Loop &, LoopAnalysisManager &, LoopStandardAnalysisResults &)
Definition: PassBuilder.h:941
No-op module analysis.
Definition: PassBuilder.h:865
Result run(Module &, ModuleAnalysisManager &)
Definition: PassBuilder.h:871
This class provides access to building LLVM's passes.
Definition: PassBuilder.h:105
ModulePassManager buildO0DefaultPipeline(OptimizationLevel Level, bool LTOPreLink=false)
Build an O0 pipeline with the minimal semantically required passes.
void invokeFullLinkTimeOptimizationLastEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level)
ModuleInlinerWrapperPass buildInlinerPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase)
Construct the module pipeline that performs inlining as well as the inlining-driven cleanups.
void registerAnalysisRegistrationCallback(const std::function< void(MachineFunctionAnalysisManager &)> &C)
Definition: PassBuilder.h:546
void printPassNames(raw_ostream &OS)
Print pass names.
static bool checkParametrizedPassName(StringRef Name, StringRef PassName)
Definition: PassBuilder.h:641
void invokeOptimizerLastEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level)
void registerPipelineEarlySimplificationEPCallback(const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:479
void invokeVectorizerStartEPCallbacks(FunctionPassManager &FPM, OptimizationLevel Level)
void registerPipelineParsingCallback(const std::function< bool(StringRef Name, ModulePassManager &, ArrayRef< PipelineElement >)> &C)
Definition: PassBuilder.h:571
AAManager buildDefaultAAPipeline()
Build the default AAManager with the default alias analysis pipeline registered.
Error parseAAPipeline(AAManager &AA, StringRef PipelineText)
Parse a textual alias analysis pipeline into the provided AA manager.
void invokeCGSCCOptimizerLateEPCallbacks(CGSCCPassManager &CGPM, OptimizationLevel Level)
ModulePassManager buildThinLTOPreLinkDefaultPipeline(OptimizationLevel Level)
Build a pre-link, ThinLTO-targeting default optimization pipeline to a pass manager.
void registerAnalysisRegistrationCallback(const std::function< void(ModuleAnalysisManager &)> &C)
Definition: PassBuilder.h:542
void registerPipelineStartEPCallback(const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:470
void invokeScalarOptimizerLateEPCallbacks(FunctionPassManager &FPM, OptimizationLevel Level)
void registerPipelineParsingCallback(const std::function< bool(StringRef Name, LoopPassManager &, ArrayRef< PipelineElement >)> &C)
Definition: PassBuilder.h:566
void registerLoopAnalyses(LoopAnalysisManager &LAM)
Registers all available loop analysis passes.
PassInstrumentationCallbacks * getPassInstrumentationCallbacks() const
Returns PIC.
Definition: PassBuilder.h:609
void registerLateLoopOptimizationsEPCallback(const std::function< void(LoopPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:418
void crossRegisterProxies(LoopAnalysisManager &LAM, FunctionAnalysisManager &FAM, CGSCCAnalysisManager &CGAM, ModuleAnalysisManager &MAM, MachineFunctionAnalysisManager *MFAM=nullptr)
Cross register the analysis managers through their proxies.
void registerLoopOptimizerEndEPCallback(const std::function< void(LoopPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:428
void registerParseAACallback(const std::function< bool(StringRef Name, AAManager &AA)> &C)
Register a callback for parsing an AliasAnalysis Name to populate the given AAManager AA.
Definition: PassBuilder.h:522
void registerOptimizerLastEPCallback(const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:497
void registerVectorizerStartEPCallback(const std::function< void(FunctionPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:460
void registerAnalysisRegistrationCallback(const std::function< void(LoopAnalysisManager &)> &C)
Definition: PassBuilder.h:538
void registerPeepholeEPCallback(const std::function< void(FunctionPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:404
void registerAnalysisRegistrationCallback(const std::function< void(FunctionAnalysisManager &)> &C)
Definition: PassBuilder.h:534
void registerScalarOptimizerLateEPCallback(const std::function< void(FunctionPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:438
ModulePassManager buildPerModuleDefaultPipeline(OptimizationLevel Level, bool LTOPreLink=false)
Build a per-module default optimization pipeline.
void registerAnalysisRegistrationCallback(const std::function< void(CGSCCAnalysisManager &)> &C)
{{@ Register callbacks for analysis registration with this PassBuilder instance.
Definition: PassBuilder.h:530
void invokePipelineStartEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level)
FunctionPassManager buildFunctionSimplificationPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase)
Construct the core LLVM function canonicalization and simplification pipeline.
void registerCGSCCOptimizerLateEPCallback(const std::function< void(CGSCCPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:449
void invokePeepholeEPCallbacks(FunctionPassManager &FPM, OptimizationLevel Level)
Error parsePassPipeline(ModulePassManager &MPM, StringRef PipelineText)
Parse a textual pass pipeline description into a ModulePassManager.
void invokeLoopOptimizerEndEPCallbacks(LoopPassManager &LPM, OptimizationLevel Level)
void registerOptimizerEarlyEPCallback(const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:488
ModulePassManager buildLTODefaultPipeline(OptimizationLevel Level, ModuleSummaryIndex *ExportSummary)
Build an LTO default optimization pipeline to a pass manager.
ModulePassManager buildModuleInlinerPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase)
Construct the module pipeline that performs inlining with module inliner pass.
ModulePassManager buildThinLTODefaultPipeline(OptimizationLevel Level, const ModuleSummaryIndex *ImportSummary)
Build a ThinLTO default optimization pipeline to a pass manager.
void registerPipelineParsingCallback(const std::function< bool(StringRef Name, CGSCCPassManager &, ArrayRef< PipelineElement >)> &C)
{{@ Register pipeline parsing callbacks with this pass builder instance.
Definition: PassBuilder.h:556
void registerFullLinkTimeOptimizationEarlyEPCallback(const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:506
void registerRegClassFilterParsingCallback(const std::function< RegClassFilterFunc(StringRef)> &C)
Register callbacks to parse target specific filter field if regalloc pass needs it.
Definition: PassBuilder.h:586
void invokeLateLoopOptimizationsEPCallbacks(LoopPassManager &LPM, OptimizationLevel Level)
void invokeOptimizerEarlyEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level)
void registerPipelineParsingCallback(const std::function< bool(StringRef Name, FunctionPassManager &, ArrayRef< PipelineElement >)> &C)
Definition: PassBuilder.h:561
void registerModuleAnalyses(ModuleAnalysisManager &MAM)
Registers all available module analysis passes.
void invokePipelineEarlySimplificationEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level)
void registerFullLinkTimeOptimizationLastEPCallback(const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:515
void registerCGSCCAnalyses(CGSCCAnalysisManager &CGAM)
Registers all available CGSCC analysis passes.
void invokeFullLinkTimeOptimizationEarlyEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level)
ModulePassManager buildFatLTODefaultPipeline(OptimizationLevel Level, bool ThinLTO, bool EmitSummary)
Build a fat object default optimization pipeline.
static auto parsePassParameters(ParametersParseCallableT &&Parser, StringRef Name, StringRef PassName) -> decltype(Parser(StringRef{}))
This performs customized parsing of pass name with parameters.
Definition: PassBuilder.h:666
ModulePassManager buildModuleSimplificationPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase)
Construct the core LLVM module canonicalization and simplification pipeline.
void registerPipelineParsingCallback(const std::function< bool(StringRef Name, MachineFunctionPassManager &, ArrayRef< PipelineElement >)> &C)
Definition: PassBuilder.h:576
static Expected< bool > parseSinglePassOption(StringRef Params, StringRef OptionName, StringRef PassName)
Handle passes only accept one bool-valued parameter.
void registerMachineFunctionAnalyses(MachineFunctionAnalysisManager &MFAM)
Registers all available machine function analysis passes.
ModulePassManager buildModuleOptimizationPipeline(OptimizationLevel Level, ThinOrFullLTOPhase LTOPhase)
Construct the core LLVM module optimization pipeline.
void registerParseTopLevelPipelineCallback(const std::function< bool(ModulePassManager &, ArrayRef< PipelineElement >)> &C)
Register a callback for a top-level pipeline entry.
RegClassFilterFunc parseRegAllocFilter(StringRef RegClassFilterName)
Parse RegClassFilterName to get RegClassFilterFunc.
void addPGOInstrPassesForO0(ModulePassManager &MPM, bool RunProfileGen, bool IsCS, bool AtomicCounterUpdate, std::string ProfileFile, std::string ProfileRemappingFile, IntrusiveRefCntPtr< vfs::FileSystem > FS)
Add PGOInstrumenation passes for O0 only.
ModulePassManager buildLTOPreLinkDefaultPipeline(OptimizationLevel Level)
Build a pre-link, LTO-targeting default optimization pipeline to a pass manager.
void registerFunctionAnalyses(FunctionAnalysisManager &FAM)
Registers all available function analysis passes.
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
LLVM_ATTRIBUTE_MINSIZE void addPass(PassT &&Pass)
Definition: PassManager.h:249
Tunable parameters for passes in the default pipelines.
Definition: PassBuilder.h:43
unsigned LicmMssaNoAccForPromotionCap
Tuning option to disable promotion to scalars in LICM with MemorySSA, if the number of access is too ...
Definition: PassBuilder.h:73
bool SLPVectorization
Tuning option to enable/disable slp loop vectorization, set based on opt level.
Definition: PassBuilder.h:58
int InlinerThreshold
Tuning option to override the default inliner threshold.
Definition: PassBuilder.h:87
bool CallGraphProfile
Tuning option to enable/disable call graph profile.
Definition: PassBuilder.h:77
bool MergeFunctions
Tuning option to enable/disable function merging.
Definition: PassBuilder.h:84
bool ForgetAllSCEVInLoopUnroll
Tuning option to forget all SCEV loops in LoopUnroll.
Definition: PassBuilder.h:65
unsigned LicmMssaOptCap
Tuning option to cap the number of calls to retrive clobbering accesses in MemorySSA,...
Definition: PassBuilder.h:69
bool LoopInterleaving
Tuning option to set loop interleaving on/off, set based on opt level.
Definition: PassBuilder.h:50
PipelineTuningOptions()
Constructor sets pipeline tuning defaults based on cl::opts.
bool LoopUnrolling
Tuning option to enable/disable loop unrolling. Its default value is true.
Definition: PassBuilder.h:61
bool LoopVectorization
Tuning option to enable/disable loop vectorization, set based on opt level.
Definition: PassBuilder.h:54
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:109
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Definition: Analysis.h:115
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
constexpr StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
Definition: StringRef.h:564
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
Definition: StringRef.h:258
constexpr size_t size() const
size - Get the string size.
Definition: StringRef.h:137
bool ends_with(StringRef Suffix) const
Check if this string ends with the given Suffix.
Definition: StringRef.h:270
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:76
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
PassManager< Module > ModulePassManager
Convenience typedef for a pass manager over modules.
Definition: PassManager.h:283
PassManager< Function > FunctionPassManager
Convenience typedef for a pass manager over functions.
Definition: PassManager.h:288
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
bool parseAnalysisUtilityPasses(StringRef AnalysisName, StringRef PipelineName, PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs... > &PM)
This utility template takes care of adding require<> and invalidate<> passes for an analysis to a giv...
Definition: PassBuilder.h:828
PassManager< MachineFunction > MachineFunctionPassManager
Convenience typedef for a pass manager over functions.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
Definition: PassManager.h:610
AnalysisManager< Loop, LoopStandardAnalysisResults & > LoopAnalysisManager
The loop analysis manager.
ThinOrFullLTOPhase
This enumerates the LLVM full LTO or ThinLTO optimization phases.
Definition: Pass.h:76
PassManager< Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & > LoopPassManager
The Loop pass manager.
PassManager< LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, CGSCCUpdateResult & > CGSCCPassManager
The CGSCC pass manager.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
Definition: SmallVector.h:1135
AnalysisManager< LazyCallGraph::SCC, LazyCallGraph & > CGSCCAnalysisManager
The CGSCC analysis manager.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition: MIRParser.h:38
std::function< bool(const TargetRegisterInfo &TRI, const TargetRegisterClass &RC)> RegClassFilterFunc
A CRTP mix-in that provides informational APIs needed for analysis passes.
Definition: PassManager.h:97
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition: Analysis.h:26
Support structure for SCC passes to communicate updates the call graph back to the CGSCC pass manager...
A no-op pass template which simply forces a specific analysis result to be invalidated.
Definition: PassManager.h:969
The adaptor from a function pass to a loop pass computes these analyses and makes them available to t...
No-op CGSCC pass which does nothing.
Definition: PassBuilder.h:875
PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &, LazyCallGraph &, CGSCCUpdateResult &UR)
Definition: PassBuilder.h:876
No-op function pass which does nothing.
Definition: PassBuilder.h:895
PreservedAnalyses run(Function &F, FunctionAnalysisManager &)
Definition: PassBuilder.h:896
No-op loop nest pass which does nothing.
Definition: PassBuilder.h:912
PreservedAnalyses run(LoopNest &L, LoopAnalysisManager &, LoopStandardAnalysisResults &, LPMUpdater &)
Definition: PassBuilder.h:913
No-op loop pass which does nothing.
Definition: PassBuilder.h:920
PreservedAnalyses run(Loop &L, LoopAnalysisManager &, LoopStandardAnalysisResults &, LPMUpdater &)
Definition: PassBuilder.h:921
No-op machine function pass which does nothing.
Definition: PassBuilder.h:928
PreservedAnalyses run(MachineFunction &, MachineFunctionAnalysisManager &)
Definition: PassBuilder.h:929
No-op module pass which does nothing.
Definition: PassBuilder.h:858
PreservedAnalyses run(Module &M, ModuleAnalysisManager &)
Definition: PassBuilder.h:859
A struct to capture parsed pass pipeline names.
Definition: PassBuilder.h:120
std::vector< PipelineElement > InnerPipeline
Definition: PassBuilder.h:122
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:74
A utility pass template to force an analysis result to be available.
Definition: PassManager.h:942