Suboptimal codegen for potential [T; N]::zip() #79754
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code taken from #79451.
Godbolt (llvm-ir / asm): https://godbolt.org/z/Yq7W98
It seems that llvm is unable to eliminate the memcpys and thus results in suboptimal code.
Also there are dead stores which haven't been eliminated as well:
A not quite equivalent c++ example produces "optimal" code where no memcpy/dead stores occurs: https://godbolt.org/z/sdfa13
EDIT:
On second thought, I'd assume that LLVM's GVN pass should have eliminated the memcpys but it seems that this isn't supported?
The text was updated successfully, but these errors were encountered: