@@ -5503,24 +5503,35 @@ mark_dependence
5503
5503
5504
5504
::
5505
5505
5506
- sil-instruction :: 'mark_dependence' sil-operand 'on' sil-operand
5507
-
5508
- %2 = mark_dependence %0 : $*T on %1 : $Builtin.NativeObject
5509
-
5510
- Indicates that the validity of the first operand depends on the value
5511
- of the second operand. Operations that would destroy the second value
5512
- must not be moved before any instructions which depend on the result
5513
- of this instruction, exactly as if the address had been obviously
5514
- derived from that operand (e.g. using ``ref_element_addr ``).
5515
-
5516
- The result is always equal to the first operand. The first operand
5517
- will typically be an address, but it could be an address in a
5518
- non-obvious form, such as a Builtin.RawPointer or a struct containing
5519
- the same. Transformations should be somewhat forgiving here.
5520
-
5521
- The second operand may have either object or address type. In the
5522
- latter case, the dependency is on the current value stored in the
5523
- address.
5506
+ sil-instruction :: 'mark_dependence' '[nonescaping]'? sil-operand 'on' sil-operand
5507
+
5508
+ %2 = mark_dependence %value : $*T on %base : $Builtin.NativeObject
5509
+
5510
+ Indicates that the validity of ``%value `` depends on the value of
5511
+ ``%base ``. Operations that would destroy ``%base `` must not be moved
5512
+ before any instructions which depend on the result of this
5513
+ instruction, exactly as if the address had been directly derived from
5514
+ that operand (e.g. using ``ref_element_addr ``).
5515
+
5516
+ The result is the forwarded value of ``%value ``. ``%value `` may be an
5517
+ address, but it could be an address in a non-obvious form, such as a
5518
+ Builtin.RawPointer or a struct containing the same.
5519
+
5520
+ ``%base `` may have either object or address type. In the latter case,
5521
+ the dependency is on the current value stored in the address.
5522
+
5523
+ The optional ``nonescaping `` attribute indicates that no value derived
5524
+ from ``%value `` escapes the lifetime of ``%base ``. As with escaping
5525
+ ``mark_dependence ``, all values transitively forwarded from ``%value ``
5526
+ must be destroyed within the lifetime of ``%base ``. Unlike escaping
5527
+ ``mark_dependence ``, this must be statically verifiable. Additionally,
5528
+ unlike escaping ``mark_dependence ``, derived values include copies of
5529
+ ``%value `` and values transitively forwarded from those copies. If
5530
+ ``%base `` is identical to ``%value `` this simply means that copies of
5531
+ ``%value `` do not outlive the original OSSA lifetime of
5532
+ ``%value ``. Furthermore, unlike escaping ``mark_dependence ``, no value
5533
+ derived from ``%value `` may have a bitwise escape (conversion to
5534
+ UnsafePointer) or pointer escape (unknown use).
5524
5535
5525
5536
is_unique
5526
5537
`````````
0 commit comments