Files
swift-mirror/SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/CMakeLists.txt
Erik Eckstein 46035305aa Optimizer: improve simplification of alloc_stack
* Reimplement most of the logic in Swift as an Instruction simplification and remove the old code from SILCombine
* support more cases of existential archetype replacements:

For example:
```
  %0 = alloc_stack $any P
  %1 = init_existential_addr %0, $T
  use %1
```
is transformed to
```
  %0 = alloc_stack $T
  use %0
```

Also, if the alloc_stack is already an opened existential and the concrete type is known,
replace it as well:
```
  %0 = metatype $@thick T.Type
  %1 = init_existential_metatype %0, $@thick any P.Type
  %2 = open_existential_metatype %1 : $@thick any P.Type to $@thick (@opened("X", P) Self).Type
  ...
  %3 = alloc_stack $@opened("X", any P) Self
  use %3
```
is transformed to
```
  ...
  %3 = alloc_stack $T
  use %3
```
2025-03-07 15:59:34 +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
SimplifyAllocRefDynamic.swift
SimplifyAllocStack.swift
SimplifyApply.swift
SimplifyBeginAndLoadBorrow.swift
SimplifyBeginCOWMutation.swift
SimplifyBranch.swift
SimplifyBuiltin.swift
SimplifyCheckedCast.swift
SimplifyClassifyBridgeObject.swift
SimplifyCondBranch.swift
SimplifyCondFail.swift
SimplifyConvertEscapeToNoEscape.swift
SimplifyCopyValue.swift
SimplifyDebugStep.swift
SimplifyDestroyValue.swift
SimplifyDestructure.swift
SimplifyFixLifetime.swift
SimplifyGlobalValue.swift
SimplifyInitEnumDataAddr.swift
SimplifyKeyPath.swift
SimplifyLoad.swift
SimplifyMisc.swift
SimplifyPartialApply.swift
SimplifyPointerToAddress.swift
SimplifyRefCasts.swift
SimplifyRetainReleaseValue.swift
SimplifyStrongRetainRelease.swift
SimplifyStructExtract.swift
SimplifySwitchEnum.swift
SimplifyTuple.swift
SimplifyTupleExtract.swift
SimplifyUncheckedEnumData.swift
SimplifyValueToBridgeObject.swift
SimplifyWitnessMethod.swift)