]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commit
Fix PR22222
authorSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 15 Jan 2015 01:46:09 +0000 (01:46 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 15 Jan 2015 01:46:09 +0000 (01:46 +0000)
commit7ec1829823276e4e20648bc13b40567bf39d4e03
treef33602276beec1e0c363004fceb8a43ed95ea194
parent5a40bef7979813149432fba5f6f287f2eb7dc5a2
Fix PR22222

The bug was introduced in r225282. r225282 assumed that sub X, Y is
the same as add X, -Y. This is not correct if we are going to upgrade
the sub to sub nuw. This change fixes the issue by making the
optimization ignore sub instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226075 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyIndVar.cpp
test/Transforms/IndVarSimplify/pr22222.ll [new file with mode: 0644]
test/Transforms/IndVarSimplify/strengthen-overflow.ll