Add the nsw flag when we detect that an add will not signed overflow.
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 2 Jun 2014 14:32:58 +0000 (14:32 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 2 Jun 2014 14:32:58 +0000 (14:32 +0000)
commitd958619a2dbc7422fcd342849a898790a0bb082b
treedb8b00a4db1d17641221b889d010205cdbcdecdf
parente53c5d3baa3d49b27b3b6ffd0b30be9dea820425
Add the nsw flag when we detect that an add will not signed overflow.

We already had a function for checking this, we were just using it only in
specialized cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210029 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAddSub.cpp
test/Transforms/InstCombine/cast.ll
test/Transforms/InstCombine/ffs-1.ll
test/Transforms/InstCombine/rem.ll
test/Transforms/InstCombine/select.ll
test/Transforms/InstCombine/sext.ll
test/Transforms/InstCombine/zext-bool-add-sub.ll