[mlir][linalg] Fix bug in the fusion on tensors index op handling.
authorTobias Gysi <gysit@google.com>
Wed, 5 May 2021 13:58:57 +0000 (13:58 +0000)
committerTobias Gysi <gysit@google.com>
Wed, 5 May 2021 14:46:08 +0000 (14:46 +0000)
commit4a6ee23d832f823d71faf7d0dca1b6eec71df253
treefdfcdab610210de53457b19da92074235b699783
parent1f5cacfcb845fd4163dec5a8c7991934c53d6cb3
[mlir][linalg] Fix bug in the fusion on tensors index op handling.

The old index op handling let the new index operations point back to the
producer block. As a result, after fusion some index operations in the
fused block had back references to the old producer block resulting in
illegal IR. The patch now relies on a block and value mapping to avoid
such back references.

Differential Revision: https://reviews.llvm.org/D101887
mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp
mlir/test/Dialect/Linalg/fusion-tensor.mlir