Skip to content

Conversation

@eeckstein
Copy link
Contributor

  • Explanation: Fixes a SIL verifier crash caused by a wrong peephole optimization in SILCombine. The optimization sinks forwarding instructions down the control flow. However, we don't do memory lifetime analysis for this peephole optimization. Therefore we can't risk sinking instructions with address operands out of the addressed memory's lifetime.
  • Risk: Low. It's a simple change which makes the peephole optimization more conservative
  • Testing: Tested by a lit test.
  • Issue: rdar://166240751
  • Reviewer: @atrick
  • Main branch PR: SILCombine: don't sink forwarding instructions with address operands #86005

We don't do memory lifetime analysis for this peephole optimization.
Therefore we can't risk sinking instructions with address operands out of the addressed memory's lifetime.

For example:
```
  %3 = mark_dependence %2 on %1 : $*T  // must not be moved after the destroy_addr
  destroy_addr %1
```

Fixes a verifier crash
rdar://166240751
@eeckstein eeckstein requested a review from a team as a code owner December 15, 2025 07:56
@eeckstein eeckstein requested a review from atrick December 15, 2025 07:56
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein eeckstein merged commit e0e0521 into swiftlang:release/6.3 Dec 16, 2025
5 checks passed
@eeckstein eeckstein deleted the fix-silcombine-6.3 branch December 16, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants