[llvm] [SCEV] BECount to zero if `((-C + (C smax %x)) /u %x), C > 0` holds (PR #104580)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 2 00:26:50 PDT 2024


antoniofrighetto wrote:

> Looks like this generalizes to any positive constant: https://alive2.llvm.org/ce/z/aS3SUe

FWIW, I was unable to generalize the original snippet to let LV generate this expression for other positive constants, which makes me dubious on whether this generalization is worth. But I guess this should be fine as far as compile-time is acceptable (also not because I couldn’t derive this from C snippets doesn't mean that other cases cannot exist where this might be relevant).

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


More information about the llvm-commits mailing list