Skip to content

Commit 353bef7

Browse files
committed
Fix DestroyHoisting to visit all interior uses.
Set the visitInnerUses flag. This is only a quick, partial fix. InteriorUseWalker does not generate complete liveness for two reasons 1. pointer escapes. The client must always check for escapes before assuming complete liveness. 2. dead end blocks. Until we have complete OSSA lifetimes, the algorithm for handling nested borrows is incorrect. The visitInnerUses flag works around this problem, but it isn't well tested and I'm not sure it's properly records escapes yet.
1 parent 38137c5 commit 353bef7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/DestroyHoisting.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ private extension InstructionRange {
180180
init(withLiverangeOf initialDef: Value, ignoring ignoreDestroys: InstructionSet, _ context: FunctionPassContext)
181181
{
182182
var liverange = InstructionRange(for: initialDef, context)
183-
var visitor = InteriorUseWalker(definingValue: initialDef, ignoreEscape: true, visitInnerUses: false, context) {
183+
var visitor = InteriorUseWalker(definingValue: initialDef, ignoreEscape: true, visitInnerUses: true, context) {
184184
if !ignoreDestroys.contains($0.instruction) {
185185
liverange.insert($0.instruction)
186186
}

0 commit comments

Comments
 (0)