[LV] Forced vectorization with runtime checks and OptForSize
authorSjoerd Meijer <sjoerd.meijer@arm.com>
Tue, 24 Sep 2019 08:03:34 +0000 (08:03 +0000)
committerSjoerd Meijer <sjoerd.meijer@arm.com>
Tue, 24 Sep 2019 08:03:34 +0000 (08:03 +0000)
commit0fcb3afb401c8c22383a95b515d4213659106d00
tree11c3bdd3d269a239a57cfdafa0bb09eea438072c
parent54b78f3bb6789941fec2c5898828803592e97a11
[LV] Forced vectorization with runtime checks and OptForSize

When vectorisation is forced with a pragma, we optimise for min size, and we
need to emit runtime memory checks, then allow this code growth and don't run
in an assert like we currently do.

This is the result of D65197 and D66803, and was a use-case not really
considered before. If this now happens, we emit an optimisation remark warning
about the code-size expansion, which can be avoided by not forcing
vectorisation or possibly source-code modifications.

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

llvm-svn: 372694
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/runtime-check.ll