Skip to content

Commit 31ea4ea

Browse files
committed
[fixup] Move a comment to the right place
Signed-off-by: Artem Gindinson <[email protected]>
1 parent 6ac75fd commit 31ea4ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mlir/lib/Dialect/Utils/ReshapeOpsUtils.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ findReassociationRangesForCollapse(ArrayRef<int64_t> sourceShape,
260260
bool iterateRightToLeft) {
261261
if (!iterateRightToLeft)
262262
return findReassociationRangesForCollapse(sourceShape, targetShape);
263+
// NB: To iterate right-to-left, we currently reverse the shapes and then
264+
// reverse the result back. The reversed shapes must not be temporary, as
265+
// we're passing through an ArrayRef.
263266
// FIXME: It would be preferable to avoid the expensive copies. At the moment,
264267
// this approach is chosen for readability of the main implementation.
265268
std::vector<int64_t> sourceToReverse = sourceShape.vec(),
@@ -321,9 +324,6 @@ mlir::getReassociationIndicesForCollapse(ArrayRef<int64_t> sourceShape,
321324
// be found by iterating in a certain direction, e.g. 2x2x? into 2x? - without
322325
// backtracking, the algorithm will fail right-to-left. However, this is the
323326
// best way to preserve correctness.
324-
//
325-
// NB: The reversed shapes must not be temporary as we're passing through an
326-
// ArrayRef.
327327
auto maybeReverseRanges = findReassociationRangesForCollapse(
328328
sourceShape, targetShape, /*iterateRightToLeft=*/true);
329329
if (failed(maybeReverseRanges))

0 commit comments

Comments
 (0)