LSR Fix: check SCEV expression safety before expansion.
authorAndrew Trick <atrick@apple.com>
Fri, 13 Jul 2012 23:33:10 +0000 (23:33 +0000)
committerAndrew Trick <atrick@apple.com>
Fri, 13 Jul 2012 23:33:10 +0000 (23:33 +0000)
commite08c32249fca32cd7b122024a4ca252fcb235694
tree923f5912e0f49151d6ce7ff084b99bc6cec72c3e
parent31f61e8b221eee4f839687e9ec4df89a469a2652
LSR Fix: check SCEV expression safety before expansion.

All SCEV expressions used by LSR formulae must be safe to
expand. i.e. they may not contain UDiv unless we can prove nonzero
denominator.

Fixes PR11356: LSR hoists UDiv.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160205 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ScalarEvolutionExpander.h
lib/Analysis/ScalarEvolutionExpander.cpp
lib/Transforms/Scalar/LoopStrengthReduce.cpp
test/Transforms/LoopStrengthReduce/2012-07-13-ExpandUDiv.ll [new file with mode: 0644]