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)
commit913dfd8f7f88645fc4de85fc28b0209448a9edfe
treef43b34a92bb148d8c7d68fba31218930f20777bc
parentd26f95bc949b98d4c092c79ae0ab689d29889e7a
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

llvm-svn: 230275
llvm/lib/Analysis/ScalarEvolutionExpander.cpp
llvm/test/Analysis/ScalarEvolution/scev-expander-incorrect-nowrap.ll [new file with mode: 0644]
llvm/test/Analysis/ScalarEvolution/zext-signed-addrec.ll
llvm/test/CodeGen/AArch64/arm64-scaled_iv.ll
llvm/test/CodeGen/X86/avoid_complex_am.ll
llvm/test/Transforms/IndVarSimplify/overflowcheck.ll
llvm/test/Transforms/IndVarSimplify/pr20680.ll
llvm/test/Transforms/LoopStrengthReduce/count-to-zero.ll
llvm/test/Transforms/LoopStrengthReduce/uglygep.ll