mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Canonicalize a `fix_lifetime` from an address to a `load` + `fix_lifetime`: ``` %1 = alloc_stack $T ... fix_lifetime %1 ``` -> ``` %1 = alloc_stack $T ... %2 = load %1 fix_lifetime %2 ``` This transformation is done for `alloc_stack` and `store_borrow` (which always has an `alloc_stack` operand). The benefit of this transformation is that it enables other optimizations, like mem2reg. This peephole optimization was already done in SILCombine, but it didn't handle store_borrow. A good opportunity to make an instruction simplification out of it. This is part of fixing regressions when enabling OSSA modules: rdar://140229560
42 lines
1.3 KiB
CMake
42 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
|
|
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)
|