OSDN Git Service

[SCEV] Suppress hoisting insertion point of binops when unsafe
authorWarren Ristow <warren.ristow@sony.com>
Wed, 8 May 2019 18:50:07 +0000 (18:50 +0000)
committerWarren Ristow <warren.ristow@sony.com>
Wed, 8 May 2019 18:50:07 +0000 (18:50 +0000)
commitf502d0e0a5e4c7e70faef410cd36355464cc5226
tree928a610182b86be4a6f9f40767806495b14e7c34
parentb0b0275b401554b2f973d78c41fc1fd6735f31d9
[SCEV] Suppress hoisting insertion point of binops when unsafe

InsertBinop tries to move insertion-points out of loops for expressions
that are loop-invariant. This patch adds a new parameter, IsSafeToHost,
to guard that hoisting. This allows callers to suppress that hoisting
for unsafe situations, such as divisions that may have a zero
denominator.

This fixes PR38697.

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

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