llvm-6502/lib/Transforms/Scalar
Owen Anderson a04a0649e1 Completely rework the datastructure GVN uses to represent the value number to leader mapping. Previously,
this was a tree of hashtables, and a query recursed into the table for the immediate dominator ad infinitum
if the initial lookup failed.  This led to really bad performance on tall, narrow CFGs.

We can instead replace it with what is conceptually a multimap of value numbers to leaders (actually
represented by a hashtable with a list of Value*'s as the value type), and then
determine which leader from that set to use very cheaply thanks to the DFS numberings maintained by
DominatorTree.  Because there are typically few duplicates of a given value, this scan tends to be
quite fast.  Additionally, we use a custom linked list and BumpPtr allocation to avoid any unnecessary
allocation in representing the value-side of the multimap.

This change brings with it a 15% (!) improvement in the total running time of GVN on 403.gcc, which I
think is pretty good considering that includes all the "real work" being done by MemDep as well.

The one downside to this approach is that we can no longer use GVN to perform simple conditional progation,
but that seems like an acceptable loss since we now have LVI and CorrelatedValuePropagation to pick up
the slack.  If you see conditional propagation that's not happening, please file bugs against LVI or CVP.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119714 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 18:32:40 +00:00
..
ADCE.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
BasicBlockPlacement.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
CMakeLists.txt Update CMake. 2010-10-08 02:30:03 +00:00
CodeGenPrepare.cpp Inline asm multiple alternative constraints development phase 2 - improved basic logic, added initial platform support. 2010-10-29 17:29:13 +00:00
ConstantProp.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
CorrelatedValuePropagation.cpp Have a few places that want to simplify phi nodes use SimplifyInstruction 2010-11-16 17:41:24 +00:00
DCE.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
DeadStoreElimination.cpp Enhance DSE to handle the case where a free call makes more than 2010-11-12 02:19:17 +00:00
GEPSplitter.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
GVN.cpp Completely rework the datastructure GVN uses to represent the value number to leader mapping. Previously, 2010-11-18 18:32:40 +00:00
IndVarSimplify.cpp Move SCEV::isLoopInvariant and hasComputableLoopEvolution to be member 2010-11-17 21:23:15 +00:00
JumpThreading.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
LICM.cpp Reference ScalarEvolution by name rather than directly in LICM, 2010-11-17 20:50:07 +00:00
LoopDeletion.cpp Passes do not need to recursively initialize passes that they preserve, if 2010-10-19 20:08:44 +00:00
LoopRotation.cpp Passes do not need to recursively initialize passes that they preserve, if 2010-10-19 20:08:44 +00:00
LoopStrengthReduce.cpp Move SCEV::dominates and properlyDominates to ScalarEvolution. 2010-11-17 21:41:58 +00:00
LoopUnrollPass.cpp Passes do not need to recursively initialize passes that they preserve, if 2010-10-19 20:08:44 +00:00
LoopUnswitch.cpp If dom tree information is available, make it possible to pass 2010-11-14 18:36:10 +00:00
LowerAtomic.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
Makefile
MemCpyOptimizer.cpp slightly simplify code and substantially improve comment. Instead of 2010-11-18 08:07:09 +00:00
Reassociate.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
Reg2Mem.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
Scalar.cpp
ScalarReplAggregates.cpp finish a thought. 2010-11-18 07:32:33 +00:00
SCCP.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
SimplifyCFGPass.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
SimplifyHalfPowrLibCalls.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
SimplifyLibCalls.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
Sink.cpp Add helper functions for computing the Location of load, store, 2010-11-11 21:50:19 +00:00
TailDuplication.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
TailRecursionElimination.cpp Have a few places that want to simplify phi nodes use SimplifyInstruction 2010-11-16 17:41:24 +00:00