mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
538 lines
26 KiB
C++
538 lines
26 KiB
C++
//===--- Passes.def - Swift SILPass Metaprogramming -------------*- C++ -*-===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines macros used for macro-metaprogramming with SILPasses.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
/// PASS(Id, Tag, Description)
|
|
/// Id is a pass "identifier", used for its enum case, PassKind::Id,
|
|
/// and type name, as returned by the global function swift::create##Id().
|
|
///
|
|
/// Tag identifies the pass as a command-line compatible option string.
|
|
///
|
|
/// Description is a short description of the pass.
|
|
///
|
|
/// Id and Tag are unique identifiers which may be used in test
|
|
/// cases and tools to specify a pass by string. Different tools simply prefer
|
|
/// different identifier formats. Changing any of one these strings may change
|
|
/// the functionality of some tests.
|
|
///
|
|
/// This macro must be defined by the includer.
|
|
#ifndef PASS
|
|
#error "Macro must be defined by includer"
|
|
#endif
|
|
|
|
/// IRGEN_PASS(Id, Tag, Description)
|
|
/// This macro follows the same conventions as PASS(Id, Tag, Description),
|
|
/// but is used for IRGen passes which are built outside of the
|
|
/// SILOptimizer library.
|
|
///
|
|
/// An IRGen pass is created by IRGen and needs to be registered with the pass
|
|
/// manager dynamically.
|
|
#ifndef IRGEN_PASS
|
|
#define IRGEN_PASS(Id, Tag, Description) PASS(Id, Tag, Description)
|
|
#endif
|
|
|
|
/// SWIFT_MODULE_PASS(Id, Tag, Description)
|
|
/// This macro follows the same conventions as PASS(Id, Tag, Description),
|
|
/// but is used for module passes which are implemented in Swift.
|
|
///
|
|
/// No further code is need on the C++ side. On the swift swift a module
|
|
/// pass with the same name must be registered with 'registerPass()'.
|
|
///
|
|
#ifndef SWIFT_MODULE_PASS
|
|
#define SWIFT_MODULE_PASS(Id, Tag, Description) PASS(Id, Tag, Description)
|
|
#endif
|
|
|
|
/// SWIFT_FUNCTION_PASS(Id, Tag, Description)
|
|
/// This macro follows the same conventions as PASS(Id, Tag, Description),
|
|
/// but is used for function passes which are implemented in Swift.
|
|
///
|
|
/// No further code is need on the C++ side. On the swift function
|
|
/// pass with the same name must be registered with 'registerPass()'.
|
|
///
|
|
#ifndef SWIFT_FUNCTION_PASS
|
|
#define SWIFT_FUNCTION_PASS(Id, Tag, Description) PASS(Id, Tag, Description)
|
|
#endif
|
|
|
|
/// SWIFT_SILCOMBINE_PASS(Inst)
|
|
/// Similar to SWIFT_FUNCTION_PASS, but defines an instruction pass which is
|
|
/// implemented in swift and is run by the SILCombiner.
|
|
/// The \p Inst argument specifies the instruction class.
|
|
///
|
|
/// No further code is need on the C++ side. On the swift side an instruction
|
|
/// pass must be registered for the instruction class with 'registerPass()'.
|
|
///
|
|
#ifndef SWIFT_SILCOMBINE_PASS
|
|
#define SWIFT_SILCOMBINE_PASS(Inst)
|
|
#endif
|
|
|
|
/// PASS_RANGE(RANGE_ID, START, END)
|
|
/// Pass IDs between PassKind::START and PassKind::END, inclusive,
|
|
/// fall within the set known as
|
|
#ifndef PASS_RANGE
|
|
#define PASS_RANGE(Id, First, Last)
|
|
#endif
|
|
|
|
SWIFT_FUNCTION_PASS(AliasInfoDumper, "dump-alias-info",
|
|
"Dump Alias Analysis over all Pairs")
|
|
PASS(ABCOpt, "abcopts",
|
|
"Array Bounds Check Optimization")
|
|
PASS(AccessEnforcementDom, "access-enforcement-dom",
|
|
"Remove dominated access checks with no nested conflict")
|
|
PASS(AccessEnforcementOpts, "access-enforcement-opts",
|
|
"Access Enforcement Optimization")
|
|
PASS(AccessEnforcementReleaseSinking, "access-enforcement-release",
|
|
"Access Enforcement Release Sinking")
|
|
PASS(AccessEnforcementSelection, "access-enforcement-selection",
|
|
"Access Enforcement Selection")
|
|
PASS(AccessEnforcementWMO, "access-enforcement-wmo",
|
|
"Access Enforcement Whole Module Optimization")
|
|
PASS(AlwaysEmitConformanceMetadataPreservation, "preserve-always-emit-conformance-metadata",
|
|
"Mark conformances to @_alwaysEmitConformanceMetadata protocols as externally visible")
|
|
PASS(CrossModuleOptimization, "cmo",
|
|
"Perform cross-module optimization")
|
|
PASS(AccessSummaryDumper, "access-summary-dump",
|
|
"Dump Address Parameter Access Summary")
|
|
PASS(AccessStorageAnalysisDumper, "access-storage-analysis-dump",
|
|
"Dump Access Storage Analysis Summaries")
|
|
PASS(AccessPathVerification, "access-path-verification",
|
|
"Verify Access Paths (and Access Storage)")
|
|
PASS(AccessStorageDumper, "access-storage-dump",
|
|
"Dump Access Storage Information")
|
|
PASS(AccessMarkerElimination, "access-marker-elim",
|
|
"Access Marker Elimination.")
|
|
PASS(AddressLowering, "address-lowering",
|
|
"SIL Address Lowering")
|
|
PASS(AllocBoxToStack, "allocbox-to-stack",
|
|
"Stack Promotion of Box Objects")
|
|
IRGEN_PASS(AllocStackHoisting, "alloc-stack-hoisting",
|
|
"SIL alloc_stack Hoisting")
|
|
PASS(ArrayCountPropagation, "array-count-propagation",
|
|
"Array Count Propagation")
|
|
PASS(ArrayElementPropagation, "array-element-propagation",
|
|
"Array Element Propagation")
|
|
SWIFT_FUNCTION_PASS(AssumeSingleThreaded, "sil-assume-single-threaded",
|
|
"Assume Single-Threaded Environment")
|
|
SWIFT_MODULE_PASS(AsyncDemotion, "async-demotion",
|
|
"Convert async functions to be synchronous")
|
|
PASS(BasicInstructionPropertyDumper, "basic-instruction-property-dump",
|
|
"Print SIL Instruction MemBehavior and ReleaseBehavior Information")
|
|
PASS(BasicCalleePrinter, "basic-callee-printer",
|
|
"Print Basic Callee Analysis for Testing")
|
|
SWIFT_FUNCTION_PASS(BooleanLiteralFolding, "boolean-literal-folding",
|
|
"Constant folds initializers of boolean literals")
|
|
PASS(CFGPrinter, "view-cfg",
|
|
"View Function CFGs")
|
|
PASS(COWArrayOpts, "cowarray-opt",
|
|
"COW Array Optimization")
|
|
PASS(CSE, "cse",
|
|
"Common Subexpression Elimination")
|
|
PASS(CallerAnalysisPrinter, "caller-analysis-printer",
|
|
"Print Caller Analysis for Testing")
|
|
PASS(CapturePromotion, "capture-promotion",
|
|
"Capture Promotion to Eliminate Escaping Boxes")
|
|
PASS(CapturePropagation, "capture-prop",
|
|
"Captured Constant Propagation")
|
|
PASS(ClosureSpecializer, "closure-specialize",
|
|
"Closure Specialization on Constant Function Arguments")
|
|
|
|
// NOTE - ExperimentalSwiftBasedClosureSpecialization and AutodiffClosureSpecialization are a WIP
|
|
SWIFT_FUNCTION_PASS(ExperimentalSwiftBasedClosureSpecialization, "experimental-swift-based-closure-specialization",
|
|
"General closure-specialization pass written in Swift")
|
|
SWIFT_FUNCTION_PASS(AutodiffClosureSpecialization, "autodiff-closure-specialization",
|
|
"Autodiff specific closure-specialization pass")
|
|
|
|
PASS(ClosureLifetimeFixup, "closure-lifetime-fixup",
|
|
"Closure Lifetime Fixup")
|
|
PASS(CodeSinking, "code-sinking",
|
|
"Code Sinking")
|
|
PASS(ComputeDominanceInfo, "compute-dominance-info",
|
|
"Compute Dominance Information for Testing")
|
|
PASS(ComputeLoopInfo, "compute-loop-info",
|
|
"Compute Loop Information for Testing")
|
|
PASS(ConditionForwarding, "condition-forwarding",
|
|
"Conditional Branch Forwarding to Fold SIL switch_enum")
|
|
PASS(ConstantEvaluatorTester, "test-constant-evaluator",
|
|
"Test constant evaluator")
|
|
PASS(ConstantEvaluableSubsetChecker, "test-constant-evaluable-subset",
|
|
"Test Swift code snippets expected to be constant evaluable")
|
|
PASS(CopyForwarding, "copy-forwarding",
|
|
"Copy Forwarding to Remove Redundant Copies")
|
|
PASS(CopyPropagation, "copy-propagation",
|
|
"Copy propagation to Remove Redundant SSA Copies, pruning debug info")
|
|
PASS(MandatoryCopyPropagation, "mandatory-copy-propagation",
|
|
"Copy propagation to Remove Redundant SSA Copies, preserving debug info")
|
|
PASS(COWOpts, "cow-opts",
|
|
"Optimize COW operations")
|
|
PASS(Differentiation, "differentiation",
|
|
"Automatic Differentiation")
|
|
PASS(EpilogueARCMatcherDumper, "sil-epilogue-arc-dumper",
|
|
"Print Epilogue retains of Returned Values and Argument releases")
|
|
PASS(EpilogueRetainReleaseMatcherDumper, "sil-epilogue-retain-release-dumper",
|
|
"Print Epilogue retains of Returned Values and Argument releases")
|
|
PASS(RedundantOverflowCheckRemoval, "remove-redundant-overflow-checks",
|
|
"Redundant Overflow Check Removal")
|
|
PASS(DCE, "dce",
|
|
"Dead Code Elimination")
|
|
PASS(DeadArgSignatureOpt, "dead-arg-signature-opt",
|
|
"Dead Argument Elimination via Function Specialization")
|
|
PASS(DeadFunctionAndGlobalElimination, "sil-deadfuncelim",
|
|
"Dead Function and Global Variable Elimination")
|
|
PASS(DeadObjectElimination, "deadobject-elim",
|
|
"Dead Object Elimination for Classes with Trivial Destruction")
|
|
PASS(DefiniteInitialization, "definite-init",
|
|
"Definite Initialization for Diagnostics")
|
|
PASS(DestroyAddrHoisting, "destroy-addr-hoisting",
|
|
"Hoist destroy_addr for uniquely identified values")
|
|
PASS(Devirtualizer, "devirtualizer",
|
|
"Indirect Call Devirtualization")
|
|
PASS(DiagnoseInfiniteRecursion, "diagnose-infinite-recursion",
|
|
"Diagnose Infinitely-Recursive Code")
|
|
PASS(DiagnoseInvalidEscapingCaptures, "diagnose-invalid-escaping-captures",
|
|
"Diagnose Invalid Escaping Captures")
|
|
PASS(DiagnoseLifetimeIssues, "diagnose-lifetime-issues",
|
|
"Diagnose Lifetime Issues")
|
|
PASS(DiagnoseStaticExclusivity, "diagnose-static-exclusivity",
|
|
"Static Enforcement of Law of Exclusivity")
|
|
PASS(DiagnoseUnreachable, "diagnose-unreachable",
|
|
"Diagnose Unreachable Code")
|
|
PASS(DiagnosticConstantPropagation, "diagnostic-constant-propagation",
|
|
"Constants Propagation for Diagnostics")
|
|
PASS(DifferentiabilityWitnessDevirtualizer,
|
|
"differentiability-witness-devirtualizer",
|
|
"Inlines Differentiability Witnesses")
|
|
PASS(EagerSpecializer, "eager-specializer",
|
|
"Eager Specialization via @_specialize")
|
|
PASS(OnonePrespecializations, "onone-prespecializer",
|
|
"Pre specialization via @_specialize")
|
|
PASS(EarlyCodeMotion, "early-codemotion",
|
|
"Early Code Motion without Release Hoisting")
|
|
PASS(EarlyPerfInliner, "early-inline",
|
|
"Early Inlining Preserving Semantic Functions")
|
|
PASS(EmitDFDiagnostics, "dataflow-diagnostics",
|
|
"Emit SIL Diagnostics")
|
|
SWIFT_FUNCTION_PASS(DeadEndBlockDumper, "dump-deadendblocks",
|
|
"Tests the DeadEndBlocks utility")
|
|
SWIFT_FUNCTION_PASS(EscapeInfoDumper, "dump-escape-info",
|
|
"Dumps escape information")
|
|
SWIFT_FUNCTION_PASS(AddressEscapeInfoDumper, "dump-addr-escape-info",
|
|
"Dumps address escape information")
|
|
SWIFT_FUNCTION_PASS(AccessDumper, "dump-access",
|
|
"Dump access information")
|
|
SWIFT_FUNCTION_PASS(ComputeEscapeEffects, "compute-escape-effects",
|
|
"Computes function escape effects")
|
|
SWIFT_FUNCTION_PASS(ComputeSideEffects, "compute-side-effects",
|
|
"Computes function side effects")
|
|
SWIFT_FUNCTION_PASS(TestInstructionIteration, "test-instruction-iteration",
|
|
"Tests instruction iteration")
|
|
SWIFT_FUNCTION_PASS(InitializeStaticGlobals, "initialize-static-globals",
|
|
"Initializes static global variables")
|
|
PASS(FlowIsolation, "flow-isolation",
|
|
"Enforces flow-sensitive actor isolation rules")
|
|
PASS(FunctionOrderPrinter, "function-order-printer",
|
|
"Print Function Order for Testing")
|
|
PASS(FunctionSignatureOpts, "function-signature-opts",
|
|
"Function Signature Optimization")
|
|
SWIFT_FUNCTION_PASS(RangeDumper, "dump-ranges",
|
|
"Dumps block and instruction ranges")
|
|
PASS(ARCSequenceOpts, "arc-sequence-opts",
|
|
"ARC Sequence Optimization")
|
|
PASS(ARCLoopOpts, "arc-loop-opts",
|
|
"ARC Loop Optimization")
|
|
SWIFT_FUNCTION_PASS(EarlyRedundantLoadElimination, "early-redundant-load-elimination",
|
|
"Early Redundant Load Elimination")
|
|
SWIFT_FUNCTION_PASS(RedundantLoadElimination, "redundant-load-elimination",
|
|
"Redundant Load Elimination")
|
|
SWIFT_FUNCTION_PASS(DeadStoreElimination, "dead-store-elimination",
|
|
"Dead Store Elimination")
|
|
PASS(GenericSpecializer, "generic-specializer",
|
|
"Generic Function Specialization on Static Types")
|
|
PASS(VTableSpecializer, "vtable-specializer",
|
|
"Generic Specialization on VTables")
|
|
PASS(ExistentialSpecializer, "existential-specializer",
|
|
"Existential Specializer")
|
|
PASS(SILSkippingChecker, "check-sil-skipping",
|
|
"Utility pass to ensure -experimental-skip-*-function-bodies skip "
|
|
"SIL generation of not-to-be-serialized functions entirely")
|
|
PASS(GlobalPropertyOpt, "global-property-opt",
|
|
"Global Property Optimization")
|
|
PASS(MandatoryARCOpts, "mandatory-arc-opts",
|
|
"Mandatory ARC Optimization")
|
|
PASS(HighLevelCSE, "high-level-cse",
|
|
"Common Subexpression Elimination on High-Level SIL")
|
|
PASS(HighLevelLICM, "high-level-licm",
|
|
"Loop Invariant Code Motion in High-Level SIL")
|
|
PASS(IVInfoPrinter, "iv-info-printer",
|
|
"Print Induction Variable Information for Testing")
|
|
PASS(LowerHopToActor, "lower-hop-to-actor",
|
|
"Lower hop_to_executor instructions with actor operands")
|
|
PASS(OptimizeHopToExecutor, "optimize-hop-to-executor",
|
|
"Optimize hop_to_executor instructions for actor isolated code")
|
|
PASS(InstCount, "inst-count",
|
|
"Record SIL Instruction, Block, and Function Counts as LLVM Statistics")
|
|
PASS(JumpThreadSimplifyCFG, "jumpthread-simplify-cfg",
|
|
"Simplify CFG via Jump Threading")
|
|
PASS(LetPropertiesOpt, "let-properties-opt",
|
|
"Let Property Optimization")
|
|
PASS(LICM, "licm",
|
|
"Loop Invariant Code Motion")
|
|
PASS(LateCodeMotion, "late-codemotion",
|
|
"Late Code Motion with Release Hoisting")
|
|
PASS(LateDeadFunctionAndGlobalElimination, "late-deadfuncelim",
|
|
"Late Dead Function and Global Elimination")
|
|
SWIFT_FUNCTION_PASS(LifetimeDependenceDiagnostics,
|
|
"lifetime-dependence-diagnostics",
|
|
"Diagnose Lifetime Dependence")
|
|
SWIFT_FUNCTION_PASS(LifetimeDependenceInsertion,
|
|
"lifetime-dependence-insertion",
|
|
"Insert Lifetime Dependence Markers")
|
|
SWIFT_FUNCTION_PASS(LifetimeDependenceScopeFixup,
|
|
"lifetime-dependence-scope-fixup",
|
|
"Fixup scope for lifetime dependence")
|
|
PASS(LoopCanonicalizer, "loop-canonicalizer",
|
|
"Loop Canonicalization")
|
|
PASS(LoopInfoPrinter, "loop-info-printer",
|
|
"Print Loop Information for Testing")
|
|
PASS(LoopRegionViewText, "loop-region-view-text",
|
|
"Print Loop Region Information for Testing")
|
|
PASS(LoopRegionViewCFG, "loop-region-view-cfg",
|
|
"View Loop Region CFG")
|
|
PASS(LoopRotate, "loop-rotate",
|
|
"Loop Rotation")
|
|
PASS(LoopUnroll, "loop-unroll",
|
|
"Loop Unrolling")
|
|
PASS(LowerAggregateInstrs, "lower-aggregate-instrs",
|
|
"Lower Aggregate SIL Instructions to Multiple Scalar Operations")
|
|
PASS(MandatoryInlining, "mandatory-inlining",
|
|
"Mandatory Inlining of Transparent Functions")
|
|
PASS(Mem2Reg, "mem2reg",
|
|
"Memory to SSA Value Conversion to Remove Stack Allocation")
|
|
SWIFT_FUNCTION_PASS(MemBehaviorDumper, "dump-mem-behavior",
|
|
"Print SIL Instruction MemBehavior from Alias Analysis over all Pairs")
|
|
SWIFT_FUNCTION_PASS(MergeCondFails, "merge-cond_fails",
|
|
"Merge SIL cond_fail to Eliminate Redundant Overflow Checks")
|
|
PASS(MoveCondFailToPreds, "move-cond-fail-to-preds",
|
|
"Move SIL cond_fail by Hoisting Checks")
|
|
PASS(NoReturnFolding, "noreturn-folding",
|
|
"Prune Control Flow at No-Return Calls Using SIL unreachable")
|
|
SWIFT_FUNCTION_PASS(ObjCBridgingOptimization, "objc-bridging-opt",
|
|
"Optimize ObjectiveC bridging operations")
|
|
SWIFT_FUNCTION_PASS(ObjectOutliner, "object-outliner",
|
|
"Outlining of Global Objects")
|
|
PASS(Outliner, "outliner",
|
|
"Function Outlining Optimization")
|
|
PASS(OwnershipModelEliminator, "ownership-model-eliminator",
|
|
"Eliminate Ownership Annotation of SIL")
|
|
PASS(ModulePrinter, "module-printer",
|
|
"Print the module")
|
|
PASS(NestedSemanticFunctionCheck, "nested-semantic-function-check",
|
|
"Diagnose improperly nested '@_semantics' functions")
|
|
PASS(NonTransparentFunctionOwnershipModelEliminator,
|
|
"non-transparent-func-ownership-model-eliminator",
|
|
"Eliminate Ownership Annotations from non-transparent SIL Functions")
|
|
PASS(RCIdentityDumper, "rc-id-dumper",
|
|
"Print Reference Count Identities")
|
|
PASS(AlwaysInlineInliner, "always-inline",
|
|
"Inline always inline functions")
|
|
PASS(PerfInliner, "inline",
|
|
"Performance Function Inlining")
|
|
PASS(PerformanceConstantPropagation, "performance-constant-propagation",
|
|
"Constant Propagation for Performance without Diagnostics")
|
|
PASS(PerformanceDiagnostics, "performance-diagnostics",
|
|
"Constant Propagation for Performance without Diagnostics")
|
|
PASS(PredictableMemoryAccessOptimizations, "predictable-memaccess-opts",
|
|
"Predictable Memory Access Optimizations for Diagnostics")
|
|
PASS(PredictableDeadAllocationElimination, "predictable-deadalloc-elim",
|
|
"Eliminate dead temporary allocations after diagnostics")
|
|
PASS(RedundantPhiElimination, "redundant-phi-elimination",
|
|
"Redundant Phi Block Argument Elimination")
|
|
PASS(PhiExpansion, "phi-expansion",
|
|
"Replace Phi arguments by their only used field")
|
|
SWIFT_FUNCTION_PASS(DeinitDevirtualizer, "deinit-devirtualizer",
|
|
"Devirtualizes destroys of non-copyable values")
|
|
SWIFT_FUNCTION_PASS(ReleaseDevirtualizer, "release-devirtualizer",
|
|
"SIL release Devirtualization")
|
|
PASS(RetainSinking, "retain-sinking",
|
|
"SIL retain Sinking")
|
|
PASS(ReleaseHoisting, "release-hoisting",
|
|
"SIL release Hoisting")
|
|
PASS(LateReleaseHoisting, "late-release-hoisting",
|
|
"Late SIL release Hoisting Preserving Epilogues")
|
|
IRGEN_PASS(LoadableByAddress, "loadable-address",
|
|
"SIL Large Loadable type by-address lowering.")
|
|
PASS(MandatorySILLinker, "mandatory-linker",
|
|
"Deserialize all referenced SIL functions that are shared or transparent")
|
|
IRGEN_PASS(PackMetadataMarkerInserter, "pack-metadata-marker-inserter",
|
|
"Insert markers where pack metadata might be de/allocated.")
|
|
PASS(PerformanceSILLinker, "performance-linker",
|
|
"Deserialize all referenced SIL functions")
|
|
SWIFT_FUNCTION_PASS(LetPropertyLowering, "let-property-lowering",
|
|
"Lowers accesses to let properties of classes")
|
|
PASS(RawSILInstLowering, "raw-sil-inst-lowering",
|
|
"Lower all raw SIL instructions to canonical equivalents.")
|
|
PASS(TempLValueOpt, "temp-lvalue-opt",
|
|
"Remove short-lived immutable temporary l-values")
|
|
PASS(TempRValueOpt, "temp-rvalue-opt",
|
|
"Remove short-lived immutable temporary copies")
|
|
PASS(IRGenPrepare, "irgen-prepare",
|
|
"Cleanup SIL in preparation for IRGen")
|
|
PASS(TransferNonSendable, "transfer-non-sendable",
|
|
"Checks calls that send non-sendable values between isolation domains")
|
|
PASS(LowerTupleAddrConstructor, "lower-tuple-addr-constructor",
|
|
"Lower tuple addr constructor to tuple_element_addr+copy_addr")
|
|
PASS(SILGenCleanup, "silgen-cleanup",
|
|
"Cleanup SIL in preparation for diagnostics")
|
|
PASS(SILCombine, "sil-combine",
|
|
"Combine SIL Instructions via Peephole Optimization")
|
|
PASS(SILDebugInfoGenerator, "sil-debuginfo-gen",
|
|
"Generate Debug Information with Source Locations into Textual SIL")
|
|
PASS(EarlySROA, "early-sroa",
|
|
"Scalar Replacement of Aggregate Stack Objects on high-level SIL")
|
|
SWIFT_MODULE_PASS(RunUnitTests, "run-unit-tests",
|
|
"Runs the compiler internal unit tests")
|
|
SWIFT_FUNCTION_PASS(SILPrinter, "sil-printer",
|
|
"Test pass which prints the SIL of a function")
|
|
SWIFT_MODULE_PASS(FunctionUsesDumper, "dump-function-uses",
|
|
"Dump the results of FunctionUses")
|
|
SWIFT_MODULE_PASS(MandatoryPerformanceOptimizations, "mandatory-performance-optimizations",
|
|
"Performs optimizations for performance-annotated functions")
|
|
SWIFT_MODULE_PASS(ReadOnlyGlobalVariablesPass, "read-only-global-variables",
|
|
"Converts read-only var-globals to let-globals")
|
|
SWIFT_MODULE_PASS(StackProtection, "stack-protection",
|
|
"Decides which functions need stack protectors")
|
|
SWIFT_FUNCTION_PASS(FunctionStackProtection, "function-stack-protection",
|
|
"Decides which functions need stack protectors")
|
|
PASS(SROA, "sroa",
|
|
"Scalar Replacement of Aggregate Stack Objects")
|
|
PASS(SROABBArgs, "sroa-bb-args",
|
|
"Scalar Replacement of Aggregate SIL Block Arguments")
|
|
SWIFT_FUNCTION_PASS(Simplification, "simplification",
|
|
"Peephole simplifications")
|
|
SWIFT_FUNCTION_PASS(OnoneSimplification, "onone-simplification",
|
|
"Peephole simplifications which runs at -Onone")
|
|
SWIFT_FUNCTION_PASS(LateOnoneSimplification, "late-onone-simplification",
|
|
"Peephole simplifications which can only run late in the -Onone pipeline")
|
|
SWIFT_FUNCTION_PASS(CleanupDebugSteps, "cleanup-debug-steps",
|
|
"Cleanup debug_step instructions for Onone")
|
|
SWIFT_FUNCTION_PASS(NamedReturnValueOptimization, "named-return-value-optimization",
|
|
"Optimize copies to an indirect return value")
|
|
SWIFT_FUNCTION_PASS(StripObjectHeaders, "strip-object-headers",
|
|
"Sets the bare flag on objects which don't need their headers")
|
|
SWIFT_FUNCTION_PASS(AllocVectorLowering, "alloc-vector-lowering",
|
|
"lowering of allocVector builtins")
|
|
PASS(SimplifyBBArgs, "simplify-bb-args",
|
|
"SIL Block Argument Simplification")
|
|
PASS(SimplifyCFG, "simplify-cfg",
|
|
"SIL CFG Simplification")
|
|
PASS(SpeculativeDevirtualization, "specdevirt",
|
|
"Speculative Devirtualization via Guarded Calls")
|
|
PASS(SplitAllCriticalEdges, "split-critical-edges",
|
|
"Split all Critical Edges in the SIL CFG")
|
|
PASS(SplitNonCondBrCriticalEdges, "split-non-cond_br-critical-edges",
|
|
"Split all Critical Edges not from SIL cond_br")
|
|
SWIFT_FUNCTION_PASS(StackPromotion, "stack-promotion",
|
|
"Stack Promotion of Class Objects")
|
|
PASS(StripDebugInfo, "strip-debug-info",
|
|
"Strip Debug Information")
|
|
PASS(StringOptimization, "string-optimization",
|
|
"Optimization for String operations")
|
|
PASS(SwiftArrayPropertyOpt, "array-property-opt",
|
|
"Loop Specialization for Array Properties")
|
|
PASS(UsePrespecialized, "use-prespecialized",
|
|
"Use Pre-Specialized Functions")
|
|
PASS(OwnershipDumper, "ownership-dumper",
|
|
"Print Ownership information for Testing")
|
|
PASS(OwnershipVerifierTextualErrorDumper, "ownership-verifier-textual-error-dumper",
|
|
"Run ownership verification on all functions, emitting FileCheck-able textual errors instead of asserting")
|
|
PASS(SemanticARCOpts, "semantic-arc-opts",
|
|
"Semantic ARC Optimization")
|
|
PASS(SimplifyUnreachableContainingBlocks, "simplify-unreachable-containing-blocks",
|
|
"Utility pass. Removes all non-term insts from blocks with unreachable terms")
|
|
PASS(SerializeSILPass, "serialize-sil",
|
|
"Utility pass. Serializes the current SILModule")
|
|
PASS(UnitTestRunner, "test-runner",
|
|
"Utility pass. Parses arguments and runs code with them.")
|
|
PASS(YieldOnceCheck, "yield-once-check",
|
|
"Check correct usage of yields in yield-once coroutines")
|
|
PASS(OSLogOptimization, "os-log-optimization", "Optimize os log calls")
|
|
PASS(ForEachLoopUnroll, "for-each-loop-unroll",
|
|
"Unroll forEach loops over array literals")
|
|
PASS(BugReducerTester, "bug-reducer-tester",
|
|
"sil-bug-reducer Tool Testing by Asserting on a Sentinel Function")
|
|
PASS(AssemblyVisionRemarkGenerator, "assembly-vision-remark-generator",
|
|
"Emit assembly vision remarks that provide source level guidance of where runtime calls ended up")
|
|
PASS(MoveOnlyObjectChecker, "sil-move-only-object-checker",
|
|
"Utility pass that enforces move only invariants on raw SIL for objects for testing purposes")
|
|
PASS(MoveOnlyAddressChecker, "sil-move-only-address-checker",
|
|
"Utility pass that enforces move only invariants on raw SIL for addresses for testing purposes")
|
|
PASS(MoveOnlyChecker, "sil-move-only-checker",
|
|
"Pass that enforces move only invariants on raw SIL for addresses and objects")
|
|
PASS(MoveOnlyTempAllocationFromLetTester, "sil-move-only-temp-allocation-from-let-tester",
|
|
"Pass that allows us to run separately SIL test cases for the eliminateTemporaryAllocationsFromLet utility")
|
|
PASS(ConsumeOperatorCopyableValuesChecker, "sil-consume-operator-copyable-values-checker",
|
|
"Pass that performs checking of the consume operator for copyable values")
|
|
PASS(TrivialMoveOnlyTypeEliminator, "sil-trivial-move-only-type-eliminator",
|
|
"Pass that rewrites SIL to remove move only types from values of trivial type")
|
|
PASS(MoveOnlyTypeEliminator, "sil-move-only-type-eliminator",
|
|
"Pass that rewrites SIL to remove move only types from all values")
|
|
PASS(LexicalLifetimeEliminator, "sil-lexical-lifetime-eliminator",
|
|
"Pass that removes lexical lifetime markers from borrows and alloc stack")
|
|
PASS(ConsumeOperatorCopyableAddressesChecker, "sil-consume-operator-copyable-addresses-checker",
|
|
"Pass that performs consume operator checking for copyable addresses")
|
|
PASS(DebugInfoCanonicalizer, "sil-onone-debuginfo-canonicalizer",
|
|
"Canonicalize debug info at -Onone by propagating debug info into coroutine funclets")
|
|
PASS(PartialApplySimplification, "partial-apply-simplification",
|
|
"Transform partial_apply instructions into explicit closure box constructions")
|
|
PASS(RegionAnalysisInvalidationTransform, "region-analysis-invalidation-transform",
|
|
"Delete the analysis state associated with region analysis")
|
|
PASS(MovedAsyncVarDebugInfoPropagator, "sil-moved-async-var-dbginfo-propagator",
|
|
"Propagate debug info from moved async vars after coroutine funclet boundaries")
|
|
PASS(MoveOnlyBorrowToDestructureTransform,
|
|
"sil-move-only-borrow-to-destructure",
|
|
"Pass that is phased ordered before move only object checking that is "
|
|
"used to convert borrow+projection to destructures. Once this has run, the move "
|
|
"only object checker runs and ensures that the destructures do not create "
|
|
"any move only errors with respect to non-borrow+projection uses")
|
|
PASS(ReferenceBindingTransform, "sil-reference-binding-transform",
|
|
"Check/transform reference bindings")
|
|
PASS(DiagnosticDeadFunctionElimination, "sil-diagnostic-dead-function-elim",
|
|
"Eliminate dead functions from early specialization optimizations before we run later diagnostics")
|
|
SWIFT_FUNCTION_PASS(UpdateBorrowedFrom, "update-borrowed-from",
|
|
"Test pass for update borrowed-from instructions")
|
|
PASS(DiagnoseUnnecessaryPreconcurrencyImports, "sil-diagnose-unnecessary-preconcurrency-imports",
|
|
"Diagnose any preconcurrency imports that Sema and TransferNonSendable did not use")
|
|
PASS(PruneVTables, "prune-vtables",
|
|
"Mark class methods that do not require vtable dispatch")
|
|
PASS_RANGE(AllPasses, AliasInfoDumper, PruneVTables)
|
|
|
|
SWIFT_SILCOMBINE_PASS(BeginCOWMutationInst)
|
|
SWIFT_SILCOMBINE_PASS(GlobalValueInst)
|
|
SWIFT_SILCOMBINE_PASS(StrongRetainInst)
|
|
SWIFT_SILCOMBINE_PASS(StrongReleaseInst)
|
|
SWIFT_SILCOMBINE_PASS(RetainValueInst)
|
|
SWIFT_SILCOMBINE_PASS(ReleaseValueInst)
|
|
SWIFT_SILCOMBINE_PASS(LoadInst)
|
|
SWIFT_SILCOMBINE_PASS(CopyValueInst)
|
|
SWIFT_SILCOMBINE_PASS(DestroyValueInst)
|
|
SWIFT_SILCOMBINE_PASS(DestructureStructInst)
|
|
SWIFT_SILCOMBINE_PASS(DestructureTupleInst)
|
|
SWIFT_SILCOMBINE_PASS(TypeValueInst)
|
|
|
|
#undef IRGEN_PASS
|
|
#undef SWIFT_MODULE_PASS
|
|
#undef SWIFT_FUNCTION_PASS
|
|
#undef SWIFT_SILCOMBINE_PASS
|
|
#undef PASS
|
|
#undef PASS_RANGE
|