Skip to content

Commit 31a60a1

Browse files
authored
Merge pull request dotnet/coreclr#7068 from CarolEidt/FixArm64
Fix Arm64 build breaks Commit migrated from dotnet/coreclr@6f02778
2 parents 76e1257 + 2f1f1ac commit 31a60a1

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

src/coreclr/src/jit/codegenarm64.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3523,6 +3523,7 @@ void CodeGen::genCodeForTreeNode(GenTreePtr treeNode)
35233523
{
35243524
assert(treeNode->AsObj()->gtGcPtrCount != 0);
35253525
genCodeForCpObj(treeNode->AsObj());
3526+
break;
35263527
}
35273528
__fallthrough;
35283529

src/coreclr/src/jit/gentree.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2535,6 +2535,10 @@ unsigned Compiler::gtHashValue(GenTree* tree)
25352535
reinterpret_cast<uintptr_t>(tree->gtAllocObj.gtAllocObjClsHnd)));
25362536
hash = genTreeHashAdd(hash, tree->gtAllocObj.gtNewHelper);
25372537
break;
2538+
case GT_OBJ:
2539+
hash = genTreeHashAdd(hash, static_cast<unsigned>(
2540+
reinterpret_cast<uintptr_t>(tree->gtObj.gtClass)));
2541+
break;
25382542

25392543
// For the ones below no extra argument matters for comparison.
25402544
case GT_BOX:
@@ -15829,7 +15833,7 @@ CORINFO_CLASS_HANDLE Compiler::gtGetStructHandleIfPresent(GenTree* tree)
1582915833
info.compCompHnd->getFieldType(tree->gtField.gtFldHnd, &structHnd);
1583015834
break;
1583115835
case GT_ASG:
15832-
structHnd = gtGetStructHandle(tree->gtGetOp1());
15836+
structHnd = gtGetStructHandleIfPresent(tree->gtGetOp1());
1583315837
break;
1583415838
case GT_LCL_VAR:
1583515839
case GT_LCL_FLD:

src/coreclr/src/jit/lowerarm64.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,8 +1223,9 @@ void Lowering::TreeNodeInfoInitBlockStore(GenTreeBlk* blkNode)
12231223
LinearScan* l = m_lsra;
12241224
Compiler* compiler = comp;
12251225

1226-
// Sources are dest address, initVal or source, and size
1227-
blkNode->gtLsraInfo.srcCount = 3;
1226+
// Sources are dest address and initVal or source.
1227+
// We may require an additional source or temp register for the size.
1228+
blkNode->gtLsraInfo.srcCount = 2;
12281229
blkNode->gtLsraInfo.dstCount = 0;
12291230

12301231
if ((blkNode->OperGet() == GT_STORE_OBJ) && (blkNode->AsObj()->gtGcPtrCount == 0))
@@ -1304,8 +1305,6 @@ void Lowering::TreeNodeInfoInitBlockStore(GenTreeBlk* blkNode)
13041305
{
13051306
// CopyObj or CopyBlk
13061307
// Sources are src and dest and size if not constant.
1307-
blkNode->gtLsraInfo.srcCount = 3;
1308-
blkNode->gtLsraInfo.dstCount = 0;
13091308
unsigned size = blkNode->gtBlkSize;
13101309
GenTreePtr source = blkNode->Data();
13111310
GenTree* srcAddr = nullptr;
@@ -1499,7 +1498,7 @@ void Lowering::TreeNodeInfoInitSIMD(GenTree* tree)
14991498

15001499
case SIMDIntrinsicInitN:
15011500
info->srcCount = (int)(simdTree->gtSIMDSize / genTypeSize(simdTree->gtSIMDBaseType));
1502-
// Need an internal register to stitch together all the values into a single vector in an XMM reg
1501+
// Need an internal register to stitch together all the values into a single vector in an XMM reg.
15031502
info->internalFloatCount = 1;
15041503
info->setInternalCandidates(lsra, lsra->allSIMDRegs());
15051504
break;
@@ -1719,7 +1718,12 @@ void Lowering::LowerGCWriteBarrier(GenTree* tree)
17191718
void Lowering::SetIndirAddrOpCounts(GenTreePtr indirTree)
17201719
{
17211720
assert(indirTree->OperIsIndir());
1722-
assert(indirTree->TypeGet() != TYP_STRUCT);
1721+
// If this is the rhs of a block copy (i.e. non-enregisterable struct),
1722+
// it has no register requirements.
1723+
if (indirTree->TypeGet() == TYP_STRUCT)
1724+
{
1725+
return;
1726+
}
17231727

17241728
GenTreePtr addr = indirTree->gtGetOp1();
17251729
TreeNodeInfo* info = &(indirTree->gtLsraInfo);

src/coreclr/src/jit/morph.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2045,8 +2045,13 @@ GenTreePtr Compiler::fgMakeTmpArgNode(
20452045
{
20462046
// ToDo-ARM64: Consider using: arg->ChangeOper(GT_LCL_FLD);
20472047
// as that is how FEATURE_UNIX_AMD64_STRUCT_PASSING works.
2048+
// We will create a GT_OBJ for the argument below.
2049+
// This will be passed by value in two registers.
2050+
assert(addrNode != nullptr);
2051+
2052+
// Create an Obj of the temp to use it as a call argument.
2053+
arg = gtNewObjNode(lvaGetStruct(tmpVarNum), arg);
20482054

2049-
// Pass by value in two registers, using a regular GT_OBJ node, created below.
20502055
// TODO-1stClassStructs: We should not need to set the GTF_DONT_CSE flag here;
20512056
// this is only to preserve former behavior (though some CSE'ing of struct
20522057
// values can be pessimizing, so enabling this may require some additional tuning).

0 commit comments

Comments
 (0)