Begin incorporating target information into BBVectorize.
authorHal Finkel <hfinkel@anl.gov>
Thu, 25 Oct 2012 21:12:23 +0000 (21:12 +0000)
committerHal Finkel <hfinkel@anl.gov>
Thu, 25 Oct 2012 21:12:23 +0000 (21:12 +0000)
commitcbf9365f4c43b4f2ddc5b5a6568a5bc30359fc33
tree482623f85898133d1eb20fd5d3630381a0a4761d
parent579042f71beed38bf0ac91f3f8f3aac7f7441de2
Begin incorporating target information into BBVectorize.

This is the first of several steps to incorporate information from the new
TargetTransformInfo infrastructure into BBVectorize. Two things are done here:

 1. Target information is used to determine if it is profitable to fuse two
    instructions. This means that the cost of the vector operation must not
    be more expensive than the cost of the two original operations. Pairs that
    are not profitable are no longer considered (because current cost information
    is incomplete, for intrinsics for example, equal-cost pairs are still
    considered).

 2. The 'cost savings' computed for the profitability check are also used to
    rank the DAGs that represent the potential vectorization plans. Specifically,
    for nodes of non-trivial depth, the cost savings is used as the node
    weight.

The next step will be to incorporate the shuffle costs into the DAG weighting;
this will give the edges of the DAG weights as well. Once that is done, when
target information is available, we should be able to dispense with the
depth heuristic.

llvm-svn: 166716
llvm/lib/Transforms/Vectorize/BBVectorize.cpp
llvm/test/Transforms/BBVectorize/loop1.ll
llvm/test/Transforms/BBVectorize/simple.ll