OSDN Git Service

Merging rr217102:
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 8 Dec 2014 08:50:22 +0000 (08:50 +0000)
committerWuZhen <wuzhen@jidemail.com>
Tue, 23 Feb 2016 11:25:56 +0000 (19:25 +0800)
commit01512599002ff827150921a9482abf8542230c05
tree7d52b015feb1a215f6d77c36b3fb1df1ee6842ed
parent3b87a6aacf5a45945ee3a2a636e4a7c1927a19da
Merging rr217102:
------------------------------------------------------------------------
r217102 | majnemer | 2014-09-03 16:03:18 -0700 (Wed, 03 Sep 2014) | 11 lines

IndVarSimplify: Don't let LFTR compare against a poison value

LinearFunctionTestReplace tries to use the *next* indvar to compare
against when possible.  However, it may be the case that the calculation
for the next indvar has NUW/NSW flags and that it may only be safely
used inside the loop.  Using it in a comparison to calculate the exit
condition could result in observing poison.

This fixes PR20680.

Differential Revision: http://reviews.llvm.org/D5174
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223637 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/IndVarSimplify.cpp
test/Transforms/IndVarSimplify/2011-10-27-lftrnull.ll
test/Transforms/IndVarSimplify/lftr-address-space-pointers.ll
test/Transforms/IndVarSimplify/lftr-extend-const.ll
test/Transforms/IndVarSimplify/lftr-reuse.ll
test/Transforms/IndVarSimplify/pr20680.ll [new file with mode: 0644]