[Mlir-commits] [mlir] [mlir][bufferization] Return early in aliasing analysis (PR #173529)

Matthias Springer llvmlistbot at llvm.org
Thu Dec 25 02:55:25 PST 2025


================
@@ -136,7 +136,10 @@ aliasingFuncOpBBArgsAnalysis(FuncOp funcOp, OneShotAnalysisState &state,
 
   // Find all func.return ops.
   SmallVector<func::ReturnOp> returnOps = getReturnOps(funcOp);
-  assert(!returnOps.empty() && "expected at least one ReturnOp");
+  // Gracefully exit if no func.return ops are found.
+  if (returnOps.empty()) {
+    return success();
----------------
matthias-springer wrote:

In fact, we should also error out when there is any other non-`func.return` op that has the `ReturnLike` trait. Please put that as a TODO in a comment.


https://github.com/llvm/llvm-project/pull/173529


More information about the Mlir-commits mailing list