Files
swift-mirror/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/CMakeLists.txt
Erik Eckstein 62786b01e2 Optimizer: add the mandatory destroy hoisting pass
It hoists `destroy_value` instructions for non-lexical values.

```
  %1 = some_ownedValue
  ...
  last_use(%1)
  ... // other instructions
  destroy_value %1
```
->
```
  %1 = some_ownedValue
  ...
  last_use(%1)
  destroy_value %1    // <- moved after the last use
  ... // other instructions
```

In contrast to non-mandatory optimization passes, this is the only pass which hoists destroys over deinit-barriers.
This ensures consistent behavior in -Onone and optimized builds.
2025-11-06 21:00:44 +01:00

44 lines
1.3 KiB
CMake

# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
swift_compiler_sources(Optimizer
AllocBoxToStack.swift
AssumeSingleThreaded.swift
AsyncDemotion.swift
BooleanLiteralFolding.swift
ConstantCapturePropagation.swift
CleanupDebugSteps.swift
ClosureSpecialization.swift
ComputeEscapeEffects.swift
ComputeSideEffects.swift
CopyToBorrowOptimization.swift
DeadStoreElimination.swift
DeinitDevirtualizer.swift
DestroyHoisting.swift
DiagnoseInfiniteRecursion.swift
InitializeStaticGlobals.swift
LetPropertyLowering.swift
LifetimeDependenceDiagnostics.swift
LifetimeDependenceInsertion.swift
LifetimeDependenceScopeFixup.swift
LoopInvariantCodeMotion.swift
ObjectOutliner.swift
ObjCBridgingOptimization.swift
MandatoryDestroyHoisting.swift
MergeCondFails.swift
NamedReturnValueOptimization.swift
RedundantLoadElimination.swift
ReleaseDevirtualizer.swift
SimplificationPasses.swift
StackPromotion.swift
StripObjectHeaders.swift
TempLValueElimination.swift
TempRValueElimination.swift
PackSpecialization.swift
)