[InstCombine] Use known overflow information for saturating add/sub
If ValueTracking can determine that the add/sub can newer overflow,
replace it with the corresponding nuw/nsw add/sub.
Additionally, for the unsigned case, if ValueTracking determines
that the add/sub always overflows, replace the result with the
saturation value.
This change is part of https://reviews.llvm.org/D54534.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347770 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed