LoopVectorizer: Emit memory checks into their own basic block.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 19 Jan 2013 13:57:58 +0000 (13:57 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 19 Jan 2013 13:57:58 +0000 (13:57 +0000)
commit1af132dcf3c9fd87ac8ad0c103e74ef3f8a0bae6
treefa145c9a97e7d47d32e2188048f1836f1a19895a
parentba9586544164e69754039a25cb0ef7907d27382d
LoopVectorizer: Emit memory checks into their own basic block.

This separates the check for "too few elements to run the vector loop" from the
"memory overlap" check, giving a lot nicer code and allowing to skip the memory
checks when we're not going to execute the vector code anyways. We still leave
the decision of whether to emit the memory checks as branches or setccs, but it
seems to be doing a good job. If ugly code pops up we may want to emit them as
separate blocks too. Small speedup on MultiSource/Benchmarks/MallocBench/espresso.

Most of this is legwork to allow multiple bypass blocks while updating PHIs,
dominators and loop info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172902 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/runtime-check.ll