llvm-project/llvm/lib/Transforms
Chris Lattner 8047152977 Speed up the mem2reg transform for allocas which are only read/written in a single
basic block.  This is amazingly common in code generated by the C/C++ front-ends.
This change makes it not have to insert ANY phi nodes, whereas before it would insert
a ton of dead ones which DCE would have to clean up.

Thus, this fix improves compile-time performance of these trivial allocas in two ways:
  1. It doesn't have to do the walking and book-keeping for renaming
  2. It does not insert dead phi nodes for them which would have to
     subsequently be cleaned up.

On my favorite testcase from 252.eon, this special case handles 305 out of
356 promoted allocas in the function.  It speeds up the mem2reg pass from 7.5256s
to 1.2505s.  It inserts 677 fewer dead PHI nodes, which speeds up a subsequent
-dce pass from 18.7524s to 2.4806s.

There are still 120 trivially dead PHI nodes being inserted for variables used
in multiple basic blocks, but they are not handled by this patch.

llvm-svn: 8881
2003-10-05 20:54:03 +00:00
..
Hello Initial checkin of the "Hello World" Pass. 2002-08-08 20:10:38 +00:00
IPO Credits are now in top-level CREDITS.TXT 2003-09-22 21:57:15 +00:00
Instrumentation Use global *_iterator 2003-09-24 22:07:33 +00:00
Scalar Initial checkin of the LLVM->LLVM transform to support code generators which 2003-10-05 19:14:42 +00:00
Utils Speed up the mem2reg transform for allocas which are only read/written in a single 2003-10-05 20:54:03 +00:00
ExprTypeConvert.cpp Spell `necessary' correctly. 2003-08-18 14:43:39 +00:00
LevelRaise.cpp Prototype for creator function got moved 2003-09-01 20:45:33 +00:00
Makefile Convert DIRS to PARALLEL_DIRS. They can be built independently. 2002-09-29 11:52:14 +00:00
TransformInternals.cpp avoid dividing by zero when dealing with zero sized types (like [0 x double]) 2003-06-23 17:36:49 +00:00
TransformInternals.h The word `dependent' has no `a'. 2003-08-21 22:14:26 +00:00