-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PPC] relax fastmath test #38850
[PPC] relax fastmath test #38850
Conversation
I'm not sure of the purpose of any of these tests. Isn't this undefined behavior for "fast" math and the program is allowed to do anything when encountering a NaN or Inf value. |
Yes, these tests are over-zealous. As @vtjnash suggests, they only test incidental behaviour. They could be replace by test that merely ensure that these tests do not throw an exception. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could say isa T
instead of != one
.
a57e400
to
c5d4ae6
Compare
There’s no guarantee this doesn’t throw, or other much worse things. |
I see that LLVM's definition for the fast-math behaviour has changed over time. It used to guarantee that the resulting behaviour is an undefined value, but won't throw. This is now different – the fast-math flags seem to require that nans and infs are detected and produce a poison value? I'm not familiar enough with poison values to see how this could be implemented efficiently. |
@eschnett a With regard to this PR. Should I remove the tests since the explicitly result in undef/poison? |
@vchuravy If you confirm that these tests should not be there (according to https://llvm.org/docs/LangRef.html#fast-math-flags), then yes, please remove them. |
c5d4ae6
to
d526f27
Compare
Yes that is my reading of the spec. |
@vchuravy I would just remove these lines. |
d526f27
to
b1dbee0
Compare
@shirodkara if I recall our discussion correctly the backend stance was there is no guarantee that
this operations yield
Inf
under fastmath?