[InstCombine] Fold `!umul_overflow(x, K) && (x * K <u C)` to `x <u ceil(C / K)`
Open
llvm:instcombine
missed-optimization
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
## Description
InstCombine appears to miss the following simplification for unsigned multiplication with overflow:
```text
!umul_overflow(x, K) && (x * K
x x x
x
Contributor guide
Research direction
The issue points to InstCombine and the llvm.umul.with.overflow intrinsic; start by locating existing InstCombine handling for this intrinsic and reproduce the reduced i32 example. Verify the transformation against the supplied Alive2 proof and confirm that the Linux-kernel pattern reduces to x < 14 without changing semantics.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100