[PATCH] D59129: [SROA] WIP: Lowering alloca is not always beneficial
Sjoerd Meijer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 12 02:18:56 PDT 2019
SjoerdMeijer added a comment.
> The transform is more powerful working the other way: it could catch cases that were't originally written as "memcpy" in the source code. Not sure that means we shouldn't do something in SROA, though. Ideally, I think we want the "canonical" form to be the promoted version, and transform it > to the compact version as part of lowering. But I'm not sure how much work it would be to make the reverse transform reliable, and I don't want to block an incremental improvement.
>
> MemCpyOpt doesn't actually merge memcpys at the moment, I think. It does merge memsets, and it has a lot of memcpy-related transforms, but that one in particular is missing. But it's the right sort of logic, at least...
Many thanks for sharing your ideas. I will first go for the incremental approach first then. One of the advantages is that the code changes will be minimal, I only need a target hook for the memcpy cost, so we don't create (much) technical debt if we do end up tackling this in MemCpyOpt.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59129/new/
https://reviews.llvm.org/D59129
More information about the llvm-commits
mailing list