From 53b476bb95b5fe7d6bfc49f5dc8d588383e12ea9 Mon Sep 17 00:00:00 2001 From: Julius R Friedman Date: Tue, 11 Dec 2018 00:42:06 -0500 Subject: [PATCH] Eliminate GenTreeRegVar and GT_REG_VAR and RegVar (dotnet/coreclr#18317) Issue dotnet/coreclr#18201 / Hackathon Commit migrated from https://github.com/dotnet/coreclr/commit/e1a5d0fca2ccd95ef8c21167343f4fdd017b53a6 --- src/coreclr/src/jit/codegencommon.cpp | 22 +++------- src/coreclr/src/jit/codegenlinear.cpp | 12 ------ src/coreclr/src/jit/compiler.cpp | 24 ----------- src/coreclr/src/jit/compiler.h | 1 - src/coreclr/src/jit/compiler.hpp | 1 - src/coreclr/src/jit/flowgraph.cpp | 2 +- src/coreclr/src/jit/gcinfo.cpp | 16 ++----- src/coreclr/src/jit/gentree.cpp | 38 ---------------- src/coreclr/src/jit/gentree.h | 81 +++++------------------------------ src/coreclr/src/jit/gtlist.h | 1 - src/coreclr/src/jit/gtstructs.h | 3 +- src/coreclr/src/jit/liveness.cpp | 2 +- src/coreclr/src/jit/lower.cpp | 4 +- src/coreclr/src/jit/morph.cpp | 3 +- src/coreclr/src/jit/rationalize.cpp | 4 -- src/coreclr/src/jit/regset.cpp | 1 - src/coreclr/src/jit/valuenum.cpp | 2 - 17 files changed, 27 insertions(+), 190 deletions(-) diff --git a/src/coreclr/src/jit/codegencommon.cpp b/src/coreclr/src/jit/codegencommon.cpp index e90a7f6..87a693c 100644 --- a/src/coreclr/src/jit/codegencommon.cpp +++ b/src/coreclr/src/jit/codegencommon.cpp @@ -450,7 +450,7 @@ regMaskTP CodeGenInterface::genGetRegMask(const LclVarDsc* varDsc) // inline regMaskTP CodeGenInterface::genGetRegMask(GenTree* tree) { - assert(tree->gtOper == GT_LCL_VAR || tree->gtOper == GT_REG_VAR); + assert(tree->gtOper == GT_LCL_VAR); regMaskTP regMask = RBM_NONE; const LclVarDsc* varDsc = compiler->lvaTable + tree->gtLclVarCommon.gtLclNum; @@ -3199,9 +3199,8 @@ void CodeGen::genGCWriteBarrier(GenTree* tgt, GCInfo::WriteBarrierForm wbf) #ifdef FEATURE_COUNT_GC_WRITE_BARRIERS // We classify the "tgt" trees as follows: // If "tgt" is of the form (where [ x ] indicates an optional x, and { x1, ..., xn } means "one of the x_i forms"): - // IND [-> ADDR -> IND] -> { GT_LCL_VAR, GT_REG_VAR, ADD({GT_LCL_VAR, GT_REG_VAR}, X), ADD(X, (GT_LCL_VAR, - // GT_REG_VAR)) } - // then let "v" be the GT_LCL_VAR or GT_REG_VAR. + // IND [-> ADDR -> IND] -> { GT_LCL_VAR, ADD({GT_LCL_VAR}, X), ADD(X, (GT_LCL_VAR)) } + // then let "v" be the GT_LCL_VAR. // * If "v" is the return buffer argument, classify as CWBKind_RetBuf. // * If "v" is another by-ref argument, classify as CWBKind_ByRefArg. // * Otherwise, classify as CWBKind_OtherByRefLocal. @@ -3218,17 +3217,17 @@ void CodeGen::genGCWriteBarrier(GenTree* tgt, GCInfo::WriteBarrierForm wbf) { indArg = indArg->gtOp.gtOp1->gtOp.gtOp1; } - if (indArg->gtOper == GT_LCL_VAR || indArg->gtOper == GT_REG_VAR) + if (indArg->gtOper == GT_LCL_VAR) { lcl = indArg; } else if (indArg->gtOper == GT_ADD) { - if (indArg->gtOp.gtOp1->gtOper == GT_LCL_VAR || indArg->gtOp.gtOp1->gtOper == GT_REG_VAR) + if (indArg->gtOp.gtOp1->gtOper == GT_LCL_VAR) { lcl = indArg->gtOp.gtOp1; } - else if (indArg->gtOp.gtOp2->gtOper == GT_LCL_VAR || indArg->gtOp.gtOp2->gtOper == GT_REG_VAR) + else if (indArg->gtOp.gtOp2->gtOper == GT_LCL_VAR) { lcl = indArg->gtOp.gtOp2; } @@ -3236,14 +3235,7 @@ void CodeGen::genGCWriteBarrier(GenTree* tgt, GCInfo::WriteBarrierForm wbf) if (lcl != NULL) { wbKind = CWBKind_OtherByRefLocal; // Unclassified local variable. - unsigned lclNum = 0; - if (lcl->gtOper == GT_LCL_VAR) - lclNum = lcl->gtLclVarCommon.gtLclNum; - else - { - assert(lcl->gtOper == GT_REG_VAR); - lclNum = lcl->gtRegVar.gtLclNum; - } + unsigned lclNum = lcl->AsLclVar()->GetLclNum(); if (lclNum == compiler->info.compRetBuffArg) { wbKind = CWBKind_RetBuf; // Ret buff. Can happen if the struct exceeds the size limit. diff --git a/src/coreclr/src/jit/codegenlinear.cpp b/src/coreclr/src/jit/codegenlinear.cpp index f474b88..2c0656d 100644 --- a/src/coreclr/src/jit/codegenlinear.cpp +++ b/src/coreclr/src/jit/codegenlinear.cpp @@ -741,22 +741,10 @@ void CodeGen::genSpillVar(GenTree* tree) var_types lclTyp = genActualType(varDsc->TypeGet()); emitAttr size = emitTypeSize(lclTyp); - bool restoreRegVar = false; - if (tree->gtOper == GT_REG_VAR) - { - tree->SetOper(GT_LCL_VAR); - restoreRegVar = true; - } - instruction storeIns = ins_Store(lclTyp, compiler->isSIMDTypeLocalAligned(varNum)); assert(varDsc->lvRegNum == tree->gtRegNum); inst_TT_RV(storeIns, tree, tree->gtRegNum, 0, size); - if (restoreRegVar) - { - tree->SetOper(GT_REG_VAR); - } - genUpdateRegLife(varDsc, /*isBorn*/ false, /*isDying*/ true DEBUGARG(tree)); gcInfo.gcMarkRegSetNpt(varDsc->lvRegMask()); diff --git a/src/coreclr/src/jit/compiler.cpp b/src/coreclr/src/jit/compiler.cpp index 92722a1..9a06d47 100644 --- a/src/coreclr/src/jit/compiler.cpp +++ b/src/coreclr/src/jit/compiler.cpp @@ -9275,8 +9275,6 @@ int cTreeFlagsIR(Compiler* comp, GenTree* tree) case GT_LCL_FLD_ADDR: case GT_STORE_LCL_FLD: case GT_STORE_LCL_VAR: - case GT_REG_VAR: - if (tree->gtFlags & GTF_VAR_DEF) { chars += printf("[VAR_DEF]"); @@ -9311,13 +9309,6 @@ int cTreeFlagsIR(Compiler* comp, GenTree* tree) chars += printf("[VAR_CSE_REF]"); } #endif - if (op == GT_REG_VAR) - { - if (tree->gtFlags & GTF_REG_BIRTH) - { - chars += printf("[REG_BIRTH]"); - } - } break; case GT_NOP: @@ -9953,8 +9944,6 @@ int cLeafIR(Compiler* comp, GenTree* tree) case GT_LCL_VAR: case GT_LCL_VAR_ADDR: case GT_STORE_LCL_VAR: - case GT_REG_VAR: - lclNum = tree->gtLclVarCommon.gtLclNum; comp->gtGetLclVarNameInfo(lclNum, &ilKind, &ilName, &ilNum); if (ilName != nullptr) @@ -10012,19 +10001,6 @@ int cLeafIR(Compiler* comp, GenTree* tree) } } - if (op == GT_REG_VAR) - { - if (isFloatRegType(tree->gtType)) - { - assert(tree->gtRegVar.gtRegNum == tree->gtRegNum); - chars += printf("(FPV%u)", tree->gtRegNum); - } - else - { - chars += printf("(%s)", comp->compRegVarName(tree->gtRegVar.gtRegNum)); - } - } - hasSsa = true; break; diff --git a/src/coreclr/src/jit/compiler.h b/src/coreclr/src/jit/compiler.h index 082dfa0..f784776 100644 --- a/src/coreclr/src/jit/compiler.h +++ b/src/coreclr/src/jit/compiler.h @@ -9820,7 +9820,6 @@ public: #endif // !FEATURE_EH_FUNCLETS case GT_PHI_ARG: case GT_JMPTABLE: - case GT_REG_VAR: case GT_CLS_VAR: case GT_CLS_VAR_ADDR: case GT_ARGPLACE: diff --git a/src/coreclr/src/jit/compiler.hpp b/src/coreclr/src/jit/compiler.hpp index e798741..39f8710 100644 --- a/src/coreclr/src/jit/compiler.hpp +++ b/src/coreclr/src/jit/compiler.hpp @@ -4286,7 +4286,6 @@ void GenTree::VisitOperands(TVisitor visitor) #endif // !FEATURE_EH_FUNCLETS case GT_PHI_ARG: case GT_JMPTABLE: - case GT_REG_VAR: case GT_CLS_VAR: case GT_CLS_VAR_ADDR: case GT_ARGPLACE: diff --git a/src/coreclr/src/jit/flowgraph.cpp b/src/coreclr/src/jit/flowgraph.cpp index b3f8994..c9224b0 100644 --- a/src/coreclr/src/jit/flowgraph.cpp +++ b/src/coreclr/src/jit/flowgraph.cpp @@ -9687,7 +9687,7 @@ VARSET_VALRET_TP Compiler::fgGetVarBits(GenTree* tree) { VARSET_TP varBits(VarSetOps::MakeEmpty(this)); - assert(tree->gtOper == GT_LCL_VAR || tree->gtOper == GT_LCL_FLD || tree->gtOper == GT_REG_VAR); + assert(tree->gtOper == GT_LCL_VAR || tree->gtOper == GT_LCL_FLD); unsigned int lclNum = tree->gtLclVarCommon.gtLclNum; LclVarDsc* varDsc = lvaTable + lclNum; diff --git a/src/coreclr/src/jit/gcinfo.cpp b/src/coreclr/src/jit/gcinfo.cpp index 16384e4..ed4c468 100644 --- a/src/coreclr/src/jit/gcinfo.cpp +++ b/src/coreclr/src/jit/gcinfo.cpp @@ -276,8 +276,7 @@ GCInfo::WriteBarrierForm GCInfo::gcIsWriteBarrierCandidate(GenTree* tgt, GenTree case GT_CLS_VAR: return WBF_BarrierUnchecked; - case GT_REG_VAR: /* Definitely not in the managed heap */ - case GT_LCL_VAR: + case GT_LCL_VAR: /* Definitely not in the managed heap */ case GT_LCL_FLD: case GT_STORE_LCL_VAR: case GT_STORE_LCL_FLD: @@ -704,18 +703,9 @@ GCInfo::WriteBarrierForm GCInfo::gcWriteBarrierFormFromTargetAddress(GenTree* tg // No need for a GC barrier when writing to a local variable. return GCInfo::WBF_NoBarrier; } - if (tgtAddr->OperGet() == GT_LCL_VAR || tgtAddr->OperGet() == GT_REG_VAR) + if (tgtAddr->OperGet() == GT_LCL_VAR) { - unsigned lclNum = 0; - if (tgtAddr->gtOper == GT_LCL_VAR) - { - lclNum = tgtAddr->gtLclVar.gtLclNum; - } - else - { - assert(tgtAddr->gtOper == GT_REG_VAR); - lclNum = tgtAddr->gtRegVar.gtLclNum; - } + unsigned lclNum = tgtAddr->AsLclVar()->GetLclNum(); LclVarDsc* varDsc = &compiler->lvaTable[lclNum]; diff --git a/src/coreclr/src/jit/gentree.cpp b/src/coreclr/src/jit/gentree.cpp index 6d36b0b..4fed884 100644 --- a/src/coreclr/src/jit/gentree.cpp +++ b/src/coreclr/src/jit/gentree.cpp @@ -227,10 +227,6 @@ LONG GenTree::s_gtNodeCounts[GT_COUNT + 1] = {0}; /* static */ void GenTree::InitNodeSize() { - /* 'GT_LCL_VAR' often gets changed to 'GT_REG_VAR' */ - - assert(GenTree::s_gtNodeSizes[GT_LCL_VAR] >= GenTree::s_gtNodeSizes[GT_REG_VAR]); - /* Set all sizes to 'small' first */ for (unsigned op = 0; op <= GT_COUNT; op++) @@ -315,7 +311,6 @@ void GenTree::InitNodeSize() static_assert_no_msg(sizeof(GenTreeLclVarCommon) <= TREE_NODE_SZ_SMALL); static_assert_no_msg(sizeof(GenTreeLclVar) <= TREE_NODE_SZ_SMALL); static_assert_no_msg(sizeof(GenTreeLclFld) <= TREE_NODE_SZ_SMALL); - static_assert_no_msg(sizeof(GenTreeRegVar) <= TREE_NODE_SZ_SMALL); static_assert_no_msg(sizeof(GenTreeCC) <= TREE_NODE_SZ_SMALL); static_assert_no_msg(sizeof(GenTreeCast) <= TREE_NODE_SZ_LARGE); // *** large node static_assert_no_msg(sizeof(GenTreeBox) <= TREE_NODE_SZ_LARGE); // *** large node @@ -4709,7 +4704,6 @@ bool GenTree::TryGetUse(GenTree* def, GenTree*** use) #endif // !FEATURE_EH_FUNCLETS case GT_PHI_ARG: case GT_JMPTABLE: - case GT_REG_VAR: case GT_CLS_VAR: case GT_CLS_VAR_ADDR: case GT_ARGPLACE: @@ -6744,9 +6738,6 @@ GenTree* Compiler::gtClone(GenTree* tree, bool complexOK) GenTreeClsVar(tree->gtType, tree->gtClsVar.gtClsVarHnd, tree->gtClsVar.gtFieldSeq); break; - case GT_REG_VAR: - assert(!"clone regvar"); - default: if (!complexOK) { @@ -6956,10 +6947,6 @@ GenTree* Compiler::gtCloneExpr( copy = gtNewArgPlaceHolderNode(tree->gtType, tree->gtArgPlace.gtArgPlaceClsHnd); goto DONE; - case GT_REG_VAR: - NO_WAY("Cloning of GT_REG_VAR node not supported"); - goto DONE; - case GT_FTN_ADDR: copy = new (this, oper) GenTreeFptrVal(tree->gtType, tree->gtFptrVal.gtFptrMethod); @@ -8372,7 +8359,6 @@ GenTreeUseEdgeIterator::GenTreeUseEdgeIterator(GenTree* node) #endif // !FEATURE_EH_FUNCLETS case GT_PHI_ARG: case GT_JMPTABLE: - case GT_REG_VAR: case GT_CLS_VAR: case GT_CLS_VAR_ADDR: case GT_ARGPLACE: @@ -9453,7 +9439,6 @@ void Compiler::gtDispNode(GenTree* tree, IndentStack* indentStack, __in __in_z _ case GT_LCL_FLD_ADDR: case GT_STORE_LCL_FLD: case GT_STORE_LCL_VAR: - case GT_REG_VAR: if (tree->gtFlags & GTF_VAR_USEASG) { printf("U"); @@ -10315,29 +10300,6 @@ void Compiler::gtDispLeaf(GenTree* tree, IndentStack* indentStack) } break; - case GT_REG_VAR: - printf(" "); - gtDispLclVar(tree->gtRegVar.gtLclNum); - if (isFloatRegType(tree->gtType)) - { - assert(tree->gtRegVar.gtRegNum == tree->gtRegNum); - printf(" FPV%u", tree->gtRegNum); - } - else - { - printf(" %s", compRegVarName(tree->gtRegVar.gtRegNum)); - } - - varNum = tree->gtRegVar.gtLclNum; - varDsc = &lvaTable[varNum]; - - if (varDsc->lvTracked && fgLocalVarLivenessDone && ((tree->gtFlags & GTF_VAR_DEATH) != 0)) - { - printf(" (last use)"); - } - - break; - case GT_JMP: { const char* methodName; diff --git a/src/coreclr/src/jit/gentree.h b/src/coreclr/src/jit/gentree.h index 360fa1b..796d723 100644 --- a/src/coreclr/src/jit/gentree.h +++ b/src/coreclr/src/jit/gentree.h @@ -757,9 +757,8 @@ public: // well to make sure it's the right operator for the particular flag. //--------------------------------------------------------------------- -// NB: GTF_VAR_* and GTF_REG_* share the same namespace of flags, because -// GT_LCL_VAR nodes may be changed to GT_REG_VAR nodes without resetting -// the flags. These are also used by GT_LCL_FLD. +// NB: GTF_VAR_* and GTF_REG_* share the same namespace of flags. +// These flags are also used by GT_LCL_FLD. #define GTF_VAR_DEF 0x80000000 // GT_LCL_VAR -- this is a definition #define GTF_VAR_USEASG 0x40000000 // GT_LCL_VAR -- this is a partial definition, a use of the previous definition is implied // A partial definition usually occurs when a struct field is assigned to (s.f = ...) or @@ -772,8 +771,8 @@ public: // TODO-Cleanup: Currently, GTF_REG_BIRTH is used only by stackfp // We should consider using it more generally for VAR_BIRTH, instead of // GTF_VAR_DEF && !GTF_VAR_USEASG -#define GTF_REG_BIRTH 0x04000000 // GT_REG_VAR -- enregistered variable born here -#define GTF_VAR_DEATH 0x02000000 // GT_LCL_VAR, GT_REG_VAR -- variable dies here (last use) +#define GTF_REG_BIRTH 0x04000000 // GT_LCL_VAR, -- enregistered variable born here +#define GTF_VAR_DEATH 0x02000000 // GT_LCL_VAR, -- variable dies here (last use) #define GTF_VAR_ARR_INDEX 0x00000020 // The variable is part of (the index portion of) an array index expression. // Shares a value with GTF_REVERSE_OPS, which is meaningless for local var. @@ -1081,8 +1080,8 @@ public: static bool OperIsLocal(genTreeOps gtOper) { bool result = (OperKind(gtOper) & GTK_LOCAL) != 0; - assert(result == (gtOper == GT_LCL_VAR || gtOper == GT_PHI_ARG || gtOper == GT_REG_VAR || - gtOper == GT_LCL_FLD || gtOper == GT_STORE_LCL_VAR || gtOper == GT_STORE_LCL_FLD)); + assert(result == (gtOper == GT_LCL_VAR || gtOper == GT_PHI_ARG || gtOper == GT_LCL_FLD || + gtOper == GT_STORE_LCL_VAR || gtOper == GT_STORE_LCL_FLD)); return result; } @@ -1103,7 +1102,7 @@ public: static bool OperIsScalarLocal(genTreeOps gtOper) { - return (gtOper == GT_LCL_VAR || gtOper == GT_REG_VAR || gtOper == GT_STORE_LCL_VAR); + return (gtOper == GT_LCL_VAR || gtOper == GT_STORE_LCL_VAR); } static bool OperIsNonPhiLocal(genTreeOps gtOper) @@ -1966,18 +1965,20 @@ public: bool IsRegVarDeath() const { - assert(OperGet() == GT_REG_VAR); + unreached(); return (gtFlags & GTF_VAR_DEATH) ? true : false; } bool IsRegVarBirth() const { - assert(OperGet() == GT_REG_VAR); + unreached(); return (gtFlags & GTF_REG_BIRTH) ? true : false; } + bool IsReverseOp() const { return (gtFlags & GTF_REVERSE_OPS) ? true : false; } + bool IsUnsigned() const { return ((gtFlags & GTF_UNSIGNED) != 0); @@ -2810,66 +2811,6 @@ struct GenTreeLclFld : public GenTreeLclVarCommon #endif }; -struct GenTreeRegVar : public GenTreeLclVarCommon -{ - // TODO-Cleanup: Note that the base class GenTree already has a gtRegNum field. - // It's not clear exactly why a GT_REG_VAR has a separate field. When - // GT_REG_VAR is created, the two are identical. It appears that they may - // or may not remain so. In particular, there is a comment in stackfp.cpp - // that states: - // - // There used to be an assertion: assert(src->gtRegNum == src->gtRegVar.gtRegNum, ...) - // here, but there's actually no reason to assume that. AFAICT, for FP vars under stack FP, - // src->gtRegVar.gtRegNum is the allocated stack pseudo-register, but src->gtRegNum is the - // FP stack position into which that is loaded to represent a particular use of the variable. - // - // It might be the case that only for stackfp do they ever differ. - // - // The following might be possible: the GT_REG_VAR node has a last use prior to a complex - // subtree being evaluated. It could then be spilled from the register. Later, - // it could be unspilled into a different register, which would be recorded at - // the unspill time in the GenTree::gtRegNum, whereas GenTreeRegVar::gtRegNum - // is left alone. It's not clear why that is useful. - // - // Assuming there is a particular use, like stack fp, that requires it, maybe we - // can get rid of GT_REG_VAR and just leave it as GT_LCL_VAR, using the base class gtRegNum field. - // If we need it for stackfp, we could add a GenTreeStackFPRegVar type, which carries both the - // pieces of information, in a clearer and more specific way (in particular, with - // a different member name). - // - -private: - regNumberSmall _gtRegNum; - -public: - GenTreeRegVar(var_types type, unsigned lclNum, regNumber regNum) : GenTreeLclVarCommon(GT_REG_VAR, type, lclNum) - { - gtRegNum = regNum; - } - - // The register number is stored in a small format (8 bits), but the getters return and the setters take - // a full-size (unsigned) format, to localize the casts here. - - __declspec(property(get = GetRegNum, put = SetRegNum)) regNumber gtRegNum; - - regNumber GetRegNum() const - { - return (regNumber)_gtRegNum; - } - - void SetRegNum(regNumber reg) - { - _gtRegNum = (regNumberSmall)reg; - assert(_gtRegNum == reg); - } - -#if DEBUGGABLE_GENTREE - GenTreeRegVar() : GenTreeLclVarCommon() - { - } -#endif -}; - /* gtCast -- conversion to a different type (GT_CAST) */ struct GenTreeCast : public GenTreeOp diff --git a/src/coreclr/src/jit/gtlist.h b/src/coreclr/src/jit/gtlist.h index 7fe5b2f..1885926 100644 --- a/src/coreclr/src/jit/gtlist.h +++ b/src/coreclr/src/jit/gtlist.h @@ -280,7 +280,6 @@ GTNODE(SWITCH_TABLE , GenTreeOp ,0, GTK_BINOP|GTK_NOVALUE) // Jump // Nodes used only within the code generator: //----------------------------------------------------------------------------- -GTNODE(REG_VAR , GenTreeLclVar ,0,GTK_LEAF|GTK_LOCAL) // register variable GTNODE(CLS_VAR , GenTreeClsVar ,0,GTK_LEAF) // static data member GTNODE(CLS_VAR_ADDR , GenTreeClsVar ,0,GTK_LEAF) // static data member address GTNODE(ARGPLACE , GenTreeArgPlace ,0,GTK_LEAF|GTK_NOVALUE|GTK_NOTLIR) // placeholder for a register arg diff --git a/src/coreclr/src/jit/gtstructs.h b/src/coreclr/src/jit/gtstructs.h index 2eac435..e6041c9 100644 --- a/src/coreclr/src/jit/gtstructs.h +++ b/src/coreclr/src/jit/gtstructs.h @@ -62,10 +62,9 @@ GTSTRUCT_1(IntCon , GT_CNS_INT) GTSTRUCT_1(LngCon , GT_CNS_LNG) GTSTRUCT_1(DblCon , GT_CNS_DBL) GTSTRUCT_1(StrCon , GT_CNS_STR) -GTSTRUCT_N(LclVarCommon, GT_LCL_VAR, GT_LCL_FLD, GT_REG_VAR, GT_PHI_ARG, GT_STORE_LCL_VAR, GT_STORE_LCL_FLD, GT_LCL_VAR_ADDR, GT_LCL_FLD_ADDR) +GTSTRUCT_N(LclVarCommon, GT_LCL_VAR, GT_LCL_FLD, GT_PHI_ARG, GT_STORE_LCL_VAR, GT_STORE_LCL_FLD, GT_LCL_VAR_ADDR, GT_LCL_FLD_ADDR) GTSTRUCT_3(LclVar , GT_LCL_VAR, GT_LCL_VAR_ADDR, GT_STORE_LCL_VAR) GTSTRUCT_3(LclFld , GT_LCL_FLD, GT_STORE_LCL_FLD, GT_LCL_FLD_ADDR) -GTSTRUCT_1(RegVar , GT_REG_VAR) GTSTRUCT_1(Cast , GT_CAST) GTSTRUCT_1(Box , GT_BOX) GTSTRUCT_1(Field , GT_FIELD) diff --git a/src/coreclr/src/jit/liveness.cpp b/src/coreclr/src/jit/liveness.cpp index a92cc34..df28bc3 100644 --- a/src/coreclr/src/jit/liveness.cpp +++ b/src/coreclr/src/jit/liveness.cpp @@ -1324,7 +1324,7 @@ VARSET_VALRET_TP Compiler::fgUpdateLiveSet(VARSET_VALARG_TP liveSet, GenTree* tr VARSET_TP newLiveSet(VarSetOps::MakeCopy(this, liveSet)); assert(fgLocalVarLivenessDone == true); GenTree* lclVarTree = tree; // After the tests below, "lclVarTree" will be the local variable. - if (tree->gtOper == GT_LCL_VAR || tree->gtOper == GT_LCL_FLD || tree->gtOper == GT_REG_VAR || + if (tree->gtOper == GT_LCL_VAR || tree->gtOper == GT_LCL_FLD || (lclVarTree = fgIsIndirOfAddrOfLocal(tree)) != nullptr) { const VARSET_TP& varBits(fgGetVarBits(lclVarTree)); diff --git a/src/coreclr/src/jit/lower.cpp b/src/coreclr/src/jit/lower.cpp index f7bd292..5c5ef9f 100644 --- a/src/coreclr/src/jit/lower.cpp +++ b/src/coreclr/src/jit/lower.cpp @@ -2041,8 +2041,8 @@ void Lowering::LowerFastTailCall(GenTreeCall* call) { if (treeNode->OperIsLocal() || treeNode->OperIsLocalAddr()) { - // This should neither be a GT_REG_VAR nor GT_PHI_ARG. - assert((treeNode->OperGet() != GT_REG_VAR) && (treeNode->OperGet() != GT_PHI_ARG)); + // This should not be a GT_PHI_ARG. + assert(treeNode->OperGet() != GT_PHI_ARG); GenTreeLclVarCommon* lcl = treeNode->AsLclVarCommon(); LclVarDsc* lclVar = &comp->lvaTable[lcl->gtLclNum]; diff --git a/src/coreclr/src/jit/morph.cpp b/src/coreclr/src/jit/morph.cpp index 164bf89..03bd453 100644 --- a/src/coreclr/src/jit/morph.cpp +++ b/src/coreclr/src/jit/morph.cpp @@ -8541,8 +8541,7 @@ NO_TAIL_CALL: { structHnd = call->gtRetClsHnd; if (info.compCompHnd->isStructRequiringStackAllocRetBuf(structHnd) && - !((dest->OperGet() == GT_LCL_VAR || dest->OperGet() == GT_REG_VAR) && - dest->gtLclVar.gtLclNum == info.compRetBuffArg)) + !(dest->OperGet() == GT_LCL_VAR && dest->gtLclVar.gtLclNum == info.compRetBuffArg)) { origDest = dest; diff --git a/src/coreclr/src/jit/rationalize.cpp b/src/coreclr/src/jit/rationalize.cpp index ecb072d..407c9f8 100644 --- a/src/coreclr/src/jit/rationalize.cpp +++ b/src/coreclr/src/jit/rationalize.cpp @@ -16,9 +16,6 @@ genTreeOps storeForm(genTreeOps loadForm) return GT_STORE_LCL_VAR; case GT_LCL_FLD: return GT_STORE_LCL_FLD; - case GT_REG_VAR: - noway_assert(!"reg vars only supported in classic backend\n"); - unreached(); default: noway_assert(!"not a data load opcode\n"); unreached(); @@ -416,7 +413,6 @@ void Rationalizer::RewriteAssignment(LIR::Use& use) { case GT_LCL_VAR: case GT_LCL_FLD: - case GT_REG_VAR: case GT_PHI_ARG: RewriteAssignmentIntoStoreLclCore(assignment, location, value, locationOp); BlockRange().Remove(location); diff --git a/src/coreclr/src/jit/regset.cpp b/src/coreclr/src/jit/regset.cpp index 8e41edf..94e3252 100644 --- a/src/coreclr/src/jit/regset.cpp +++ b/src/coreclr/src/jit/regset.cpp @@ -348,7 +348,6 @@ void RegSet::rsSpillTree(regNumber reg, GenTree* tree, unsigned regIdx /* =0 */) // In case of multi-reg call nodes only the spill flag // associated with the reg is cleared. Spill flag on // call node should be cleared by the caller of this method. - assert(tree->gtOper != GT_REG_VAR); assert((tree->gtFlags & GTF_SPILL) != 0); unsigned regFlags = 0; diff --git a/src/coreclr/src/jit/valuenum.cpp b/src/coreclr/src/jit/valuenum.cpp index 852cd65..a90f067 100644 --- a/src/coreclr/src/jit/valuenum.cpp +++ b/src/coreclr/src/jit/valuenum.cpp @@ -6883,7 +6883,6 @@ void Compiler::fgValueNumberTree(GenTree* tree) switch (oper) { case GT_LCL_VAR: - case GT_REG_VAR: { GenTreeLclVarCommon* lcl = tree->AsLclVarCommon(); unsigned lclNum = lcl->gtLclNum; @@ -7252,7 +7251,6 @@ void Compiler::fgValueNumberTree(GenTree* tree) switch (lhs->OperGet()) { case GT_LCL_VAR: - case GT_REG_VAR: { GenTreeLclVarCommon* lcl = lhs->AsLclVarCommon(); unsigned lclDefSsaNum = GetSsaNumForLocalVarDef(lcl); -- 2.7.4