[clang] [clang] Add builtins for `add` with `nuw` and/or `nsw` (PR #130354)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 10 15:56:40 PDT 2025
macurtis-amd wrote:
> I'm not sure what the motivation is here
We are trying to resolve a specific optimization problem where code like [this](https://github.com/llvm/llvm-project/blob/5757da1480691eb6e452c0aaa6036d03c1660817/offload/DeviceRTL/src/Workshare.cpp#L717) trips up ScalarEvolution because it thinks the add might wrap, even though we have knowledge that it will not.
> Needs RFC
Does the above change your thoughts on this? I think this is solving a very different problem, is much more surgical in nature, and could coexist with such a feature without confusion/harm.
https://github.com/llvm/llvm-project/pull/130354
More information about the cfe-commits
mailing list