Add a region to linalg.generic
authorNicolas Vasilache <ntv@google.com>
Tue, 6 Aug 2019 12:50:10 +0000 (05:50 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Tue, 6 Aug 2019 12:50:36 +0000 (05:50 -0700)
commit4b422a51edd3030ead029cd21a0fe19883dee2b4
treed74ababa78d6d1da66e73e64f9f375c2446b74f8
parent24647750d487c2c496bd996d15ddaa7af090ef73
Add a region to linalg.generic

This CL extends the Linalg GenericOp with an alternative way of specifying the body of the computation based on a single block region. The "fun" attribute becomes optional.
Either a SymbolRef "fun" attribute or a single block region must be specified to describe the side-effect-free computation. Upon lowering to loops, the new region body is inlined in the innermost loop.

The parser, verifier and pretty printer are extended.
Appropriate roundtrip, negative and lowering to loop tests are added.

PiperOrigin-RevId: 261895568
mlir/include/mlir/Linalg/IR/LinalgLibraryOps.td
mlir/include/mlir/Linalg/IR/LinalgOps.h
mlir/include/mlir/Linalg/IR/LinalgOps.td
mlir/include/mlir/Linalg/IR/LinalgTraits.h
mlir/lib/Linalg/IR/LinalgOps.cpp
mlir/lib/Linalg/Transforms/LowerToLoops.cpp
mlir/test/Linalg/invalid-generic-op.mlir
mlir/test/Linalg/loops.mlir
mlir/test/Linalg/roundtrip.mlir