Skip to content

Optimizer: add an optimization to remove copy_value of a borrowed value. #78068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ struct InstructionRange : CustomStringConvertible, NoReflectionChildren {
self.inExclusiveRange.insert(beginInst)
}

init<S: Sequence>(begin beginInst: Instruction, ends: S, _ context: some Context) where S.Element: Instruction {
self = InstructionRange(begin: beginInst, context)
insert(contentsOf: ends)
}

init(for value: Value, _ context: some Context) {
self = InstructionRange(begin: InstructionRange.beginningInstruction(for: value), context)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ swift_compiler_sources(Optimizer
ClosureSpecialization.swift
ComputeEscapeEffects.swift
ComputeSideEffects.swift
CopyToBorrowOptimization.swift
DeadStoreElimination.swift
DeinitDevirtualizer.swift
InitializeStaticGlobals.swift
LetPropertyLowering.swift
LifetimeDependenceDiagnostics.swift
LifetimeDependenceInsertion.swift
LifetimeDependenceScopeFixup.swift
LoadCopyToBorrowOptimization.swift
ObjectOutliner.swift
ObjCBridgingOptimization.swift
MergeCondFails.swift
Expand Down
Loading