[Mlir-commits] [mlir] [mlir][inliner] Assert that no external nodes passed to the profitability hook. (PR #85489)

Slava Zakharin llvmlistbot at llvm.org
Fri Mar 22 16:30:16 PDT 2024


https://github.com/vzakhari updated https://github.com/llvm/llvm-project/pull/85489

>From 4204847ee28b1ce940dc5a3ed2b371ef11f8366d Mon Sep 17 00:00:00 2001
From: Slava Zakharin <szakharin at nvidia.com>
Date: Fri, 15 Mar 2024 17:25:14 -0700
Subject: [PATCH] [mlir][inliner] Assert that no external nodes passed to the
 profitability hook.

Fixes #85400
---
 mlir/lib/Transforms/InlinerPass.cpp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/mlir/lib/Transforms/InlinerPass.cpp b/mlir/lib/Transforms/InlinerPass.cpp
index 9a7d5403a95dc5..d43c7ebaa0e46f 100644
--- a/mlir/lib/Transforms/InlinerPass.cpp
+++ b/mlir/lib/Transforms/InlinerPass.cpp
@@ -103,10 +103,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 (!callerRegion || !calleeRegion)
-    return true;
+  assert(calleeRegion && callerRegion && "unexpected external node");
 
   auto countOps = [](Region *region) {
     unsigned count = 0;



More information about the Mlir-commits mailing list