Skip to content

view.duplicate

← view dialect

Create another local owner of a view and the dynamic dimensions and encoding referenced by its type. The duplicate addresses the same storage while retaining a distinct SSA ownership identity.

Operation contract

Property Value
Semantic phase executable
Traits UniqueIdentity, StorageRelation
Interfaces ValueDuplication

Signature

Kind Name Type Cardinality Description
Operand sources any variadic —
Result duplicates any variadic —

Verification constraints

  • ClosedValueTuple(sources)
  • ClosedValueTuple(duplicates)
  • VariadicValuesMatch(duplicates, sources)

Examples

%copy = view.duplicate %source : view<4xf32>
%copy_n, %copy_layout, %copy = view.duplicate %n, %layout, %source : index, encoding<layout>, view<[%copy_n]xf32, %copy_layout>