[llvm] [SCEV] Preserve divisibility info when creating UMax/SMax expressions. (PR #160012)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 23 02:26:13 PDT 2025
fhahn wrote:
> > Hmm, I think the current code relies on the fact that the UMax/SMax with the constant is coming from a compare w/o the constant part on the left side.
> > Are there any particluar cases you are thinking of on construction?
>
> What I meant is that we can generally fold `umax(C1, C2*x)` with `C2>C1` and `x!=0` to `umax(C2, C2*x)`. But I guess `x!=0` is the critical part here -- we generally do not know that outside the guard context (or rather, can't ignore it outside the guard context).
Yep, I can try to see if this would also trigger in practice at construction, but we would still need the guard-specific logic w/o the != 0 check
https://github.com/llvm/llvm-project/pull/160012
More information about the llvm-commits
mailing list