if (treeNode->OperGet() == GT_STORE_LCL_FLD)
{
- offs = treeNode->gtLclFld.gtLclOffs;
+ offs = treeNode->AsLclFld()->gtLclOffs;
}
GenTree* op1 = treeNode->AsOp()->gtOp1;
{
if (baseNode->gtOper == GT_LCL_FLD_ADDR)
{
- offset += baseNode->gtLclFld.gtLclOffs;
+ offset += baseNode->AsLclFld()->gtLclOffs;
}
emit->emitIns_R_S(ins, size, dst, baseNode->gtLclVarCommon.GetLclNum(), offset);
}
GenTreeLclFld* lclField = srcNode->AsLclFld();
varNum = lclField->GetLclNum();
- offset = lclField->gtLclFld.gtLclOffs;
+ offset = lclField->gtLclOffs;
break;
}
comp->gtGetLclVarNameInfo(lclNum, &ilKind, &ilName, &ilNum);
if (ilName != nullptr)
{
- chars += printf("%s+%u", ilName, tree->gtLclFld.gtLclOffs);
+ chars += printf("%s+%u", ilName, tree->AsLclFld()->gtLclOffs);
}
else
{
- chars += printf("%s%d+%u", ilKind, ilNum, tree->gtLclFld.gtLclOffs);
+ chars += printf("%s%d+%u", ilKind, ilNum, tree->AsLclFld()->gtLclOffs);
LclVarDsc* varDsc = comp->lvaTable + lclNum;
if (comp->dumpIRLocals)
{
}
// TODO: We probably want to expand field sequence.
- // gtDispFieldSeq(tree->gtLclFld.gtFieldSeq);
+ // gtDispFieldSeq(tree->AsLclFld()->gtFieldSeq);
hasSsa = true;
break;
Compiler* compiler = JitTls::GetCompiler();
bool isZeroOffset = compiler->GetZeroOffsetFieldMap()->Lookup(this, &zeroFieldSeq);
- gtLclFld.gtLclOffs = 0;
- gtLclFld.gtFieldSeq = FieldSeqStore::NotAField();
+ AsLclFld()->gtLclOffs = 0;
+ AsLclFld()->gtFieldSeq = FieldSeqStore::NotAField();
if (zeroFieldSeq != nullptr)
{
// Set the zeroFieldSeq in the GT_LCL_FLD node
- gtLclFld.gtFieldSeq = zeroFieldSeq;
+ AsLclFld()->gtFieldSeq = zeroFieldSeq;
// and remove the annotation from the ZeroOffsetFieldMap
compiler->GetZeroOffsetFieldMap()->Remove(this);
}
{
GenTreeLclFld* lclField = memOp->AsLclFld();
varNum = lclField->GetLclNum();
- offset = lclField->gtLclFld.gtLclOffs;
+ offset = lclField->gtLclOffs;
break;
}
return true;
case GT_LCL_FLD:
- if (op1->gtLclFld.GetLclNum() != op2->gtLclFld.GetLclNum() ||
- op1->gtLclFld.gtLclOffs != op2->gtLclFld.gtLclOffs)
+ if (op1->AsLclFld()->GetLclNum() != op2->AsLclFld()->GetLclNum() ||
+ op1->AsLclFld()->gtLclOffs != op2->AsLclFld()->gtLclOffs)
{
break;
}
add = tree->AsLclVar()->GetLclNum();
break;
case GT_LCL_FLD:
- hash = genTreeHashAdd(hash, tree->gtLclFld.GetLclNum());
- add = tree->gtLclFld.gtLclOffs;
+ hash = genTreeHashAdd(hash, tree->AsLclFld()->GetLclNum());
+ add = tree->AsLclFld()->gtLclOffs;
break;
case GT_CNS_INT:
// Remember that the LclVar node has been cloned. The flag will be set
// on 'copy' as well.
tree->gtFlags |= GTF_VAR_CLONED;
- copy = new (this, tree->gtOper)
- GenTreeLclFld(tree->gtOper, tree->TypeGet(), tree->gtLclFld.GetLclNum(), tree->gtLclFld.gtLclOffs);
- copy->gtLclFld.gtFieldSeq = tree->gtLclFld.gtFieldSeq;
+ copy = new (this, tree->gtOper) GenTreeLclFld(tree->gtOper, tree->TypeGet(), tree->AsLclFld()->GetLclNum(),
+ tree->AsLclFld()->gtLclOffs);
+ copy->AsLclFld()->gtFieldSeq = tree->AsLclFld()->gtFieldSeq;
break;
case GT_CLS_VAR:
goto DONE;
case GT_LCL_FLD:
- if (tree->gtLclFld.GetLclNum() == varNum)
+ if (tree->AsLclFld()->GetLclNum() == varNum)
{
IMPL_LIMITATION("replacing GT_LCL_FLD with a constant");
}
// be set on 'copy' as well.
tree->gtFlags |= GTF_VAR_CLONED;
copy = new (this, GT_LCL_FLD)
- GenTreeLclFld(tree->TypeGet(), tree->gtLclFld.GetLclNum(), tree->gtLclFld.gtLclOffs);
- copy->gtLclFld.gtFieldSeq = tree->gtLclFld.gtFieldSeq;
- copy->gtFlags = tree->gtFlags;
+ GenTreeLclFld(tree->TypeGet(), tree->AsLclFld()->GetLclNum(), tree->AsLclFld()->gtLclOffs);
+ copy->AsLclFld()->gtFieldSeq = tree->AsLclFld()->gtFieldSeq;
+ copy->gtFlags = tree->gtFlags;
}
goto DONE;
if (isLclFld)
{
- printf("[+%u]", tree->gtLclFld.gtLclOffs);
- gtDispFieldSeq(tree->gtLclFld.gtFieldSeq);
+ printf("[+%u]", tree->AsLclFld()->gtLclOffs);
+ gtDispFieldSeq(tree->AsLclFld()->gtFieldSeq);
}
if (varDsc->lvRegister)
unsigned lclOffset = 0;
if (addrArg->OperIsLocalField())
{
- lclOffset = addrArg->gtLclFld.gtLclOffs;
+ lclOffset = addrArg->AsLclFld()->gtLclOffs;
}
if (lclOffset != 0)
GenTreeLclFld* lclField = op2->AsLclFld();
varNum = lclField->GetLclNum();
- offset = lclField->gtLclFld.gtLclOffs;
+ offset = lclField->AsLclFld()->gtLclOffs;
break;
}
GenTreeLclFld* lclField = op2->AsLclFld();
varNum = lclField->GetLclNum();
- offset = lclField->gtLclFld.gtLclOffs;
+ offset = lclField->AsLclFld()->gtLclOffs;
break;
}
GenTreeLclFld* lclField = op2->AsLclFld();
varNum = lclField->GetLclNum();
- offset = lclField->gtLclFld.gtLclOffs;
+ offset = lclField->AsLclFld()->gtLclOffs;
break;
}
GenTreeLclFld* lclField = op3->AsLclFld();
varNum = lclField->GetLclNum();
- offset = lclField->gtLclFld.gtLclOffs;
+ offset = lclField->AsLclFld()->gtLclOffs;
break;
}
case GT_LCL_FLD:
- offs += tree->gtLclFld.gtLclOffs;
+ offs += tree->AsLclFld()->gtLclOffs;
goto LCL;
LCL:
case GT_LCL_FLD:
case GT_STORE_LCL_FLD:
- offs += tree->gtLclFld.gtLclOffs;
+ offs += tree->AsLclFld()->gtLclOffs;
goto LCL;
LCL:
case GT_LCL_FLD_ADDR:
case GT_LCL_FLD:
- offs += tree->gtLclFld.gtLclOffs;
+ offs += tree->AsLclFld()->gtLclOffs;
goto LCL;
LCL:
GenTreeLclFld* lclField = rmOp->AsLclFld();
varNum = lclField->GetLclNum();
- offset = lclField->gtLclFld.gtLclOffs;
+ offset = lclField->AsLclFld()->gtLclOffs;
break;
}
/* Change lclVar(lclNum) to lclFld(lclNum,padding) */
tree->ChangeOper(GT_LCL_FLD);
- tree->gtLclFld.gtLclOffs = padding;
+ tree->AsLclFld()->gtLclOffs = padding;
}
else
{
assert(varNum < lvaCount);
LclVarDsc* varDsc = &lvaTable[varNum];
- unsigned baseOffset = (argValue->OperGet() == GT_LCL_FLD) ? argValue->gtLclFld.gtLclOffs : 0;
+ unsigned baseOffset = (argValue->OperGet() == GT_LCL_FLD) ? argValue->AsLclFld()->gtLclOffs : 0;
unsigned lastOffset = baseOffset + structSize;
// The allocated size of our LocalVar must be at least as big as lastOffset
if (info.compIsVarArgs)
{
GenTree* newTree =
- fgMorphStackArgForVarArgs(tree->gtLclFld.GetLclNum(), tree->gtType, tree->gtLclFld.gtLclOffs);
+ fgMorphStackArgForVarArgs(tree->AsLclFld()->GetLclNum(), tree->gtType, tree->AsLclFld()->gtLclOffs);
if (newTree != nullptr)
{
if (newTree->OperIsBlk() && ((tree->gtFlags & GTF_VAR_DEF) == 0))
{
noway_assert(tree->OperGet() == GT_LCL_FLD);
- unsigned lclNum = tree->gtLclFld.GetLclNum();
+ unsigned lclNum = tree->AsLclFld()->GetLclNum();
LclVarDsc* varDsc = &lvaTable[lclNum];
if (varTypeIsStruct(varDsc) && (varDsc->lvPromoted))
{
// Promoted struct
- unsigned fldOffset = tree->gtLclFld.gtLclOffs;
+ unsigned fldOffset = tree->AsLclFld()->gtLclOffs;
unsigned fieldLclIndex = 0;
LclVarDsc* fldVarDsc = nullptr;
)
{
// There is an existing sub-field we can use.
- tree->gtLclFld.SetLclNum(fieldLclIndex);
+ tree->AsLclFld()->SetLclNum(fieldLclIndex);
// The field must be an enregisterable type; otherwise it would not be a promoted field.
// The tree type may not match, e.g. for return types that have been morphed, but both
may access different parts of the var as different (but
overlapping) fields. So just treat them as indirect accesses */
- // unsigned lclNum = dest->gtLclFld.GetLclNum();
+ // unsigned lclNum = dest->AsLclFld()->GetLclNum();
// noway_assert(lvaTable[lclNum].lvAddrTaken);
varRefKinds refs = varTypeIsGC(tree->TypeGet()) ? VR_IND_REF : VR_IND_SCL;
if (locationOp == GT_LCL_FLD)
{
- store->gtLclFld.gtLclOffs = var->gtLclFld.gtLclOffs;
- store->gtLclFld.gtFieldSeq = var->gtLclFld.gtFieldSeq;
+ store->AsLclFld()->gtLclOffs = var->AsLclFld()->gtLclOffs;
+ store->AsLclFld()->gtFieldSeq = var->AsLclFld()->gtFieldSeq;
}
copyFlags(store, var, GTF_LIVENESS_MASK);
}
else if (op1->OperIsLocalAddr())
{
- unsigned offset = (op1->OperGet() == GT_LCL_FLD_ADDR) ? op1->gtLclFld.gtLclOffs : 0;
+ unsigned offset = (op1->OperGet() == GT_LCL_FLD_ADDR) ? op1->AsLclFld()->gtLclOffs : 0;
GetEmitter()->emitIns_R_S(ins, emitTypeSize(targetType), targetReg, op1->gtLclVarCommon.GetLclNum(),
offset);
}
offset += compiler->lvaFrameAddress(varNum, &isEBPbased);
if (op1->OperGet() == GT_LCL_FLD)
{
- offset += op1->gtLclFld.gtLclOffs;
+ offset += op1->AsLclFld()->gtLclOffs;
}
baseReg = (isEBPbased) ? REG_EBP : REG_ESP;
}
if (treeNode->OperGet() == GT_STORE_LCL_FLD)
{
- offs = treeNode->gtLclFld.gtLclOffs;
+ offs = treeNode->AsLclFld()->gtLclOffs;
}
GenTree* op1 = treeNode->AsOp()->gtOp1;
if (treeNode->OperGet() == GT_LCL_FLD)
{
- offs = treeNode->gtLclFld.gtLclOffs;
+ offs = treeNode->AsLclFld()->gtLclOffs;
}
// Need an additional Xmm register that is different from targetReg to read upper 4 bytes.