Skip to content

Commit f05fa01

Browse files
Deleting field sequences from LCL_FLD and VNF_PtrToArrElem (#68986)
* Delete field sequences from GenTreeLclFld * Delete field sequences from VNF_PtrToArrElem * Clean up "DefinesLocalAddr" Move the responsibility of determining "entireness" to its only caller that needed to do that: "DefinesLocal". Add function headers. No diffs. * Also clean up block morphing a little No diffs. * Fix a potential bug with return buffer numbering Also address the TODO-CQ. * Fix another "VN maintainance in morph" bug Exposed by the more aggressive hoisting.
1 parent 7f7c6a2 commit f05fa01

16 files changed

+278
-946
lines changed

src/coreclr/jit/compiler.h

-6
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,6 @@ class LclVarDsc
471471
unsigned char lvInSsa : 1; // The variable is in SSA form (set by SsaBuilder)
472472
unsigned char lvIsCSE : 1; // Indicates if this LclVar is a CSE variable.
473473
unsigned char lvHasLdAddrOp : 1; // has ldloca or ldarga opcode on this local.
474-
unsigned char lvStackByref : 1; // This is a compiler temporary of TYP_BYREF that is known to point into our local
475-
// stack frame.
476474

477475
unsigned char lvHasILStoreOp : 1; // there is at least one STLOC or STARG on this local
478476
unsigned char lvHasMultipleILStoreOp : 1; // there is more than one STLOC on this local
@@ -4782,8 +4780,6 @@ class Compiler
47824780
// Does value-numbering for a block assignment.
47834781
void fgValueNumberBlockAssignment(GenTree* tree);
47844782

4785-
bool fgValueNumberBlockAssignmentTypeCheck(LclVarDsc* dstVarDsc, FieldSeqNode* dstFldSeq, GenTree* src);
4786-
47874783
// Does value-numbering for a cast tree.
47884784
void fgValueNumberCastTree(GenTree* tree);
47894785

@@ -5702,8 +5698,6 @@ class Compiler
57025698
GenTree* fgMorphMultiOp(GenTreeMultiOp* multiOp);
57035699
GenTree* fgMorphConst(GenTree* tree);
57045700

5705-
bool fgMorphCanUseLclFldForCopy(unsigned lclNum1, unsigned lclNum2);
5706-
57075701
GenTreeLclVar* fgMorphTryFoldObjAsLclVar(GenTreeObj* obj, bool destroyNodes = true);
57085702
GenTreeOp* fgMorphCommutative(GenTreeOp* tree);
57095703
GenTree* fgMorphCastedBitwiseOp(GenTreeOp* tree);

src/coreclr/jit/compiler.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,7 @@ inline void GenTree::SetOper(genTreeOps oper, ValueNumberUpdate vnUpdate)
13481348
#endif
13491349
case GT_LCL_FLD:
13501350
AsLclFld()->SetLclOffs(0);
1351-
AsLclFld()->SetFieldSeq(FieldSeqStore::NotAField());
1351+
AsLclFld()->SetLayout(nullptr);
13521352
break;
13531353

13541354
case GT_CALL:

src/coreclr/jit/decomposelongs.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,9 @@ GenTree* DecomposeLongs::DecomposeLclVar(LIR::Use& use)
366366
m_compiler->lvaSetVarDoNotEnregister(varNum DEBUGARG(DoNotEnregisterReason::LocalField));
367367
loResult->SetOper(GT_LCL_FLD);
368368
loResult->AsLclFld()->SetLclOffs(0);
369-
loResult->AsLclFld()->SetFieldSeq(FieldSeqStore::NotAField());
370369

371370
hiResult->SetOper(GT_LCL_FLD);
372371
hiResult->AsLclFld()->SetLclOffs(4);
373-
hiResult->AsLclFld()->SetFieldSeq(FieldSeqStore::NotAField());
374372
}
375373

376374
return FinalizeDecomposition(use, loResult, hiResult, hiResult);

src/coreclr/jit/flowgraph.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -961,13 +961,6 @@ bool Compiler::fgAddrCouldBeNull(GenTree* addr)
961961
{
962962
return false;
963963
}
964-
965-
LclVarDsc* varDsc = lvaGetDesc(varNum);
966-
967-
if (varDsc->lvStackByref)
968-
{
969-
return false;
970-
}
971964
}
972965
else if (addr->gtOper == GT_ADDR)
973966
{

src/coreclr/jit/gcinfo.cpp

-19
Original file line numberDiff line numberDiff line change
@@ -346,25 +346,6 @@ GCInfo::WriteBarrierForm GCInfo::gcWriteBarrierFormFromTargetAddress(GenTree* tg
346346
return GCInfo::WBF_NoBarrier;
347347
}
348348

349-
if (tgtAddr->OperGet() == GT_LCL_VAR)
350-
{
351-
unsigned lclNum = tgtAddr->AsLclVar()->GetLclNum();
352-
LclVarDsc* varDsc = compiler->lvaGetDesc(lclNum);
353-
354-
// Instead of marking LclVar with 'lvStackByref',
355-
// Consider decomposing the Value Number given to this LclVar to see if it was
356-
// created using a GT_ADDR(GT_LCLVAR) or a GT_ADD( GT_ADDR(GT_LCLVAR), Constant)
357-
358-
// We may have an internal compiler temp created in fgMorphCopyBlock() that we know
359-
// points at one of our stack local variables, it will have lvStackByref set to true.
360-
//
361-
if (varDsc->lvStackByref)
362-
{
363-
assert(varDsc->TypeGet() == TYP_BYREF);
364-
return GCInfo::WBF_NoBarrier;
365-
}
366-
}
367-
368349
if (tgtAddr->TypeGet() == TYP_REF)
369350
{
370351
return GCInfo::WBF_BarrierUnchecked;

0 commit comments

Comments
 (0)