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)
commit65309660fa61a837cc05323f69c618a7d8134d56
treeeee828ea648d4a984d4c67c45a43dcae48cf2301
parent3ef9dfa6858e25015c3e36b2f1a0ba5ebdea80d2
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166716 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/BBVectorize.cpp
test/Transforms/BBVectorize/loop1.ll
test/Transforms/BBVectorize/simple.ll