diff options
author | Tina Jung <tina.maria.jung@xilinx.com> | 2023-07-05 08:37:47 +0100 |
---|---|---|
committer | Matthias Gehre <matthias.gehre@xilinx.com> | 2023-07-05 11:38:46 +0200 |
commit | d84d418e2adc421c98e484ab3b09e2f4f3e5c1ef (patch) | |
tree | 18c5fe0c90cdb3b6ab7beb77b3555f4aa5260b39 /llvm/unittests/Analysis/ValueTrackingTest.cpp | |
parent | 2e903709de003dc6ae980197f4a0850a158dd9b8 (diff) | |
download | llvm-d84d418e2adc421c98e484ab3b09e2f4f3e5c1ef.zip llvm-d84d418e2adc421c98e484ab3b09e2f4f3e5c1ef.tar.gz llvm-d84d418e2adc421c98e484ab3b09e2f4f3e5c1ef.tar.bz2 |
[mlir][tosa] Constant folding for reciprocal
Add constant fold for tosa.reciprocal, which can be applied if the input is a dense constant tensor. The reciprocal is computed for every element and the result is a tensor with the same dimensions as the input tensor.
As the input tensor might require a lot of memory and the folding might double the required memory, a heuristic decides when to actually apply the folding. Currently, the operation will be replaced only if the input constant is a splat (i.e. requires little memory) or has in single user (similar to the already existing fold for constant transposes). This keeps the additionally required space low.
Differential Revision: https://reviews.llvm.org/D150578
Diffstat (limited to 'llvm/unittests/Analysis/ValueTrackingTest.cpp')
0 files changed, 0 insertions, 0 deletions