From d9f453924f7c3cca9f02d920a57e1477293f216e Mon Sep 17 00:00:00 2001 From: Jakob Botsch Nielsen Date: Tue, 14 Mar 2023 11:43:28 +0100 Subject: [PATCH] JIT: Remove lvaPInvokeFrameRegSaveVar (#83309) This does not seem to be used for anything meaningful. Fix #83052 --- src/coreclr/jit/compiler.h | 3 --- src/coreclr/jit/compiler.hpp | 2 +- src/coreclr/jit/flowgraph.cpp | 11 ----------- src/coreclr/jit/gentree.cpp | 4 ---- src/coreclr/jit/lclvars.cpp | 5 ++--- 5 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 408e494..ac83843 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -3245,9 +3245,6 @@ public: unsigned lvaInlinedPInvokeFrameVar; // variable representing the InlinedCallFrame unsigned lvaReversePInvokeFrameVar; // variable representing the reverse PInvoke frame -#if FEATURE_FIXED_OUT_ARGS - unsigned lvaPInvokeFrameRegSaveVar; // variable representing the RegSave for PInvoke inlining. -#endif unsigned lvaMonAcquired; // boolean variable introduced into in synchronized methods // that tracks whether the lock has been taken diff --git a/src/coreclr/jit/compiler.hpp b/src/coreclr/jit/compiler.hpp index 94dcf70..e6f48d9 100644 --- a/src/coreclr/jit/compiler.hpp +++ b/src/coreclr/jit/compiler.hpp @@ -3935,7 +3935,7 @@ bool Compiler::fgVarIsNeverZeroInitializedInProlog(unsigned varNum) (varNum == lvaInlinedPInvokeFrameVar) || (varNum == lvaStubArgumentVar) || (varNum == lvaRetAddrVar); #if FEATURE_FIXED_OUT_ARGS - result = result || (varNum == lvaPInvokeFrameRegSaveVar) || (varNum == lvaOutgoingArgSpaceVar); + result = result || (varNum == lvaOutgoingArgSpaceVar); #endif #if defined(FEATURE_EH_FUNCLETS) diff --git a/src/coreclr/jit/flowgraph.cpp b/src/coreclr/jit/flowgraph.cpp index 00690d0..6c26294 100644 --- a/src/coreclr/jit/flowgraph.cpp +++ b/src/coreclr/jit/flowgraph.cpp @@ -2668,17 +2668,6 @@ PhaseStatus Compiler::fgAddInternal() LclVarDsc* varDsc = lvaGetDesc(lvaInlinedPInvokeFrameVar); // Make room for the inlined frame. lvaSetStruct(lvaInlinedPInvokeFrameVar, typGetBlkLayout(eeGetEEInfo()->inlinedCallFrameInfo.size), false); -#if FEATURE_FIXED_OUT_ARGS - // Grab and reserve space for TCB, Frame regs used in PInvoke epilog to pop the inlined frame. - // See genPInvokeMethodEpilog() for use of the grabbed var. This is only necessary if we are - // not using the P/Invoke helpers. - if (!opts.ShouldUsePInvokeHelpers() && compJmpOpUsed) - { - lvaPInvokeFrameRegSaveVar = lvaGrabTempWithImplicitUse(false DEBUGARG("PInvokeFrameRegSave Var")); - varDsc = lvaGetDesc(lvaPInvokeFrameRegSaveVar); - lvaSetStruct(lvaPInvokeFrameRegSaveVar, typGetBlkLayout(2 * REGSIZE_BYTES), false); - } -#endif } // Do we need to insert a "JustMyCode" callback? diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index 8b71e77..64d0a72 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -11110,10 +11110,6 @@ void Compiler::gtGetLclVarNameInfo(unsigned lclNum, const char** ilKindOut, cons ilName = "ReturnAddress"; } #if FEATURE_FIXED_OUT_ARGS - else if (lclNum == lvaPInvokeFrameRegSaveVar) - { - ilName = "PInvokeFrameRegSave"; - } else if (lclNum == lvaOutgoingArgSpaceVar) { ilName = "OutArgs"; diff --git a/src/coreclr/jit/lclvars.cpp b/src/coreclr/jit/lclvars.cpp index dfd4ffe..bbb559c 100644 --- a/src/coreclr/jit/lclvars.cpp +++ b/src/coreclr/jit/lclvars.cpp @@ -52,9 +52,8 @@ void Compiler::lvaInit() lvaInlinedPInvokeFrameVar = BAD_VAR_NUM; lvaReversePInvokeFrameVar = BAD_VAR_NUM; #if FEATURE_FIXED_OUT_ARGS - lvaPInvokeFrameRegSaveVar = BAD_VAR_NUM; - lvaOutgoingArgSpaceVar = BAD_VAR_NUM; - lvaOutgoingArgSpaceSize = PhasedVar(); + lvaOutgoingArgSpaceVar = BAD_VAR_NUM; + lvaOutgoingArgSpaceSize = PhasedVar(); #endif // FEATURE_FIXED_OUT_ARGS #ifdef JIT32_GCENCODER lvaLocAllocSPvar = BAD_VAR_NUM; -- 2.7.4