Skip to content

Commit 24f5de4

Browse files
Ensure that GT_CNS_VEC is handled in LinearScan::isMatchingConstant (dotnet#70171)
* Ensure that GT_CNS_VEC is handled in LinearScan::isMatchingConstant * Ensure an Arm64 assert includes GT_CNS_VEC * Update src/coreclr/jit/codegenarmarch.cpp Co-authored-by: Egor Bogatov <egorbo@gmail.com> Co-authored-by: Egor Bogatov <egorbo@gmail.com>
1 parent fe2c1ed commit 24f5de4

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/coreclr/jit/codegenarmarch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode)
144144
if (treeNode->IsReuseRegVal())
145145
{
146146
// For now, this is only used for constant nodes.
147-
assert((treeNode->OperGet() == GT_CNS_INT) || (treeNode->OperGet() == GT_CNS_DBL));
147+
assert(treeNode->OperIs(GT_CNS_INT, GT_CNS_DBL, GT_CNS_VEC));
148148
JITDUMP(" TreeNode is marked ReuseReg\n");
149149
return;
150150
}

src/coreclr/jit/lsra.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2695,6 +2695,7 @@ bool LinearScan::isMatchingConstant(RegRecord* physRegRecord, RefPosition* refPo
26952695
}
26962696
break;
26972697
}
2698+
26982699
case GT_CNS_DBL:
26992700
{
27002701
// For floating point constants, the values must be identical, not simply compare
@@ -2706,6 +2707,12 @@ bool LinearScan::isMatchingConstant(RegRecord* physRegRecord, RefPosition* refPo
27062707
}
27072708
break;
27082709
}
2710+
2711+
case GT_CNS_VEC:
2712+
{
2713+
return GenTreeVecCon::Equals(refPosition->treeNode->AsVecCon(), otherTreeNode->AsVecCon());
2714+
}
2715+
27092716
default:
27102717
break;
27112718
}

src/coreclr/jit/lsraxarch.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ int LinearScan::BuildNode(GenTree* tree)
147147
case GT_CNS_INT:
148148
case GT_CNS_LNG:
149149
case GT_CNS_DBL:
150+
case GT_CNS_VEC:
150151
{
151152
srcCount = 0;
152153
assert(dstCount == 1);

0 commit comments

Comments
 (0)