[mlir][scf][bufferize] Fix bufferizesToMemoryRead with 0 loop iterations
authorMatthias Springer <springerm@google.com>
Mon, 24 Oct 2022 12:19:31 +0000 (14:19 +0200)
committerMatthias Springer <springerm@google.com>
Mon, 24 Oct 2022 12:34:41 +0000 (14:34 +0200)
commitc9b3638126e520917ad42d3ec38ad31fd389e4b5
treefa7dd5d5641ec179acc490ac2f6fecbecab87e55
parent9ec7448857c1bcbc9878e9912167d9453d3be673
[mlir][scf][bufferize] Fix bufferizesToMemoryRead with 0 loop iterations

There was a bug in scf.for loop bufferization that could lead to a missing buffer copy (alloc was there, but not the copy).

Differential Revision: https://reviews.llvm.org/D135053
mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
mlir/test/Dialect/SCF/one-shot-bufferize-analysis.mlir
mlir/test/Dialect/SCF/one-shot-bufferize.mlir