[PATCH] D56810: [Mem2Reg] Enable promotion for bitcastable load/store values

JF Bastien via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 8 09:44:07 PST 2019


jfb added a comment.

In D56810#1360832 <https://reviews.llvm.org/D56810#1360832>, @efriedma wrote:

> > I am changing PromoteMemToReg function which can be called from other places besides mem2reg pass, so this change is not limited to mem2reg pass only.
>
> So this is primarily for the benefit of some out-of-tree pass?
>
> PromoteMemToReg is critical for performance, so changing the data structures is going to require a really deep review.
>
> > We need to create allocas outside of entry in some cases and the use of PromoteMemToReg() seems to be the only option for registerizing them.
>
> For common use-cases (e.g. clang), LLVM IR contains very few allocas outside of the entry block.  If you're working with a language which needs to produce a lot of dynamic allocas for some reason, it's probably worth implementing an optimization to hoist allocas into the entry block, where it's legal.  Not sure what sort of language construct would require that, though.


It seems Eli had open questions here. It would be good to answer them before proceeding.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D56810





More information about the llvm-commits mailing list