Skip to content

vector.load.mask

vector dialect

Masked vector load from a typed view. Mask lanes with true values perform the same access as vector.load, while false lanes do not access memory and instead take the corresponding passthrough lane.

Operation contract

Property Value
Semantic phase
Interfaces MemoryAccess
Memory effects read view

Signature

Kind Name Type Cardinality Description
Operand view view required Typed source view.
Operand mask vector required i1 vector mask selecting loaded lanes.
Operand passthrough vector required Value used for masked-off lanes.
Operand indices index variadic Dynamic logical origin indices.
Result result vector required Loaded vector value.
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 origin indices with INT64_MIN sentinels for dynamics.

Verification constraints

  • HasI1Element(mask)
  • SameElementType(view, passthrough, result)
  • SameShape(mask, passthrough, result)
  • SameType(passthrough, result)

Examples

%v = vector.load.mask %view[%row, %col], %mask, %old : view<[%m]x[%n]xf32, %layout>, vector<4x8xi1>, vector<4x8xf32>