OSDN Git Service

[SCEV] Guard movement of insertion point for loop-invariants
authorWarren Ristow <warren.ristow@sony.com>
Mon, 18 Mar 2019 18:52:35 +0000 (18:52 +0000)
committerWarren Ristow <warren.ristow@sony.com>
Mon, 18 Mar 2019 18:52:35 +0000 (18:52 +0000)
commitb017ce4be93bc6987b85344b5c73fe37bb2f1b2a
tree56bd6f064bf9bc63584d9c7fa214521a6e578a01
parentcebbea718141099c65c327532d4ffbf4e8745789
[SCEV] Guard movement of insertion point for loop-invariants

This reinstates r347934, along with a tweak to address a problem with
PHI node ordering that that commit created (or exposed). (That commit
was reverted at r348426, due to the PHI node issue.)

Original commit message:

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/D57428

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356392 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolutionExpander.cpp
test/Transforms/LoopVectorize/pr30806-phi-scev.ll [new file with mode: 0644]
test/Transforms/LoopVectorize/pr30806.ll [new file with mode: 0644]