[KnownBits] Add implementations for saturating add/sub functions
authorNoah Goldstein <goldstein.w.n@gmail.com>
Tue, 23 May 2023 16:13:13 +0000 (11:13 -0500)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Tue, 23 May 2023 18:52:40 +0000 (13:52 -0500)
commit5f50b180c50e5108b8b18d167147bef8c00fe532
tree399013ee4f3c259900a350ca5e3d190e1547348f
parent1e963b40813e18e3b285cab35a05b5e0fe166eec
[KnownBits] Add implementations for saturating add/sub functions

These where previously missing. Even in the case where overflow is
indeterminate we can still deduce some of the low/high bits.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D150102
llvm/include/llvm/Support/KnownBits.h
llvm/lib/Support/KnownBits.cpp
llvm/unittests/Support/KnownBitsTest.cpp