Reapply r139247: Cache intermediate results during traceSiblingValue.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 9 Sep 2011 18:11:41 +0000 (18:11 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 9 Sep 2011 18:11:41 +0000 (18:11 +0000)
commit1ab7c8ea03d52c6fdae6fe0efae57a36c2f701c3
tree4b814036882f1cff278c49cfa29fa0fc95eda064
parent39d7802224532c075f4c781c3e51ffed83d17420
Reapply r139247: Cache intermediate results during traceSiblingValue.

In some cases such as interpreters using indirectbr, the CFG can be very
complicated, and live range splitting may be forced to insert a large
number of phi-defs.  When that happens, traceSiblingValue can spend a
lot of time zipping around in the CFG looking for defs and reloads.

This patch causes more information to be cached in SibValues, and the
cached values are used to terminate searches early.  This speeds up
spilling by 20x in one interpreter test case.  For more typical code,
this is just a 10% speedup of spilling.

The previous version had bugs that caused miscompilations. They have
been fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139378 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/InlineSpiller.cpp