From be6399b69d1a3683ee65558d943481b9ec359186 Mon Sep 17 00:00:00 2001 From: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com> Date: Tue, 23 Aug 2022 13:33:47 +0300 Subject: [PATCH] Delete "lvOverlappingFields" (#72356) We used to exclude locals with the flag set from SSA; this should no longer be necessary. --- src/coreclr/jit/compiler.h | 7 +++---- src/coreclr/jit/lclvars.cpp | 11 ----------- src/coreclr/jit/morph.cpp | 6 ------ src/coreclr/jit/ssabuilder.cpp | 5 ----- 4 files changed, 3 insertions(+), 26 deletions(-) diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 50e1c750049..6abed202984 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -530,10 +530,9 @@ public: // 32-bit target. For implicit byref parameters, this gets hijacked between // fgRetypeImplicitByRefArgs and fgMarkDemotedImplicitByRefArgs to indicate whether // references to the arg are being rewritten as references to a promoted shadow local. - unsigned char lvIsStructField : 1; // Is this local var a field of a promoted struct local? - unsigned char lvOverlappingFields : 1; // True when we have a struct with possibly overlapping fields - unsigned char lvContainsHoles : 1; // True when we have a promoted struct that contains holes - unsigned char lvCustomLayout : 1; // True when this struct has "CustomLayout" + unsigned char lvIsStructField : 1; // Is this local var a field of a promoted struct local? + unsigned char lvContainsHoles : 1; // True when we have a promoted struct that contains holes + unsigned char lvCustomLayout : 1; // True when this struct has "CustomLayout" unsigned char lvIsMultiRegArg : 1; // true if this is a multireg LclVar struct used in an argument context unsigned char lvIsMultiRegRet : 1; // true if this is a multireg LclVar struct assigned from a multireg call diff --git a/src/coreclr/jit/lclvars.cpp b/src/coreclr/jit/lclvars.cpp index 3c926971441..cb844b32d9b 100644 --- a/src/coreclr/jit/lclvars.cpp +++ b/src/coreclr/jit/lclvars.cpp @@ -1482,11 +1482,6 @@ void Compiler::lvaInitVarDsc(LclVarDsc* varDsc, compFloatingPointUsed = true; } - if (typeHnd != NO_CLASS_HANDLE) - { - varDsc->lvOverlappingFields = StructHasOverlappingFields(info.compCompHnd->getClassAttribs(typeHnd)); - } - #if FEATURE_IMPLICIT_BYREFS varDsc->lvIsImplicitByRef = 0; #endif // FEATURE_IMPLICIT_BYREFS @@ -3074,8 +3069,6 @@ void Compiler::lvaSetStruct(unsigned varNum, CORINFO_CLASS_HANDLE typeHnd, bool unsigned classAttribs = info.compCompHnd->getClassAttribs(typeHnd); - varDsc->lvOverlappingFields = StructHasOverlappingFields(classAttribs); - // Check whether this local is an unsafe value type and requires GS cookie protection. // GS checks require the stack to be re-ordered, which can't be done with EnC. if (unsafeValueClsCheck && (classAttribs & CORINFO_FLG_UNSAFE_VALUECLASS) && !opts.compDbgEnC) @@ -7930,10 +7923,6 @@ void Compiler::lvaDumpEntry(unsigned lclNum, FrameLayoutState curState, size_t r if (varDsc->lvStructDoubleAlign) printf(" double-align"); #endif // !TARGET_64BIT - if (varDsc->lvOverlappingFields) - { - printf(" overlapping-fields"); - } if (compGSReorderStackLayout && !varDsc->lvRegister) { diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp index fbef1677b39..101b7d0c421 100644 --- a/src/coreclr/jit/morph.cpp +++ b/src/coreclr/jit/morph.cpp @@ -16627,12 +16627,6 @@ PhaseStatus Compiler::fgRetypeImplicitByRefArgs() // Since the parameter in this position is really a pointer, its type is TYP_BYREF. varDsc->lvType = TYP_BYREF; - // Since this previously was a TYP_STRUCT and we have changed it to a TYP_BYREF - // make sure that the following flag is not set as these will force SSA to - // exclude tracking/enregistering these LclVars. (see SsaBuilder::IncludeInSsa) - // - varDsc->lvOverlappingFields = 0; // This flag could have been set, clear it. - // The struct parameter may have had its address taken, but the pointer parameter // cannot -- any uses of the struct parameter's address are uses of the pointer // parameter's value, and there's no way for the MSIL to reference the pointer diff --git a/src/coreclr/jit/ssabuilder.cpp b/src/coreclr/jit/ssabuilder.cpp index 8c173df89bc..a01845b15f0 100644 --- a/src/coreclr/jit/ssabuilder.cpp +++ b/src/coreclr/jit/ssabuilder.cpp @@ -1644,11 +1644,6 @@ bool SsaBuilder::IncludeInSsa(unsigned lclNum) // lvPromoted structs are never tracked... assert(!varDsc->lvPromoted); - if (varDsc->lvOverlappingFields) - { - return false; // Don't use SSA on structs that have overlapping fields - } - if (varDsc->lvIsStructField && (m_pCompiler->lvaGetParentPromotionType(lclNum) != Compiler::PROMOTION_TYPE_INDEPENDENT)) { -- GitLab