[llvm] LangRef: Clarify behaviors of nsz in fast math flag (PR #137567)
Serge Pavlov via llvm-commits
llvm-commits at lists.llvm.org
Fri May 16 10:47:41 PDT 2025
spavloff wrote:
> > I'm not claiming that it's useful to do that. I'd be surprised if that ever happened. What I'm saying is that I don't understand why we need the restriction in the definition to say that it can't happen. If it's not useful, it won't happen.
>
> Because it's useful to have that defined, and get alive2 to agree on the rules. If we want to verify optimization as correct we need to better define what those rules are. Getting alive2 to not complain is the only problem being solved here
It is OK to restrict the general rule to aligh the behavior with alive2 or to avoid some unwanted things. After all, there is no a specification for `nsz`, which would demand strictly defined behavior. The concern is that the documentation includes wording that cannot help a developer to properly handle `nsz`. These limitations look arbitrary and no explanation for them is provided.
A more detailed comment in the code where nsz is handled with the problematic instructions could be more useful for the developer who would like to enhance the treatment of `nsz`.
https://github.com/llvm/llvm-project/pull/137567
More information about the llvm-commits
mailing list