[LV] Mark first-order recurrences as allowed exits
authorAyal Zaks <ayal.zaks@intel.com>
Wed, 15 Apr 2020 14:04:01 +0000 (17:04 +0300)
committerAyal Zaks <ayal.zaks@intel.com>
Sat, 18 Apr 2020 20:54:21 +0000 (23:54 +0300)
commit8e0c5f72005855377197d0f8eb851d7cb889c834
treee6ccbe651eb3147b553f35fe3cfa1857bb167fb0
parent7fde990694f5d1fc4812c4e77e86899e61783b8a
[LV] Mark first-order recurrences as allowed exits

First-order recurrences require special treatment when they are live-out;
such treatment is provided by fixFirstOrderRecurrence(), so they should be
included in AllowedExit set.

(Should probably have been included originally in D16197.)

Fixes PR45526: AllowedExit set is used by prepareToFoldTailByMasking() to
check whether the treatment for live-outs also holds when folding the tail,
which is not (yet) the case for first-order recurrences.

Differential Revision: https://reviews.llvm.org/D78210
llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
llvm/test/Transforms/LoopVectorize/optsize.ll