[Mlir-commits] [mlir] [MLIR][Interfaces] Make `getMutableSuccessorOperands` overridable on `ReturnLike` ops (PR #186832)
Robert Konicar
llvmlistbot at llvm.org
Tue Mar 17 05:36:18 PDT 2026
Jezurko wrote:
> Can you please undo all the formatting change, it's really hard to figure out what changes from the diff right now.
Fixed. I accidentally clang-formatted the tablegen files just before committing...
> On a high-level, I would ask what the motivation for the change is? Why is this change to ReturnLike desirable?
Of course, sorry, I should have explained that in the first place.
In a downstream project we are implementing our own `return`-like op that consumes some arguments without them actually being returned from a function (for which we use `func.func`). The recent `func.func` verifier changes exposed that we don't provide a custom implementation for the `getMutableSuccessorOperands` interface method - but when trying to fix that I encountered that it is not possible to override the implementation that comes from the `ReturnLike` trait, since it ends up as multiple definitions.
Imho this is a bit unfortunate since the operation we are implementing is actually return-like in its behaviour but the implementation for the `getMutableSuccessorOperands` method that comes with the trait does not make sense for it. So I thought that this would be a good way to allow for more flexibility in this regard.
https://github.com/llvm/llvm-project/pull/186832
More information about the Mlir-commits
mailing list