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)
commit92924fd28fd4d0678df72f66e02d3310416ba0e6
treef03df4cc6c5d8ccbe89f6a45ac0be6886debf098
parentf5a898c30598ca6c9e1dc320197ede869b12692b
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.

llvm-svn: 164479
llvm/lib/Transforms/Scalar/SROA.cpp
llvm/test/Transforms/SROA/basictest.ll