[mlir][linalg] adapt named op generalization to work with captures.
authorTobias Gysi <gysit@google.com>
Wed, 21 Apr 2021 06:37:18 +0000 (06:37 +0000)
committerTobias Gysi <gysit@google.com>
Wed, 21 Apr 2021 06:37:53 +0000 (06:37 +0000)
commit5a451e486f31de36913d6fc22a1b92b39caa3b0e
treeb60e2b42f877d3a63ab7681bff126e0fc23a439f
parent6048d1d19c55a107f67cd617d6ed386831b5adee
[mlir][linalg] adapt named op generalization to work with captures.

Instead of always running the region builder check if the generalized op has a region attached. If yes inline the existing region instead of calling the region builder. This change circumvents a problem with named operations that have a region builder taking captures and the generalization pass not knowing about this captures.

Differential Revision: https://reviews.llvm.org/D100880
mlir/lib/Dialect/Linalg/Transforms/Generalization.cpp
mlir/test/Dialect/Linalg/generalize-named-ops.mlir