[llvm] [SCEVDivision] Prevent propagation of incorrect no-wrap flags (PR #154745)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 00:59:04 PDT 2025


nikic wrote:

@kasuga-fj I'm not entirely sure. The only user of SCEVDivision is Delinearization -- maybe it has some additional checks or assumptions that make it safe? But I suspect that it's broken.

>From a quick test, requiring mul nsw in SCEVDivision breaks lots of tests. But it also looks like many places in Delinearization fail to preserve nowrap flags on multiplies, so maybe some of this can be recovered?

https://github.com/llvm/llvm-project/blob/2b46f31ee332b7ff3d22b4fffdba12e231b3f796/llvm/lib/Analysis/Delinearization.cpp#L158
https://github.com/llvm/llvm-project/blob/6560adb5840596afbeb3f4574bf6d0c52e439d69/llvm/lib/Analysis/Delinearization.cpp#L217
https://github.com/llvm/llvm-project/blob/6560adb5840596afbeb3f4574bf6d0c52e439d69/llvm/lib/Analysis/Delinearization.cpp#L276

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


More information about the llvm-commits mailing list