[Mlir-commits] [mlir] [mlir][bufferization] Add support for non-unique `func.return` (PR #114017)
Matthias Springer
llvmlistbot at llvm.org
Sat Nov 9 20:42:35 PST 2024
================
@@ -86,18 +86,13 @@ getOrCreateFuncAnalysisState(OneShotAnalysisState &state) {
return state.addExtension<FuncAnalysisState>();
}
-/// Return the unique ReturnOp that terminates `funcOp`.
-/// Return nullptr if there is no such unique ReturnOp.
-static func::ReturnOp getAssumedUniqueReturnOp(func::FuncOp funcOp) {
- func::ReturnOp returnOp;
- for (Block &b : funcOp.getBody()) {
- if (auto candidateOp = dyn_cast<func::ReturnOp>(b.getTerminator())) {
- if (returnOp)
- return nullptr;
- returnOp = candidateOp;
- }
- }
- return returnOp;
+/// Return all top-level func.return ops in the given function.
----------------
matthias-springer wrote:
You're right, this doesn't make sense. All func.return ops are top-level ops. I updated the comment.
https://github.com/llvm/llvm-project/pull/114017
More information about the Mlir-commits
mailing list