OSDN Git Service

Address one of the original FIXMEs for the new SROA pass by implementing
authorChandler Carruth <chandlerc@gmail.com>
Mon, 24 Sep 2012 00:34:20 +0000 (00:34 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 24 Sep 2012 00:34:20 +0000 (00:34 +0000)
commitbc4021f31eaa97ee52655828da3e3de14a39e4a6
tree18f04e851fc7f89a90e5f775f5a6ff41ca1473cf
parent371e17c03c3169459c84986d4a318f6d6d3f8730
Address one of the original FIXMEs for the new SROA pass by implementing
integer promotion analogous to vector promotion. When there is an
integer alloca being accessed both as its integer type and as a narrower
integer type, promote the narrower access to "insert" and "extract" the
smaller integer from the larger one, and make the integer alloca
a candidate for promotion.

In the new formulation, we don't care about target legal integer or use
thresholds to control things. Instead, we only perform this promotion to
an integer type which the frontend has already emitted a load or store
for. This bounds the scope and prevents optimization passes from
coalescing larger and larger entities into a single integer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164479 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SROA.cpp
test/Transforms/SROA/basictest.ll