[Mlir-commits] [mlir] 59f0e46 - [mlir][Inliner] Don't optimize callees in async mode if there is only one to optimize
River Riddle
llvmlistbot at llvm.org
Tue Feb 23 18:48:37 PST 2021
Author: River Riddle
Date: 2021-02-23T18:44:09-08:00
New Revision: 59f0e4627a5e8789c9ab997cd13f96600848fea8
URL: https://github.com/llvm/llvm-project/commit/59f0e4627a5e8789c9ab997cd13f96600848fea8
DIFF: https://github.com/llvm/llvm-project/commit/59f0e4627a5e8789c9ab997cd13f96600848fea8.diff
LOG: [mlir][Inliner] Don't optimize callees in async mode if there is only one to optimize
This avoids unnecessary async overhead in situations that won't benefit from it.
Added:
Modified:
mlir/lib/Transforms/Inliner.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Transforms/Inliner.cpp b/mlir/lib/Transforms/Inliner.cpp
index 0a2cc7eb4c98..bbcb1b2e0bc6 100644
--- a/mlir/lib/Transforms/Inliner.cpp
+++ b/mlir/lib/Transforms/Inliner.cpp
@@ -665,7 +665,7 @@ LogicalResult InlinerPass::optimizeSCC(CallGraph &cg, CGUseList &useList,
// NOTE: This is simple now, because we don't enable optimizing nodes within
// children. When we remove this restriction, this logic will need to be
// reworked.
- if (context->isMultithreadingEnabled()) {
+ if (context->isMultithreadingEnabled() && nodesToVisit.size() > 1) {
if (failed(optimizeSCCAsync(nodesToVisit, context)))
return failure();
More information about the Mlir-commits
mailing list