[Mlir-commits] [mlir] [SCF] add debug label for MergeNestedParallelLoops pattern (PR #135980)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Apr 16 09:03:08 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-scf
Author: Scott Manley (rscottmanley)
<details>
<summary>Changes</summary>
Adding debug labels to rewrite patterns gives the canonicalizer the ability to disable specific patterns if undesired.
The motivation here is that since there is currently no way to handle attributes on ops that are changed when these patterns are applied, this at least provides a workaround.
---
Full diff: https://github.com/llvm/llvm-project/pull/135980.diff
1 Files Affected:
- (modified) mlir/lib/Dialect/SCF/IR/SCF.cpp (+3-3)
``````````diff
diff --git a/mlir/lib/Dialect/SCF/IR/SCF.cpp b/mlir/lib/Dialect/SCF/IR/SCF.cpp
index c454f342b4204..04e89105c056a 100644
--- a/mlir/lib/Dialect/SCF/IR/SCF.cpp
+++ b/mlir/lib/Dialect/SCF/IR/SCF.cpp
@@ -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);
}
/// Given the region at `index`, or the parent operation if `index` is None,
``````````
</details>
https://github.com/llvm/llvm-project/pull/135980
More information about the Mlir-commits
mailing list