OSDN Git Service

Enhance SRoA to be more aggressive about scalarization of aggregate allocas
authorChris Lattner <sabre@nondot.org>
Sun, 23 Jan 2011 08:27:54 +0000 (08:27 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 23 Jan 2011 08:27:54 +0000 (08:27 +0000)
commit145c532e68acdf70d40bab5bc2034f692848b8dc
tree69d14295488caad4ccc9b6aa1d36d3219cef5663
parent491d8d43702a76b6d73ffbd85c368a4be51c44ae
Enhance SRoA to be more aggressive about scalarization of aggregate allocas
that have PHI or select uses of their element pointers.  This can often happen
when instcombine sinks two loads into a successor, inserting a phi or select.

With this patch, we can scalarize the alloca, but the pinned elements are not
yet promoted.  This is still a win for large aggregates where only one element
is used.  This fixes rdar://8904039 and part of rdar://7339113 (poor codegen
on stringswitch).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124070 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/ScalarReplAggregates.cpp
test/Transforms/ScalarRepl/phi-select.ll [new file with mode: 0644]