[llvm] [SCEV] Preserve divisibility info when creating UMax/SMax expressions. (PR #160012)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 22 13:53:26 PDT 2025
nikic 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).
https://github.com/llvm/llvm-project/pull/160012
More information about the llvm-commits
mailing list