InstCombine: Annotate sub with nuw when we prove it's safe
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 20 Aug 2014 07:17:31 +0000 (07:17 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 20 Aug 2014 07:17:31 +0000 (07:17 +0000)
commit99e941fd9a39fc6677ce297abacd1cfbd67c0838
treeca8d5b9f74277921f2783e6355927c9a6d2c8c60
parent78832c6e7d33094c6ef9e99b07dac6f60c0a1207
InstCombine: Annotate sub with nuw when we prove it's safe

We can prove that a 'sub' can be a 'sub nuw' if the left-hand side is
negative and the right-hand side is non-negative.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216045 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombine.h
lib/Transforms/InstCombine/InstCombineAddSub.cpp
test/Transforms/InstCombine/sub.ll