[SCEV] Guard movement of insertion point for loop-invariants
authorWarren Ristow <warren.ristow@sony.com>
Fri, 30 Nov 2018 00:02:54 +0000 (00:02 +0000)
committerWarren Ristow <warren.ristow@sony.com>
Fri, 30 Nov 2018 00:02:54 +0000 (00:02 +0000)
commit72d1f3a285d515ba92dc71c6d775f6d1ebeb9442
tree257eb35ff75877b9564aa86fa7f2613e33718753
parent63f084bd7a899006a4699ac210aa0c5471bf3d71
[SCEV] Guard movement of insertion point for loop-invariants

r320789 suppressed moving the insertion point of SCEV expressions with
dev/rem operations to the loop header in non-loop-invariant situations.
This, and similar, hoisting is also unsafe in the loop-invariant case,
since there may be a guard against a zero denominator. This is an
adjustment to the fix of r320789 to suppress the movement even in the
loop-invariant case.

This fixes PR30806.

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

llvm-svn: 347934
llvm/lib/Analysis/ScalarEvolutionExpander.cpp
llvm/test/Transforms/LoopVectorize/pr30806.ll [new file with mode: 0644]