[llvm] [KnownBits] Fix add() SelfAdd assertion for bitwidths >= 512 (PR #202769)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 10 04:09:18 PDT 2026
jayfoad wrote:
I think I would prefer to fix this inside getMaxShiftAmount, otherwise other callers could hit the same kind of problem. How about something like:
```
return MaxValue.extractBitsAsZExtValue(std::min(Log2_32(BitWidth), MaxValue.getBitWidth()), 0);
```
The std::min behaviour should be fine because shift amounts are always unsigned.
Not sure if there is a simpler way to code this.
https://github.com/llvm/llvm-project/pull/202769
More information about the llvm-commits
mailing list