Skip to content

Commit d2fb0f3

Browse files
Delete dead code from InferStructOpSizeAlign (#61880)
The method's only caller is InferOpSizeAlign. That is in turn only used in LCL_FLD stress, which only looks at locals with non-struct types. And "fgInitArgInfo", which only allows 3 nodes with TYP_STRUCT: OBJ, LCL_VAR and MKREFANY. Thus, this code is dead. Not surprising, considering it was looking for the old GT_COPYBLK representation.
1 parent c158cb2 commit d2fb0f3

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

src/coreclr/jit/codegencommon.cpp

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,44 +1211,6 @@ unsigned CodeGenInterface::InferStructOpSizeAlign(GenTree* op, unsigned* alignme
12111211
alignment = TARGET_POINTER_SIZE;
12121212
}
12131213
}
1214-
else if (op->OperIsCopyBlkOp())
1215-
{
1216-
GenTree* op2 = op->AsOp()->gtOp2;
1217-
1218-
if (op2->OperGet() == GT_CNS_INT)
1219-
{
1220-
if (op2->IsIconHandle(GTF_ICON_CLASS_HDL))
1221-
{
1222-
CORINFO_CLASS_HANDLE clsHnd = (CORINFO_CLASS_HANDLE)op2->AsIntCon()->gtIconVal;
1223-
opSize = roundUp(compiler->info.compCompHnd->getClassSize(clsHnd), TARGET_POINTER_SIZE);
1224-
alignment =
1225-
roundUp(compiler->info.compCompHnd->getClassAlignmentRequirement(clsHnd), TARGET_POINTER_SIZE);
1226-
}
1227-
else
1228-
{
1229-
opSize = (unsigned)op2->AsIntCon()->gtIconVal;
1230-
GenTree* op1 = op->AsOp()->gtOp1;
1231-
// TODO-List-Cleanup: this looks like some really old dead code.
1232-
// assert(op1->OperGet() == GT_LIST);
1233-
GenTree* dstAddr = op1->AsOp()->gtOp1;
1234-
if (dstAddr->OperGet() == GT_ADDR)
1235-
{
1236-
InferStructOpSizeAlign(dstAddr->AsOp()->gtOp1, &alignment);
1237-
}
1238-
else
1239-
{
1240-
assert(!"Unhandle dstAddr node");
1241-
alignment = TARGET_POINTER_SIZE;
1242-
}
1243-
}
1244-
}
1245-
else
1246-
{
1247-
noway_assert(!"Variable sized COPYBLK register arg!");
1248-
opSize = 0;
1249-
alignment = TARGET_POINTER_SIZE;
1250-
}
1251-
}
12521214
else if (op->gtOper == GT_MKREFANY)
12531215
{
12541216
opSize = TARGET_POINTER_SIZE * 2;

0 commit comments

Comments
 (0)