Skip to content

Commit 789f657

Browse files
authored
Merge pull request swiftlang#81717 from eeckstein/fix-dse
DeadStoreElimination: don't assume that the operand of an `dealloc_stack` is an `alloc_stack`.
2 parents 6d85ef5 + b760ab0 commit 789f657

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/DeadStoreElimination.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ private extension Deallocation {
256256

257257
private extension DeallocStackInst {
258258
func isStackDeallocation(of base: AccessBase) -> Bool {
259-
if case .stack(let allocStack) = base, allocstack == allocStack {
259+
if case .stack(let allocStack) = base, operand.value == allocStack {
260260
return true
261261
}
262262
return false

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -647,11 +647,7 @@ extension Deallocation {
647647
}
648648

649649

650-
final public class DeallocStackInst : Instruction, UnaryInstruction, Deallocation {
651-
public var allocstack: AllocStackInst {
652-
return operand.value as! AllocStackInst
653-
}
654-
}
650+
final public class DeallocStackInst : Instruction, UnaryInstruction, Deallocation {}
655651

656652
final public class DeallocStackRefInst : Instruction, UnaryInstruction, Deallocation {
657653
public var allocRef: AllocRefInstBase { operand.value as! AllocRefInstBase }

0 commit comments

Comments
 (0)