[llvm] r370707 - [LV] Tail-folding with runtime memory checks
Sjoerd Meijer via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 3 01:38:25 PDT 2019
Author: sjoerdmeijer
Date: Tue Sep 3 01:38:24 2019
New Revision: 370707
URL: http://llvm.org/viewvc/llvm-project?rev=370707&view=rev
Log:
[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
Modified:
llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=370707&r1=370706&r2=370707&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Tue Sep 3 01:38:24 2019
@@ -2697,6 +2697,7 @@ void InnerLoopVectorizer::emitSCEVChecks
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::emitMemRuntime
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");
More information about the llvm-commits
mailing list