[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 10:19:21 PST 2019


jfb added a comment.

In D56810#1422913 <https://reviews.llvm.org/D56810#1422913>, @sdmitriev wrote:

> Ok. As I said earlier we need to created allocas outside of the entry block, and hoisting allocas to the entry block as Eli suggested above would definitely solve the registerization problem because of SROA, but in our case these allocas cannot be hoisted therefore SROA just does not look at them. So calling PromoteMemToReg for such allocas seems to be the only way to force registerization for them. That is the reason why I am trying to enhance it to handle bitcasts even though this functionality already exists in SROA.


Why can't the allocas be hoisted? It goes against the grain of what IR expects, and adds some complexity as well as duplicates optimizations. If we start supporting this use case better, I'd rather understand why. Maybe it has other implications.


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