[mlir] Small cleanups to func-bufferize/finalizing-bufferize
authorSean Silva <silvasean@google.com>
Mon, 30 Nov 2020 23:20:30 +0000 (15:20 -0800)
committerSean Silva <silvasean@google.com>
Tue, 1 Dec 2020 01:04:14 +0000 (17:04 -0800)
commit774f1d3ffd458d6cb82d5039758ef1cf6370957f
tree5efb83802ab68b0ead57aaf3045e0eeeb8c24eed
parent61da501b6a1bf845c3da9a7e761a3c6a3b6cf21a
[mlir] Small cleanups to func-bufferize/finalizing-bufferize

- Address TODO in scf-bufferize: the argument materialization issue is
  now fixed and the code is now in Transforms/Bufferize.cpp
- Tighten up finalizing-bufferize to avoid creating invalid IR when
  operand types potentially change
- Tidy up the testing of func-bufferize, and move appropriate tests
  to a new finalizing-bufferize.mlir
- The new stricter checking in finalizing-bufferize revealed that we
  needed a DimOp conversion pattern (found when integrating into npcomp).
  Previously, the converion infrastructure was blindly changing the
  operand type during finalization, which happened to work due to
  DimOp's tensor/memref polymorphism, but is generally not encouraged
  (the new pattern is the way to tell the conversion infrastructure that
  it is legal to change that type).
mlir/lib/Dialect/SCF/Transforms/Bufferize.cpp
mlir/lib/Dialect/StandardOps/Transforms/Bufferize.cpp
mlir/lib/Transforms/Bufferize.cpp
mlir/test/Dialect/Standard/bufferize.mlir
mlir/test/Dialect/Standard/func-bufferize-partial.mlir [deleted file]
mlir/test/Dialect/Standard/func-bufferize.mlir
mlir/test/Transforms/finalizing-bufferize.mlir [new file with mode: 0644]