[mlir][arith][bufferize] Fix tensors with different layouts after bufferization
authorMatthias Springer <springerm@google.com>
Fri, 8 Apr 2022 09:03:18 +0000 (18:03 +0900)
committerMatthias Springer <springerm@google.com>
Fri, 8 Apr 2022 09:11:10 +0000 (18:11 +0900)
commit8b09141909329d93b0de987ee18ee9cfaa7223ba
treea9d8be6e5b445cde5e7286ca2e36b9c0853d1552
parent5626bd428930aa2cb2b5fdd69e93620e0d2b0532
[mlir][arith][bufferize] Fix tensors with different layouts after bufferization

Insert a cast if the two tensors with identical layout (that are passed to `arith.select`) have different layout maps after bufferization.

Differential Revision: https://reviews.llvm.org/D123321
mlir/lib/Dialect/Arithmetic/Transforms/BufferizableOpInterfaceImpl.cpp
mlir/test/Dialect/Bufferization/Transforms/one-shot-bufferize.mlir