[mlir][bufferize] Fix bug in AllocTensorElimination
authorMatthias Springer <springerm@google.com>
Mon, 15 Aug 2022 09:14:43 +0000 (11:14 +0200)
committerMatthias Springer <springerm@google.com>
Mon, 15 Aug 2022 09:45:58 +0000 (11:45 +0200)
commita36348c5868def196062fe74714b9a8ab754cdd0
treeb330630fa5c7b775610cd0945432edb8e0623097
parent982779230fe0950e5ee0192fdad070d796094d30
[mlir][bufferize] Fix bug in AllocTensorElimination

AllocTensorElimination does currently not support chains where the type is
changing. AllocTensorElimination used to generate invalid IR for such
inputs. With this commit, AllocTensorElimination does no longer apply to
such inputs. (It can be extended to support such IR if needed.)

Differential Revision: https://reviews.llvm.org/D131880
mlir/lib/Dialect/Bufferization/Transforms/AllocTensorElimination.cpp
mlir/test/Dialect/Bufferization/Transforms/one-shot-bufferize-alloc-tensor-elimination.mlir