[Mlir-commits] [mlir] [mlir][bufferization] Add `BufferizableOpInterface::hasTensorSemantics` (PR #75273)
Matthias Springer
llvmlistbot at llvm.org
Fri Jan 5 07:03:52 PST 2024
matthias-springer wrote:
> `hasTensorSemanticsForBufferization` is a bit of a weird name ... This represents ops that have value semantics and need to be bufferized? Or is there more to it?
It should really be called `hasTensorSemantics`. I just can't use that name because of a name collision.
Side note: This is not the first time that I'm running into such naming issues. There is an inconsistency in MLIR when (a) implementing an interface directly on an op and (b) implementing an interface with an external model. In the latter case, the interface methods are properly encapsulated: you have to explicitly `cast<MyInterface>(my_op.getOperation()).interface_method()` before calling an interface method. In the former case, you can directly call `my_op.interface_method()`. Name collisions could be avoided if we would treat all interface implementations like (b). (That would be a pretty large API change API. There may also be performance implications as (b) is no longer based on C++ inheritance and the compiled code may be less efficient.)
https://github.com/llvm/llvm-project/pull/75273
More information about the Mlir-commits
mailing list