[PATCH] D52081: [InstCombine] do not expand 8 byte memcpy if optimising for minsize

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 17 05:22:48 PDT 2018


lebedev.ri added a comment.

In https://reviews.llvm.org/D52081#1236723, @SjoerdMeijer wrote:

> One more thought then on this:
>
> > If we want to distinguish optimizing for size from optimizing for speed, that belongs in the backend
>
> that means we shouldn't be doing any memcpy lowering at all in InstCombiner::SimplifyAnyMemTransfer. In other words, if I rewrite this patch to actually strip out any memcpy lowering here in InstCombine, would that be an acceptable approach?


We don't do nearly as much optimizations in backend, so just not expanding `memcpy` in the middle end will certainly negatively affect the overall optimizations.
I think the best path forward //here// is to only derive the maximal size of memcpy that is ok to expand from datalayout

In https://reviews.llvm.org/D52081#1235926, @spatel wrote:

> There was a proposal to use datalayout here:
>  https://reviews.llvm.org/D35035
>  ...but that patch had other problems, and it looks stalled.


^ and i think that patch will do such a change.


https://reviews.llvm.org/D52081





More information about the llvm-commits mailing list