swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.6k stars 10.37k forks source link

ArrayElementValuePropagation: require that the initialization and element-get are in the same block for non-trivial values. #77610

Closed eeckstein closed 1 day ago

eeckstein commented 2 days ago

In OSSA we only insert a copy_value of the element at the array initialization point. This would result in an over-consume if the getElement is in a loop. Therefore require that both semantic calls are in the same block.

Fixes an ownership verifier crash when OSSA modules are enabled.

eeckstein commented 2 days ago

@swift-ci test

eeckstein commented 2 days ago

@swift-ci benchmark

eeckstein commented 2 days ago

@swift-ci test