Perform partial SROA on the helper hashing structure. I really wish the
authorChandler Carruth <chandlerc@gmail.com>
Sat, 7 Apr 2012 20:01:31 +0000 (20:01 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 7 Apr 2012 20:01:31 +0000 (20:01 +0000)
commit5cd79bc14ca51019af4db735d13eac95dab088ed
tree419cbe1e237acb7db2b8c217b1af17d1873b5890
parentc0d18b669674d3b173e6a3eca6ada98871bb808f
Perform partial SROA on the helper hashing structure. I really wish the
optimizers could do this for us, but expecting partial SROA of classes
with template methods through cloning is probably expecting too much
heroics. With this change, the begin/end pointer pairs which indicate
the status of each loop iteration are actually passed directly into each
layer of the combine_data calls, and the inliner has a chance to see
when most of the combine_data function could be deleted by inlining.
Similarly for 'length'.

We have to be careful to limit the places where in/out reference
parameters are used as those will also defeat the inliner / optimizers
from properly propagating constants.

With this change, LLVM is able to fully inline and unroll the hash
computation of small sets of values, such as two or three pointers.
These now decompose into essentially straight-line code with no loops or
function calls.

There is still one code quality problem to be solved with the hashing --
LLVM is failing to nuke the alloca. It removes all loads from the
alloca, leaving only lifetime intrinsics and dead(!!) stores to the
alloca. =/ Very unfortunate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154264 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/Hashing.h