Hoist the rest of the logic for fully promoting allocas with all uses in
authorChandler Carruth <chandlerc@gmail.com>
Sun, 21 Jul 2013 01:44:07 +0000 (01:44 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 21 Jul 2013 01:44:07 +0000 (01:44 +0000)
commit5dc22183f9d076cdbac4fc478f84abf58240661d
tree33bbc0a387be712209998aa087672549f6a862ca
parentf61d7e8afa01858e07bf5b3450f40239fc10d1dd
Hoist the rest of the logic for fully promoting allocas with all uses in
a single block into the helper routine. This takes advantage of the fact
that we can directly replace uses prior to any store with undef to
simplify matters and unconditionally promote allocas only used within
one block.

I've removed the special handling for the case of no stores existing.
This has no semantic effect but might slow things down. I'll fix that in
a later patch when I refactor this entire thing to be easier to manage
the different cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186783 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/PromoteMemoryToRegister.cpp