-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reapply "InstCombine: Introduce SimplifyDemandedUseFPClass"
This reverts commit 26bb22b.
- Loading branch information
Showing
6 changed files
with
246 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
5a36904
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.
Hi it looks like this patch breaks this code:
When compiled with
clang++ -ffast-math -O3 -std=c++17
the result is-nan
wheninf
is expected. Even though -ffast-math is used, I would still expect inf to be stored in the array.5a36904
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.
The problem is not really with this patch, but how fast math flags and nofpclass(inf nan) get applied to anything eligible to be an FPMathOperator. We end up with this:
By the definitions for ninf and nofpclass(inf), this is a poison result. Not really sure what to do with this. It would be unfortunate to either special case functions where we can't unconditionally add fast math information and about as unfortunate if we had to only apply fast math flags to specially recognized calls.