[LV] Don't bail to MiddleBlock if a runtime check fails, bail to ScalarPH instead
authorJames Molloy <james.molloy@arm.com>
Wed, 2 Sep 2015 10:15:39 +0000 (10:15 +0000)
committerJames Molloy <james.molloy@arm.com>
Wed, 2 Sep 2015 10:15:39 +0000 (10:15 +0000)
commit6ce50a698003d34ce5a8abdde560c9745b470a9d
tree0263ca50211696feaa7f8d00f1cdf913335d845a
parente2568a81dcc3c64b48315c57bbc66a4be383da88
[LV] Don't bail to MiddleBlock if a runtime check fails, bail to ScalarPH instead

We were bailing to two places if our runtime checks failed. If the initial overflow check failed, we'd go to ScalarPH. If any other check failed, we'd go to MiddleBlock. This caused us to have to have an extra PHI per induction and reduction as the vector loop's exit block was not dominated by its latch.

There's no need to have this behavior - if we just always go to ScalarPH we can get rid of a bunch of complexity.

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