-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
JIT: avoid local jtrue assertions involving floating types #94935
Conversation
Float relop equality does not imply bitwise equality. So skip making local jtrue assertions about floating types. Contributes to dotnet#93246.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsFloat relop equality does not imply bitwise equality. So skip making local jtrue assertions about floating types. Contributes to #93246.
|
@jakobbotsch PTAL This is also running in a draft PR where cross-block is enabled; see #94689 |
@@ -2205,6 +2205,13 @@ AssertionInfo Compiler::optAssertionGenJtrue(GenTree* tree) | |||
GenTree* op1 = relop->AsOp()->gtOp1->gtCommaStoreVal(); | |||
GenTree* op2 = relop->AsOp()->gtOp2->gtCommaStoreVal(); | |||
|
|||
// Avoid creating local assertions for float types. | |||
// | |||
if (optLocalAssertionProp && varTypeIsFloating(op1)) |
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.
👍.
Just noting we could expand this in the future...
We have some well-defined APIs like IsNaN
, IsInfinity
, IsFinite
, etc. These can all be used to drive other assertions.
Likewise if we know that op2 isn't NaN and isn't zero, then bitwise equality does hold (we take advantage of this in import to optimize min
and max
for example, when one input is a constant).
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.
Added a note to #93246 so we don't forget about this.
Float relop equality does not imply bitwise equality. So skip making local jtrue assertions about floating types.
Contributes to #93246.