Skip to content
Closed
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions mlir/lib/Dialect/SCF/IR/SCF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3202,9 +3202,9 @@ struct MergeNestedParallelLoops : public OpRewritePattern<ParallelOp> {

void ParallelOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) {
results
.add<ParallelOpSingleOrZeroIterationDimsFolder, MergeNestedParallelLoops>(
context);
results.add<ParallelOpSingleOrZeroIterationDimsFolder>(context);
results.addWithLabel<MergeNestedParallelLoops>({"MergeNestedParallelLoops"},
context);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a name on the pattern instead of a label here?
A label to identify a single pattern does not seem the intended purpose of labels.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay I agree after I dug around some more. I took my guidance from what I read in include/mlir/Transforms/Passes.h which seems to say you can do it both ways:

/// ... Debug labels must be set explicitly on patterns or when adding
/// them with `RewritePatternSet::addWithLabel`. Debug names may be empty, but
/// patterns created with `RewritePattern::create` have their default debug name
/// set to their type name.

Does this suggest you could have individual pattern names and also a label (in this case, like SCFParallelPatterns) at the same time?

}

/// Given the region at `index`, or the parent operation if `index` is None,
Expand Down
Loading