[LoopVectorizer] Improve handling of branches during cost estimation.
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Wed, 12 Apr 2017 13:13:15 +0000 (13:13 +0000)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Wed, 12 Apr 2017 13:13:15 +0000 (13:13 +0000)
commit592dbea779378edbeee811cee9facfa355a6b5d3
tree746cd1cf5359337ed27a1bbc1756e848542b807f
parent3b97ea39e76af6edfcf38075c75ff8d87e989d84
[LoopVectorizer]  Improve handling of branches during cost estimation.

The cost for a branch after vectorization is very different depending on if
the vectorizer will if-convert the block (branch is eliminated), or if
scalarized and predicated blocks will be produced (branch duplicated before
each block). There is also the case of remaining scalar branches, such as the
back-edge branch.

This patch handles these cases differently with TTI based cost estimates.

Review: Matthew Simpson
https://reviews.llvm.org/D31175

llvm-svn: 300058
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/SystemZ/branch-for-predicated-block.ll [new file with mode: 0644]