aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/TestModuleFileExtension.cpp
diff options
context:
space:
mode:
authorAmir Bishara <139038766+amirBish@users.noreply.github.com>2024-12-18 23:57:13 +0200
committerGitHub <noreply@github.com>2024-12-18 23:57:13 +0200
commit08aa95638713a37407367e0e158df6fb82509725 (patch)
tree7304c2e7447fb137b3bea41a797f1f4b4516a324 /clang/lib/Frontend/TestModuleFileExtension.cpp
parent6457aee5b7da6bb6d7f556d14f42a6763b42e060 (diff)
downloadllvm-08aa95638713a37407367e0e158df6fb82509725.zip
llvm-08aa95638713a37407367e0e158df6fb82509725.tar.gz
llvm-08aa95638713a37407367e0e158df6fb82509725.tar.bz2
[mlir][bufferization]-Replace only one use in TensorEmptyElimination (#118958)
In many cases the emptyTensorElimination can not transform or eliminate the empty tensor which is being inserted into the `SubsetInsertionOpInterface`. Two major reasons for that: 1- Failing when trying to find a legal/suitable insertion point for the `subsetExtract` which is about to replace the empty tensor. However, we may try to handle this issue by moving the needed values which responsible on building the `subsetExtract` nearby the empty tensor (which is about to be eliminated). Thus increasing the probability to find a legal insertion point. 2-The EmptyTensorElimination transform replaces the tensor.empty's uses all at once in one apply, rather than replacing only the specific use which was visited in the use-def chain (when traversing from the tensor.insert_slice). This scenario of replacing all the uses of the tensor.empty may lead into additional read effects after bufferization of the specific subset extract/subview which should not be the case. Both cases may result in many copies in the coming bufferization which can not be canonicalized. The first case can be noticed when having a `tensor.empty` followed by `SubsetInsertionOpInterface` (or in simple words `tensor.insert_slice`), which have been lowered from `tensor/tosa.concat`. The second case can be noticed when having a `tensor.empty`, with many uses and leading to applying the transformation only once, since the whole uses have been replaced at once. The first commit in the PR only adds the lit tests for the cases shown above (NFC), to emphasize how the transform works, in the coming MRs will upload a slight changes to handle these case. The second commit in this PR, we want to replace only the specific use which was visited in the `use-def` chain (when traversing from the `tensor.insert_slice`'s source).
Diffstat (limited to 'clang/lib/Frontend/TestModuleFileExtension.cpp')
0 files changed, 0 insertions, 0 deletions