[Mlir-commits] [mlir] [MLIR][LLVM] Fix inlining of a single block ending with unreachable (PR #122646)
River Riddle
llvmlistbot at llvm.org
Mon Jan 13 09:26:16 PST 2025
================
@@ -118,6 +118,19 @@ void InlinerInterface::handleTerminator(Operation *op,
handler->handleTerminator(op, valuesToRepl);
}
+/// Returns true if the inliner can assume a fast path of not creating a
+/// new block, if there is only one block.
+bool InlinerInterface::allowSingleBlockOptimization(
+ iterator_range<Region::iterator> inlinedBlocks) const {
+ if (inlinedBlocks.empty()) {
+ return true;
+ } else {
+ auto *handler = getInterfaceFor(inlinedBlocks.begin()->getParentOp());
+ assert(handler && "expected valid dialect handler");
+ return handler->allowSingleBlockOptimization(inlinedBlocks);
+ }
----------------
River707 wrote:
Drop else after return here.
https://github.com/llvm/llvm-project/pull/122646
More information about the Mlir-commits
mailing list