]> granicus.if.org Git - llvm/commit
[LV] Emitting SCEV checks with OptForSize
authorSjoerd Meijer <sjoerd.meijer@arm.com>
Wed, 9 Oct 2019 13:19:41 +0000 (13:19 +0000)
committerSjoerd Meijer <sjoerd.meijer@arm.com>
Wed, 9 Oct 2019 13:19:41 +0000 (13:19 +0000)
commit06256489706ea4015695cd8a4be669b01c764007
tree1089f7ad3fc001af2ff1a92d8fdbfdb8071d1e67
parent0dc71c318eff769b1fa78c3385be0ad3ca58e979
[LV] Emitting SCEV checks with OptForSize

When optimising for size and SCEV runtime checks need to be emitted to check
overflow behaviour, the loop vectorizer can run in this assert:

  LoopVectorize.cpp:2699: void llvm::InnerLoopVectorizer::emitSCEVChecks(
  llvm::Loop *, llvm::BasicBlock *): Assertion `!BB->getParent()->hasOptSize()
  && "Cannot SCEV check stride or overflow when opt

We should not generate predicates while optimising for size because
code will be generated for predicates such as these SCEV overflow runtime
checks.

This should fix PR43371.

Differential Revision: https://reviews.llvm.org/D68082

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