Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion mlir/include/mlir/Dialect/Linalg/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ def LinalgFoldUnitExtentDimsPass : Pass<"linalg-fold-unit-extent-dims", ""> {
let options = [
Option<"useRankReducingSlices", "use-rank-reducing-slices", "bool",
/*default=*/"false",
"Generate rank-reducing slices instead of reassociative reshapes">
"Generate rank-reducing slices instead of reassociative reshapes">,
Option<"enableMoveInitOperandsToInput", "enable-move-init-operands-to-input", "bool",
/*default=*/"true",
"Enable MoveInitOperandsToInputPattern transformation">
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you have made default 'true', this is NFC for if (enableMoveInitOperandsToInput) {.
With that context, LGTM.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thank you!

let dependentDialects = [
"linalg::LinalgDialect", "affine::AffineDialect", "memref::MemRefDialect"
Expand Down
4 changes: 3 additions & 1 deletion mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,9 @@ struct LinalgFoldUnitExtentDimsPass
RankReductionStrategy::ExtractInsertSlice;
}
linalg::populateFoldUnitExtentDimsPatterns(patterns, options);
populateMoveInitOperandsToInputPattern(patterns);
if (enableMoveInitOperandsToInput) {
populateMoveInitOperandsToInputPattern(patterns);
}
(void)applyPatternsGreedily(op, std::move(patterns));
}
};
Expand Down