Skip to content

view.load

← view dialect

Load one element from a typed view at a full-rank logical index. The index list is expressed in view coordinates and must name one position per view axis. Reference elements copy the complete handle state into an independent result; owning references acquire an owner and pointers preserve borrowing or its necessary protection.

Operation contract

Property Value
Semantic phase executable
Interfaces CachePolicy, MemoryAccess
Memory effects read view

Signature

Kind Name Type Cardinality Description
Operand view view required Typed source view.
Operand indices index variadic Dynamic logical element indices.
Result result any required Loaded element with its exact reference or scalar type.
Attribute memory_flags flags MemoryAccessFlags optional —
Attribute cache_scope enum CacheScope optional Optional cache/coherency scope required by target lowering.
Attribute cache_temporal enum CacheTemporal optional Optional temporal cache policy required by target lowering.
Attribute static_indices i64_array required Static logical element indices with INT64_MIN sentinels for dynamics.

Verification constraints

  • SameElementType(view, result)

Examples

%x = view.load %view[%row, %col] : view<[%M]x[%N]xf32, %layout> -> f32
%flag = view.load<volatile> %mailbox[%index] : view<16xi32> -> i32