Skip to content

Commit

Permalink
JIT: avoid local jtrue assertions involving floating types
Browse files Browse the repository at this point in the history
Float relop equality does not imply bitwise equality. So skip
making local jtrue assertions about floating types.

Contributes to dotnet#93246.
  • Loading branch information
AndyAyersMS committed Nov 17, 2023
1 parent fd0ba02 commit 4851d08
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/coreclr/jit/assertionprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
return NO_ASSERTION_INDEX;
}

// Check for op1 or op2 to be lcl var and if so, keep it in op1.
if ((op1->gtOper != GT_LCL_VAR) && (op2->gtOper == GT_LCL_VAR))
{
Expand Down

0 comments on commit 4851d08

Please sign in to comment.