llvm-project/llvm/lib
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
..
Analysis Use std::string::size_type for for ColonPos to stop gcc from giving a warning 2003-10-01 22:49:22 +00:00
AsmParser The objects mapped are really PATypeHolders, not PATypeHandles 2003-10-02 19:00:34 +00:00
Bytecode Rename AbstractModuleProvider -> ModuleProvider, to match the header file name, 2003-10-04 20:14:59 +00:00
CWriter A couple of minor code cleanups. 2003-10-05 00:40:51 +00:00
CodeGen Moved enum and command-line option in separate file. Also added function that returns the user selected register allocator to the caller. 2003-10-02 16:57:49 +00:00
ExecutionEngine Squelch warning 2003-09-22 20:33:34 +00:00
Support Move support/lib/Support back to lib/Support 2003-10-05 19:24:38 +00:00
Target Add support for the Invoke instruction by using the LowerInvoke pass 2003-10-05 19:16:09 +00:00
Transforms Speed up the mem2reg transform for allocas which are only read/written in a single 2003-10-05 20:54:03 +00:00
VMCore Be more careful handling PHI nodes, which might be of potentially high degree. 2003-10-05 17:44:18 +00:00
Makefile Removed Support directory. It now lives in llvm/support/lib. 2003-09-29 16:10:43 +00:00