diff options
author | David Green <david.green@arm.com> | 2024-01-25 12:17:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-25 12:17:12 +0000 |
commit | 223d3dabc8b75a75276ef0544132ba0df4498fb3 (patch) | |
tree | 66ae25de26fbc49bbd2c9275d4459893136d9ea1 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 4b8e55cb04e68053a80f4ee26f4efbf08fe30b02 (diff) | |
download | llvm-223d3dabc8b75a75276ef0544132ba0df4498fb3.zip llvm-223d3dabc8b75a75276ef0544132ba0df4498fb3.tar.gz llvm-223d3dabc8b75a75276ef0544132ba0df4498fb3.tar.bz2 |
[Flang] Minloc elemental intrinsic lowering (#74828)
Currently the lowering of a minloc intrinsic with a mask will look something
like:
%e = hlfir.elemental %shape ({
...
})
%m = hlfir.minloc %array mask %e
hlfir.assign %m to %result
hlfir.destroy %m
The elemental will be expanded into a temporary+loop, the minloc into a
FortranAMinloc call (which hopefully gets simplified to a specialized call that
can be inlined at the call site), and the assign might get expanded to a
FortranAAssign. It would be better to generate the entire construct as single
loop if we can - one that performs the minloc calculation with the mask
elemental computed inline.
This patch attempt to do that, adding a hlfir version of the expansion code
from SimplifyIntrinsics that turns an minloc+elemental into a single combined
loop nest. It attempts to reuse the methods in genMinlocReductionLoop for
constructing the loop with a modified loop body. The declaration for the
function is currently in Optimizer/Support/Utils.h, but there might be a better
place for it.
It is added as part of the OptimizedBufferizationPass, like the
similar count/any/all that have been added recently.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions