[SR-8621] SILGen creates destroys for tuple assignment at the wrong places #51136
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
performance
SILGen
Area → compiler: The SIL generation stage
Attachment: Download
Additional Detail from JIRA
md5: 6c4169f4697030be7a66f80eb6fc2a20
Issue Description:
Removing array pinning (#18922 exposes a performance problem caused by SILGen.
Consider this code where two array elements are assigned in the same statement.
The generated SIL looks like this:
The accesses are not overlapping, but the lifetimes of the owners are. This triggers a unnecessary copy-on-write.
The destroys to be emitted at the same place as the end_accesses.
See the attached SIL file for a full version.
This problem is exposed by the Prims and PrimsSplit and probably also by the Array2D benchmarks.
The text was updated successfully, but these errors were encountered: