Skip to content
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

Ensure that GT_CNS_VEC is handled in LinearScan::isMatchingConstant #70171

Merged
merged 3 commits into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreclr/jit/codegenarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode)
if (treeNode->IsReuseRegVal())
{
// For now, this is only used for constant nodes.
assert((treeNode->OperGet() == GT_CNS_INT) || (treeNode->OperGet() == GT_CNS_DBL));
assert((treeNode->OperGet() == GT_CNS_INT) || (treeNode->OperGet() == GT_CNS_DBL) || (treeNode->OperGet() == GT_CNS_VEC));
tannergooding marked this conversation as resolved.
Show resolved Hide resolved
JITDUMP(" TreeNode is marked ReuseReg\n");
return;
}
Expand Down
7 changes: 7 additions & 0 deletions src/coreclr/jit/lsra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2695,6 +2695,7 @@ bool LinearScan::isMatchingConstant(RegRecord* physRegRecord, RefPosition* refPo
}
break;
}

case GT_CNS_DBL:
{
// For floating point constants, the values must be identical, not simply compare
Expand All @@ -2706,6 +2707,12 @@ bool LinearScan::isMatchingConstant(RegRecord* physRegRecord, RefPosition* refPo
}
break;
}

case GT_CNS_VEC:
{
return GenTreeVecCon::Equals(refPosition->treeNode->AsVecCon(), otherTreeNode->AsVecCon());
}

default:
break;
}
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/jit/lsraxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ int LinearScan::BuildNode(GenTree* tree)
case GT_CNS_INT:
case GT_CNS_LNG:
case GT_CNS_DBL:
case GT_CNS_VEC:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting ARM64 already had a path here since it needed special handling for Zero and AllBitsSet, it just wasn't getting used in LSRA

{
srcCount = 0;
assert(dstCount == 1);
Expand Down