Now that mem2reg understands how to cope with a slightly wider set of
authorChandler Carruth <chandlerc@gmail.com>
Sun, 28 Jul 2013 08:27:12 +0000 (08:27 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 28 Jul 2013 08:27:12 +0000 (08:27 +0000)
commitcea60aff34ada256a77f5760863218a976786f45
treed0f2e7810ecd6b791b1a17ab98400e91cee63111
parent6c3a95dab561ef9747876d14014e965f8688f55b
Now that mem2reg understands how to cope with a slightly wider set of
uses of an alloca, we can pre-compute promotability while analyzing an
alloca for splitting in SROA. That lets us short-circuit the common case
of a bunch of trivially promotable allocas. This cuts 20% to 30% off the
run time of SROA for typical frontend-generated IR sequneces I'm seeing.
It gets the new SROA to within 20% of ScalarRepl for such code. My
current benchmark for these numbers is PR15412, but it fits the general
pattern of IR emitted by Clang so it should be widely applicable.

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