@@ -5205,6 +5205,36 @@ independent of the operand. In terms of specific types:
52055205In ownership qualified functions, a ``copy_value `` produces a +1 value that must
52065206be consumed at most once along any path through the program.
52075207
5208+ explicit_copy_value
5209+ ```````````````````
5210+
5211+ ::
5212+
5213+ sil-instruction ::= 'explicit_copy_value' sil-operand
5214+
5215+ %1 = explicit_copy_value %0 : $A
5216+
5217+ Performs a copy of a loadable value as if by the value's type lowering and
5218+ returns the copy. The returned copy semantically is a value that is completely
5219+ independent of the operand. In terms of specific types:
5220+
5221+ 1. For trivial types, this is equivalent to just propagating through the trivial
5222+ value.
5223+ 2. For reference types, this is equivalent to performing a ``strong_retain ``
5224+ operation and returning the reference.
5225+ 3. For ``@unowned `` types, this is equivalent to performing an
5226+ ``unowned_retain `` and returning the operand.
5227+ 4. For aggregate types, this is equivalent to recursively performing a
5228+ ``copy_value `` on its components, forming a new aggregate from the copied
5229+ components, and then returning the new aggregate.
5230+
5231+ In ownership qualified functions, a ``explicit_copy_value `` produces a +1 value
5232+ that must be consumed at most once along any path through the program.
5233+
5234+ When move only variable checking is performed, ``explicit_copy_value `` is
5235+ treated as an explicit copy asked for by the user that should not be rewritten
5236+ and should be treated as a non-consuming use.
5237+
52085238move_value
52095239``````````
52105240
0 commit comments