-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[SelectionDAGBuilder] Remove NoNaNsFPMath uses #169904
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
Open
paperchalice
wants to merge
12
commits into
llvm:main
Choose a base branch
from
paperchalice:db-nnan
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,947
−3,090
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e2cbee6
[SelectionDAG] Remove NoNaNsFPMath
paperchalice 15378a3
[X86] Consider fast-math flags when combining select
paperchalice 6e0080b
Fix X86 tests
paperchalice a0735be
Fix PowerPC tests
paperchalice ea7082a
Fix AArch64 tests
paperchalice 652f1f5
[DAGCombiner] Consider fast-math flags from SetCC in getMinMaxOpcodeF…
paperchalice c37e814
[AMDGPU] Consider fast-math flags from source in isCanonicalized
paperchalice 36a9f4a
Fix AMDGPU tests
paperchalice 1c94fbe
fix setcc-fp in rv
paperchalice 2270a5c
Regenerate test/CodeGen/X86/avx10_2-cmp.ll
paperchalice 6000dae
fix tests
paperchalice a5d84db
Fix CodeGen/ARM/fp16-vminmaxnm-safe.ll
paperchalice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48011,6 +48011,8 @@ static SDValue combineSelect(SDNode *N, SelectionDAG &DAG, | |
| } | ||
|
|
||
| if (Opcode) { | ||
| // Propagate fast-math-flags. | ||
| SelectionDAG::FlagInserter FlagsInserter(DAG, N->getFlags()); | ||
| if (IsStrict) { | ||
| SDValue Ret = DAG.getNode(Opcode == X86ISD::FMIN ? X86ISD::STRICT_FMIN | ||
| : X86ISD::STRICT_FMAX, | ||
|
|
@@ -55532,8 +55534,9 @@ static SDValue combineFMinFMax(SDNode *N, SelectionDAG &DAG) { | |
| assert(N->getOpcode() == X86ISD::FMIN || N->getOpcode() == X86ISD::FMAX); | ||
|
|
||
| // FMIN/FMAX are commutative if no NaNs and no negative zeros are allowed. | ||
| if (!DAG.getTarget().Options.NoNaNsFPMath || | ||
| !DAG.getTarget().Options.NoSignedZerosFPMath) | ||
| if ((!DAG.getTarget().Options.NoNaNsFPMath && !N->getFlags().hasNoNaNs()) || | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain why
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This PR should modify as few test cases as possible. |
||
| (!DAG.getTarget().Options.NoSignedZerosFPMath && | ||
| !N->getFlags().hasNoSignedZeros())) | ||
| return SDValue(); | ||
|
|
||
| // If we run in unsafe-math mode, then convert the FMAX and FMIN nodes | ||
|
|
||
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It is a bit weird to use a recursive ValueTracing query in the backend. I'd expect it to get canonicalized in InstCombine before the codegen. https://godbolt.org/z/r13WvTE3b