@@ -1582,22 +1582,27 @@ def Vector_LoadOp : Vector_Op<"load"> {
1582
1582
vector. If the memref element type is vector, it should match the result
1583
1583
vector type.
1584
1584
1585
- Example 1: 1-D vector load on a scalar memref.
1585
+ Example: 0-D vector load on a scalar memref.
1586
+ ```mlir
1587
+ %result = vector.load %base[%i, %j] : memref<100x100xf32>, vector<f32>
1588
+ ```
1589
+
1590
+ Example: 1-D vector load on a scalar memref.
1586
1591
```mlir
1587
1592
%result = vector.load %base[%i, %j] : memref<100x100xf32>, vector<8xf32>
1588
1593
```
1589
1594
1590
- Example 2 : 1-D vector load on a vector memref.
1595
+ Example: 1-D vector load on a vector memref.
1591
1596
```mlir
1592
1597
%result = vector.load %memref[%i, %j] : memref<200x100xvector<8xf32>>, vector<8xf32>
1593
1598
```
1594
1599
1595
- Example 3 : 2-D vector load on a scalar memref.
1600
+ Example: 2-D vector load on a scalar memref.
1596
1601
```mlir
1597
1602
%result = vector.load %memref[%i, %j] : memref<200x100xf32>, vector<4x8xf32>
1598
1603
```
1599
1604
1600
- Example 4 : 2-D vector load on a vector memref.
1605
+ Example: 2-D vector load on a vector memref.
1601
1606
```mlir
1602
1607
%result = vector.load %memref[%i, %j] : memref<200x100xvector<4x8xf32>>, vector<4x8xf32>
1603
1608
```
@@ -1608,12 +1613,12 @@ def Vector_LoadOp : Vector_Op<"load"> {
1608
1613
loaded out of bounds. Not all targets may support out-of-bounds vector
1609
1614
loads.
1610
1615
1611
- Example 5 : Potential out-of-bound vector load.
1616
+ Example: Potential out-of-bound vector load.
1612
1617
```mlir
1613
1618
%result = vector.load %memref[%index] : memref<?xf32>, vector<8xf32>
1614
1619
```
1615
1620
1616
- Example 6 : Explicit out-of-bound vector load.
1621
+ Example: Explicit out-of-bound vector load.
1617
1622
```mlir
1618
1623
%result = vector.load %memref[%c0] : memref<7xf32>, vector<8xf32>
1619
1624
```
@@ -1622,7 +1627,7 @@ def Vector_LoadOp : Vector_Op<"load"> {
1622
1627
let arguments = (ins Arg<AnyMemRef, "the reference to load from",
1623
1628
[MemRead]>:$base,
1624
1629
Variadic<Index>:$indices);
1625
- let results = (outs AnyVector :$result);
1630
+ let results = (outs AnyVectorOfAnyRank :$result);
1626
1631
1627
1632
let extraClassDeclaration = [{
1628
1633
MemRefType getMemRefType() {
@@ -1660,22 +1665,27 @@ def Vector_StoreOp : Vector_Op<"store"> {
1660
1665
to store. If the memref element type is vector, it should match the type
1661
1666
of the value to store.
1662
1667
1663
- Example 1: 1-D vector store on a scalar memref.
1668
+ Example: 0-D vector store on a scalar memref.
1669
+ ```mlir
1670
+ vector.store %valueToStore, %memref[%i, %j] : memref<200x100xf32>, vector<f32>
1671
+ ```
1672
+
1673
+ Example: 1-D vector store on a scalar memref.
1664
1674
```mlir
1665
1675
vector.store %valueToStore, %memref[%i, %j] : memref<200x100xf32>, vector<8xf32>
1666
1676
```
1667
1677
1668
- Example 2 : 1-D vector store on a vector memref.
1678
+ Example: 1-D vector store on a vector memref.
1669
1679
```mlir
1670
1680
vector.store %valueToStore, %memref[%i, %j] : memref<200x100xvector<8xf32>>, vector<8xf32>
1671
1681
```
1672
1682
1673
- Example 3 : 2-D vector store on a scalar memref.
1683
+ Example: 2-D vector store on a scalar memref.
1674
1684
```mlir
1675
1685
vector.store %valueToStore, %memref[%i, %j] : memref<200x100xf32>, vector<4x8xf32>
1676
1686
```
1677
1687
1678
- Example 4 : 2-D vector store on a vector memref.
1688
+ Example: 2-D vector store on a vector memref.
1679
1689
```mlir
1680
1690
vector.store %valueToStore, %memref[%i, %j] : memref<200x100xvector<4x8xf32>>, vector<4x8xf32>
1681
1691
```
@@ -1685,21 +1695,23 @@ def Vector_StoreOp : Vector_Op<"store"> {
1685
1695
target-specific. No assumptions should be made on the memory written out of
1686
1696
bounds. Not all targets may support out-of-bounds vector stores.
1687
1697
1688
- Example 5 : Potential out-of-bounds vector store.
1698
+ Example: Potential out-of-bounds vector store.
1689
1699
```mlir
1690
1700
vector.store %valueToStore, %memref[%index] : memref<?xf32>, vector<8xf32>
1691
1701
```
1692
1702
1693
- Example 6 : Explicit out-of-bounds vector store.
1703
+ Example: Explicit out-of-bounds vector store.
1694
1704
```mlir
1695
1705
vector.store %valueToStore, %memref[%c0] : memref<7xf32>, vector<8xf32>
1696
1706
```
1697
1707
}];
1698
1708
1699
- let arguments = (ins AnyVector:$valueToStore,
1709
+ let arguments = (ins
1710
+ AnyVectorOfAnyRank:$valueToStore,
1700
1711
Arg<AnyMemRef, "the reference to store to",
1701
1712
[MemWrite]>:$base,
1702
- Variadic<Index>:$indices);
1713
+ Variadic<Index>:$indices
1714
+ );
1703
1715
1704
1716
let extraClassDeclaration = [{
1705
1717
MemRefType getMemRefType() {
0 commit comments