This pass hoists common computations across branches sharing common immediate
dominator. Like early-cse, the primary goal of early-gvn is to reduce the size
of functions before inline heuristics to reduce the total cost of function
inlining. In some cases this pass also reduces the critical path by exposing
more ILP.
The pass addresses the comments from Daniel Berlin from the previous review at http://reviews.llvm.org/D18710:
in particular, the complexity of the pass is now O(N) with N the number of instructions in the blocks where code hoisting is applied.
The pass works on the existing GVN from trunk, and can be ported to Danny's NewGVN by updating the calls to the VN look-ups.
Passes llvm regression test and test-suite.
Pass written by:
Sebastian Pop
Aditya Kumar
Xiaoyu Hu
Brian Rzycki
It makes very little sense IMO to do early-cse and then early-gvn... The only point of early-cse was to be a substantially lighter weight CSE than GVN. If you're going to run GVN anyways to do hoisting, just run GVN.
Either way, I strongly suspect this should be conditioned on O3...