Skip to content

Commit

Permalink
Delete dead code from InferStructOpSizeAlign (#61880)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
SingleAccretion authored Nov 24, 2021
1 parent c158cb2 commit d2fb0f3
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1211,44 +1211,6 @@ unsigned CodeGenInterface::InferStructOpSizeAlign(GenTree* op, unsigned* alignme
alignment = TARGET_POINTER_SIZE;
}
}
else if (op->OperIsCopyBlkOp())
{
GenTree* op2 = op->AsOp()->gtOp2;

if (op2->OperGet() == GT_CNS_INT)
{
if (op2->IsIconHandle(GTF_ICON_CLASS_HDL))
{
CORINFO_CLASS_HANDLE clsHnd = (CORINFO_CLASS_HANDLE)op2->AsIntCon()->gtIconVal;
opSize = roundUp(compiler->info.compCompHnd->getClassSize(clsHnd), TARGET_POINTER_SIZE);
alignment =
roundUp(compiler->info.compCompHnd->getClassAlignmentRequirement(clsHnd), TARGET_POINTER_SIZE);
}
else
{
opSize = (unsigned)op2->AsIntCon()->gtIconVal;
GenTree* op1 = op->AsOp()->gtOp1;
// TODO-List-Cleanup: this looks like some really old dead code.
// assert(op1->OperGet() == GT_LIST);
GenTree* dstAddr = op1->AsOp()->gtOp1;
if (dstAddr->OperGet() == GT_ADDR)
{
InferStructOpSizeAlign(dstAddr->AsOp()->gtOp1, &alignment);
}
else
{
assert(!"Unhandle dstAddr node");
alignment = TARGET_POINTER_SIZE;
}
}
}
else
{
noway_assert(!"Variable sized COPYBLK register arg!");
opSize = 0;
alignment = TARGET_POINTER_SIZE;
}
}
else if (op->gtOper == GT_MKREFANY)
{
opSize = TARGET_POINTER_SIZE * 2;
Expand Down

0 comments on commit d2fb0f3

Please sign in to comment.