There are *_ov() functions already, so at least for consistency it may be good to also have saturating variants.
These may or may not be needed for ConstantRange's shlWithNoWrap()
Details
Details
- Reviewers
spatel nikic - Commits
- rG1cc8e1e1d7d7: [APInt] Add saturating left-shift ops
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM
llvm/unittests/ADT/APIntTest.cpp | ||
---|---|---|
1225 | It's a bit weird that out-of-bounds shift amounts have well-defined behavior here, but as this is an existing behavior of shl_ov, I guess it makes sense. |
It's a bit weird that out-of-bounds shift amounts have well-defined behavior here, but as this is an existing behavior of shl_ov, I guess it makes sense.