@@ -1639,20 +1639,16 @@ static VectorType dropNonScalableUnitDimFromType(VectorType inVecTy) {
1639
1639
// / required to be rank > 1.
1640
1640
// /
1641
1641
// / Ex:
1642
- // / ```
1643
1642
// / %mul = arith.mulf %B_row, %A_row : vector<1x[4]xf32>
1644
1643
// / %cast = vector.shape_cast %mul : vector<1x[4]xf32> to vector<[4]xf32>
1645
- // / ```
1646
1644
// /
1647
1645
// / gets converted to:
1648
1646
// /
1649
- // / ```
1650
1647
// / %B_row_sc = vector.shape_cast %B_row : vector<1x[4]xf32> to vector<[4]xf32>
1651
1648
// / %A_row_sc = vector.shape_cast %A_row : vector<1x[4]xf32> to vector<[4]xf32>
1652
1649
// / %mul = arith.mulf %B_row_sc, %A_row_sc : vector<[4]xf32>
1653
1650
// / %cast_new = vector.shape_cast %mul : vector<[4]xf32> to vector<1x[4]xf32>
1654
1651
// / %cast = vector.shape_cast %cast_new : vector<1x[4]xf32> to vector<[4]xf32>
1655
- // / ```
1656
1652
// /
1657
1653
// / Patterns for folding shape_casts should instantly eliminate `%cast_new` and
1658
1654
// / `%cast`.
@@ -1689,12 +1685,12 @@ struct DropUnitDimFromElementwiseOps final
1689
1685
1690
1686
VectorType newResultVectorType =
1691
1687
dropNonScalableUnitDimFromType (resultVectorType);
1692
- // Create an updated elementwise Op without unit dim
1688
+ // Create an updated elementwise Op without unit dim.
1693
1689
Operation *elementwiseOp =
1694
1690
rewriter.create (loc, op->getName ().getIdentifier (), newOperands,
1695
1691
newResultVectorType, op->getAttrs ());
1696
1692
1697
- // Restore the unit dim by applying vector.shape_cast to the result
1693
+ // Restore the unit dim by applying vector.shape_cast to the result.
1698
1694
rewriter.replaceOpWithNewOp <ShapeCastOp>(op, resultVectorType,
1699
1695
elementwiseOp->getResult (0 ));
1700
1696
0 commit comments