low.copy
← low dialect
Explicit virtual-register copy used by lowering and allocation. Each copy produces a fresh virtual-register identity and may constrain the result to a different target register class with the same unit count and semantic value type. The result copies the source ownership mode without consuming it: an owner creates an independent owner, while a borrow remains borrowed. Managed copies cannot share their physical carrier while both lifetimes remain live.
Operation contract
| Property |
Value |
| Semantic phase |
executable |
| Traits |
StorageRelation |
| Ownership effects |
copied result from source |
Signature
| Kind |
Name |
Type |
Cardinality |
Description |
| Operand |
source |
register |
required |
— |
| Result |
result |
register |
required |
— Produces a fresh allocation. |
| Attribute |
detached |
bool |
default False |
Prefer physical storage disjoint from the copy source. This placement preference does not require a materialized copy when allocation reuses the source storage. |
Examples
%copy = low.copy %value : reg<amdgpu.vgpr x1> -> reg<amdgpu.vgpr x1>