Fix bug 22641
authorSanjoy Das <sanjoy@playingwithpointers.com>
Mon, 23 Feb 2015 22:55:13 +0000 (22:55 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Mon, 23 Feb 2015 22:55:13 +0000 (22:55 +0000)
commit7ebbc8de2fe5639906d5e8f07c4c0ff435395882
treebaf8d91218a72ca09c1fe317b0c199280ff60a7e
parent38ce6c7c1cb5bde2b187dfd0522dd15505b4d30d
Fix bug 22641

The bug was a result of getPreStartForExtend interpreting nsw/nuw
flags on an add recurrence more strongly than is legal.  {S,+,X}<nsw>
implies S+X is nsw only if the backedge of the loop is taken at least
once.

Differential Revision: http://reviews.llvm.org/D7808

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230275 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolutionExpander.cpp
test/Analysis/ScalarEvolution/scev-expander-incorrect-nowrap.ll [new file with mode: 0644]
test/Analysis/ScalarEvolution/zext-signed-addrec.ll
test/CodeGen/AArch64/arm64-scaled_iv.ll
test/CodeGen/X86/avoid_complex_am.ll
test/Transforms/IndVarSimplify/overflowcheck.ll
test/Transforms/IndVarSimplify/pr20680.ll
test/Transforms/LoopStrengthReduce/count-to-zero.ll
test/Transforms/LoopStrengthReduce/uglygep.ll