[PATCH] D59129: [SROA] WIP: Lowering alloca is not always beneficial

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 11 12:15:16 PDT 2019


efriedma added a comment.

I was sort of thinking you could write the reverse transform in MemCpyOpt, since it does a similar sorts of analysis, but maybe we'd have to do it later, or patch SROA anyway, to avoid two transforms fighting each other.

> If you look at shouldExpand, you see that a decision is made per alloca slice

You're returning early from SROA::runOnAlloca.  That's a decision on the whole alloca: if there's an expensive memcpy into any part of the alloca, don't do any splitting on the whole alloca.  The alternative is to make the decision on a per-slice level: given a subset of slices that are the target of a memcpy, "merge" those slices so splitAlloca() doesn't split them away from each other.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59129/new/

https://reviews.llvm.org/D59129





More information about the llvm-commits mailing list