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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 16 17:21:53 PST 2019


efriedma added a comment.

> 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.


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