@@ -1718,7 +1718,7 @@ static bool isBroadcastLike(Operation *op) {
17181718 return false ;
17191719
17201720 // 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,
17221722 // for example (2,3) -> (1,3,2) is not broadcast-like. A sufficient condition
17231723 // is that the source shape is a suffix of the destination shape.
17241724 VectorType srcType = shapeCast.getSourceVectorType ();
@@ -1773,15 +1773,7 @@ static Value foldExtractFromBroadcast(ExtractOp extractOp) {
17731773 if (extractRank > inputRank)
17741774 return Value ();
17751775
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.
17851777 assert (inputType && " input must be a vector type because of previous checks" );
17861778 ArrayRef<int64_t > inputShape = inputType.getShape ();
17871779
0 commit comments