diff options
author | Sjoerd Meijer <sjoerd.meijer@arm.com> | 2019-09-03 08:38:24 +0000 |
---|---|---|
committer | Sjoerd Meijer <sjoerd.meijer@arm.com> | 2019-09-03 08:38:24 +0000 |
commit | 0469b0e4ef71ae4ae1f81055bc5399e04ac11927 (patch) | |
tree | 7ce4b1ffad1089e175fafb1b55eb4c37840fc10a | |
parent | b10a433da85ea20c0e1f5b5b35c2cf8bd5cf3ac0 (diff) | |
download | bcm5719-llvm-0469b0e4ef71ae4ae1f81055bc5399e04ac11927.tar.gz bcm5719-llvm-0469b0e4ef71ae4ae1f81055bc5399e04ac11927.zip |
[LV] Tail-folding with runtime memory checks
The loop vectorizer was running in an assert when it tried to fold the tail and
had to emit runtime memory disambiguation checks.
Differential revision: https://reviews.llvm.org/D66803
llvm-svn: 370707
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 478174f8251..4f67aa1f322 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -2697,6 +2697,7 @@ void InnerLoopVectorizer::emitSCEVChecks(Loop *L, BasicBlock *Bypass) { assert(!Cost->foldTailByMasking() && "Cannot SCEV check stride or overflow when folding tail"); + // Create a new block containing the stride check. BB->setName("vector.scevcheck"); auto *NewBB = BB->splitBasicBlock(BB->getTerminator(), "vector.ph"); @@ -2729,7 +2730,9 @@ void InnerLoopVectorizer::emitMemRuntimeChecks(Loop *L, BasicBlock *Bypass) { if (!MemRuntimeCheck) return; - assert(!Cost->foldTailByMasking() && "Cannot check memory when folding tail"); + assert(!BB->getParent()->hasOptSize() && + "Cannot emit memory checks when optimizing for size"); + // Create a new block containing the memory check. BB->setName("vector.memcheck"); auto *NewBB = BB->splitBasicBlock(BB->getTerminator(), "vector.ph"); |