[Mlir-commits] [mlir] [mlir][inliner] Assert that no external nodes passed to the profitability hook. (PR #85489)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Mar 15 17:38:11 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-core
Author: Slava Zakharin (vzakhari)
<details>
<summary>Changes</summary>
Fixes #<!-- -->85400
---
Full diff: https://github.com/llvm/llvm-project/pull/85489.diff
1 Files Affected:
- (modified) mlir/lib/Transforms/InlinerPass.cpp (+1-4)
``````````diff
diff --git a/mlir/lib/Transforms/InlinerPass.cpp b/mlir/lib/Transforms/InlinerPass.cpp
index 08d8dbf73a6a1d..2d40d29e1f6077 100644
--- a/mlir/lib/Transforms/InlinerPass.cpp
+++ b/mlir/lib/Transforms/InlinerPass.cpp
@@ -96,10 +96,7 @@ static bool isProfitableToInline(const Inliner::ResolvedCall &resolvedCall,
Region *callerRegion = resolvedCall.sourceNode->getCallableRegion();
Region *calleeRegion = resolvedCall.targetNode->getCallableRegion();
- // We should not get external nodes here, but just return true
- // for now to preserve the original behavior of the inliner pass.
- if (!calleeRegion || !calleeRegion)
- return true;
+ assert(calleeRegion && callerRegion && "unexpected external node");
auto countOps = [](Region *region) {
unsigned count = 0;
``````````
</details>
https://github.com/llvm/llvm-project/pull/85489
More information about the Mlir-commits
mailing list