================
@@ -950,7 +777,27 @@ void RemoveDeadValues::runOnOperation() {
}
});
- cleanUpDeadVals(finalCleanupList);
+ MLIRContext *context = module->getContext();
+ cleanUpDeadVals(context, finalCleanupList);
+
+ if (!canonicalize)
+ return;
+
+ // Canonicalize all region branch ops.
+ SmallVector<Operation *> opsToCanonicalize;
+ module->walk([&](RegionBranchOpInterface regionBranchOp) {
+ opsToCanonicalize.push_back(regionBranchOp.getOperation());
+ });
+ RewritePatternSet owningPatterns(context);
+ for (auto *dialect : context->getLoadedDialects())
----------------
matthias-springer wrote:
I plan to populate only the region branch op canonicalization patterns in the
future (`populateRegionBranchOpInterfaceCanonicalizationPatterns` introduced in
#174094). We have to fix broken `RegionBranchOpInterface` implementations
(e.g., `scf.forall`) before we can do that. I put a TODO in the mean time.
https://github.com/llvm/llvm-project/pull/173505
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits