@@ -1718,7 +1718,7 @@ static bool isBroadcastLike(Operation *op) {
1718
1718
return false ;
1719
1719
1720
1720
// Check that shape_cast **only** prepends 1s, like (2,3) -> (1,1,2,3).
1721
- // Note that checking that dst shape has a prefix of 1s is not sufficient,
1721
+ // Checking that the destination shape has a prefix of 1s is not sufficient,
1722
1722
// for example (2,3) -> (1,3,2) is not broadcast-like. A sufficient condition
1723
1723
// is that the source shape is a suffix of the destination shape.
1724
1724
VectorType srcType = shapeCast.getSourceVectorType ();
@@ -1773,15 +1773,7 @@ static Value foldExtractFromBroadcast(ExtractOp extractOp) {
1773
1773
if (extractRank > inputRank)
1774
1774
return Value ();
1775
1775
1776
- // The above condition guarantees that input is a vector:
1777
- //
1778
- // If input is a scalar:
1779
- // 1) inputRank is 0, so
1780
- // 2) extractRank is 0 (because extractRank <= inputRank), so
1781
- // 3) extract is scalar (because rank-0 extraction is always scalar), s0
1782
- // 4) input and extract are scalar, so same type.
1783
- // But then we should have returned earlier when the types were compared for
1784
- // equivalence. So input is not a scalar at this point.
1776
+ // The above condition guarantees that input is a vector.
1785
1777
assert (inputType && " input must be a vector type because of previous checks" );
1786
1778
ArrayRef<int64_t > inputShape = inputType.getShape ();
1787
1779
0 commit comments