This revision allows representing a reduction at the level of linalg on tensors for named ops. When a structured op has a reduction and returns tensor(s), new conventions are added and documented.
As an illustration, the syntax for a linalg.matmul writing into a buffer is:
linalg.matmul ins(%a, %b : memref<?x?xf32>, tensor<?x?xf32>) outs(%c : memref<?x?xf32>)
, whereas the syntax for a linalg.matmul returning a new tensor is:
%d = linalg.matmul ins(%a, %b : tensor<?x?xf32>, memref<?x?xf32>) init(%c : memref<?x?xf32>) -> tensor<?x?xf32>
Other parts of linalg will be extended accordingly to allow mixed buffer/tensor semantics in the presence of reductions.
This seems to be more complex because the effort is being made to mix tensor and buffer semantics. Is it possible for the time being to just keep them completely separate (at least by convention).