[llvm] [LV] Rewrite UDiv A, B -> UDiv A, UMax(B, 1) in trip counts if needed. (PR #92177)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 1 09:23:54 PDT 2024


fhahn wrote:

(replying in main thread, as the comment seems to be gone from the web interface, at least I cannot respond to it any longer)
> There's one more case here I wasn't thinking about: udiv where the RHS is poison. umax isn't sufficient in that case because umax(1,poison) is still poison,

Ah yes! In those cases, we need to freeze RHS, but I don't think we can enforce this via a SCEV rewrite, but need to tell this to the expander

https://github.com/llvm/llvm-project/pull/92177


More information about the llvm-commits mailing list