It seems only the default implementation is ever used, so it doesn't seem
necessary to include this method in the interface.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
There are plenty of cases where only the default implementation is used that we can switch from being an (overridable) interface method to an extraSharedClassDeclaration on the interface class IMO.
Agree, I think there are more. This was just one method that I hit when trying to extract the interface for destination-style ops (discussed in https://discourse.llvm.org/t/rfc-interface-for-destination-style-ops/64056)
While working on that, I am happy to do further cleanups.
I am not sure we want to do this. Some of this was implemented this way to hide the fact that the input and output operands of a linalg op being consecutive is am implementation detail of current Linalg op definition, and would like to hide this from users by relying on interface methods to querry the information without relying on operand ordering.
I don't understand this concern. Inlining the method still allows to provide custom getInputOperands and getOutputOperands interface methods which do not need to meet the assumption that the input and output operands are consecutive. And regarding the assumption that the output operands appear consecutive, that is already there in the code, as the method is only allowed to return two values: begin and end of where the output positions are in the loops to shapes map.
Change now makes sense since it is limited to LinalgInterface. This was a a bit of frought API to begin with (full disclosure, I added it).
Just for the record, it was already limited to LinalgInterface before. The only thing I changed is that I have extracted it into a static function.
I don't understand. How is it different from just inlining that code? It was already limited to LinalgInterface. Why didn't you approve it before? What changed other than the readability aspect?