vector.slice
← vector dialect
Extract a rank-preserving contiguous register subvector at explicit offsets. The offset list has one entry per source axis; each result axis extent describes how many lanes are kept from that source axis. Offsets must be nonnegative and the complete result footprint must fit within the source shape.
Operation contract
| Property |
Value |
| Semantic phase |
— |
| Traits |
Pure |
| Target contracts |
register.permutation |
Signature
| Kind |
Name |
Type |
Cardinality |
Description |
| Operand |
source |
vector |
required |
— |
| Operand |
offsets |
index |
variadic |
— |
| Result |
result |
vector |
required |
— |
| Attribute |
static_offsets |
i64_array |
required |
Static offsets with INT64_MIN sentinels for dynamics. |
Verification constraints
SameElementType(source, result)
Examples
%tail = vector.slice %v[%i] : vector<[%n]xf32> -> vector<4xf32>
%tile = vector.slice %v[0, 4] : vector<8x16xf32> -> vector<4x8xf32>