From 5cfff119dbd8dd7a925a5db6fdb33f4f6487cb3a Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Sun, 30 Oct 2022 07:27:07 -0700 Subject: [PATCH] Revert "Set DNER for all local fields (#77341)" This reverts commit 4e85471628214a3e6257132cadd8f7fd33299eb0. --- src/coreclr/jit/morph.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp index eb4a019a73dfa..17a8ed97cbd26 100644 --- a/src/coreclr/jit/morph.cpp +++ b/src/coreclr/jit/morph.cpp @@ -16166,6 +16166,10 @@ void Compiler::fgMorphLocalField(GenTree* tree, GenTree* parent) } else { + // There is no existing field that has all the parts that we need + // So we must ensure that the struct lives in memory. + lvaSetVarDoNotEnregister(lclNum DEBUGARG(DoNotEnregisterReason::LocalField)); + #ifdef DEBUG // We can't convert this guy to a float because he really does have his // address taken.. @@ -16174,12 +16178,6 @@ void Compiler::fgMorphLocalField(GenTree* tree, GenTree* parent) } } } - - // If we haven't replaced the field, make sure to set DNER on the local. - if (tree->OperIs(GT_LCL_FLD)) - { - lvaSetVarDoNotEnregister(lclNum DEBUGARG(DoNotEnregisterReason::LocalField)); - } } //------------------------------------------------------------------------