-
Notifications
You must be signed in to change notification settings - Fork 13.7k
CodeGen: Add ISD::AssertNoFPClass #138839
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
1721631
CodeGen: Add ISD::AssertNoFPClass
wzssyqa 4d4991c
fix typo assernofpclass
wzssyqa aeed855
Add isKnownNeverNaN test
wzssyqa e10e320
Mention operands
wzssyqa 485b54c
Fix typo
wzssyqa c121d50
Fix AssertNoFPClass assert
wzssyqa cc283ff
Fix code styles
wzssyqa 8e54b1d
Add Vector test case
wzssyqa 71ae484
Add DemandedElts
wzssyqa 73787cb
Use 32bit target
wzssyqa 4522945
Fix MERGE_VALUE cases
wzssyqa 392dca4
Add aggregate tests with fmin
wzssyqa 6656010
Fix comment
wzssyqa 3fce363
Add snan and qnan test cases
wzssyqa 26ef32b
Test both array and struct
wzssyqa dcd5dd2
Fix WidenVectorResult
wzssyqa 3885201
Fix PromoteHalf support
wzssyqa e85af1a
Use seperate function for assertnofpclass
wzssyqa e6c2192
Fix wrong dead code from SoftPromoteHalfRes_UnaryOp
wzssyqa bf50d75
Fix internal error
wzssyqa 5ac47f6
Fix code style
wzssyqa 1b77723
PromoteFloatRes_AssertNoFPClass: conservative stripping
wzssyqa 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5831,6 +5831,15 @@ bool SelectionDAG::isKnownNeverNaN(SDValue Op, const APInt &DemandedElts, | |
return false; | ||
return true; | ||
} | ||
case ISD::AssertNoFPClass: { | ||
FPClassTest NoFPClass = | ||
static_cast<FPClassTest>(Op.getConstantOperandVal(1)); | ||
if ((NoFPClass & fcNan) == fcNan) | ||
return true; | ||
if (SNaN && (NoFPClass & fcSNan) == fcSNan) | ||
return true; | ||
return isKnownNeverNaN(Op.getOperand(0), DemandedElts, SNaN, Depth + 1); | ||
} | ||
default: | ||
if (Opcode >= ISD::BUILTIN_OP_END || Opcode == ISD::INTRINSIC_WO_CHAIN || | ||
Opcode == ISD::INTRINSIC_W_CHAIN || Opcode == ISD::INTRINSIC_VOID) { | ||
|
@@ -7490,6 +7499,16 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, | |
N2.getOpcode() == ISD::TargetConstant && "Invalid FP_ROUND!"); | ||
if (N1.getValueType() == VT) return N1; // noop conversion. | ||
break; | ||
case ISD::AssertNoFPClass: { | ||
assert(N1.getValueType().isFloatingPoint() && | ||
"AssertNoFPClass is used for a non-floating type"); | ||
assert(isa<ConstantSDNode>(N2) && "NoFPClass is not Constant"); | ||
FPClassTest NoFPClass = static_cast<FPClassTest>(N2->getAsZExtVal()); | ||
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. NoFPClass is unused in builds without asserts |
||
assert(llvm::to_underlying(NoFPClass) <= | ||
BitmaskEnumDetail::Mask<FPClassTest>() && | ||
"FPClassTest value too large"); | ||
break; | ||
} | ||
case ISD::AssertSext: | ||
case ISD::AssertZext: { | ||
EVT EVT = cast<VTSDNode>(N2)->getVT(); | ||
|
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
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.
Uh oh!
There was an error while loading. Please reload this page.