From ca873eade187c0ad81335581a2b1c0c39ac53e07 Mon Sep 17 00:00:00 2001 From: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com> Date: Thu, 15 Dec 2022 20:00:10 +0300 Subject: [PATCH] Do not avoid LCL_FLDs for indirectly accessed locals (#77980) They will have to be DNERed anyway. --- src/coreclr/jit/morphblock.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/coreclr/jit/morphblock.cpp b/src/coreclr/jit/morphblock.cpp index 02394178baea7..3dc11df1a66bf 100644 --- a/src/coreclr/jit/morphblock.cpp +++ b/src/coreclr/jit/morphblock.cpp @@ -843,8 +843,10 @@ void MorphCopyBlockHelper::MorphStructCases() // bool requiresCopyBlock = false; - // If either src or dest is a reg-sized non-field-addressed struct, keep the copyBlock. - if ((m_dstVarDsc != nullptr && m_dstVarDsc->lvRegStruct) || (m_srcVarDsc != nullptr && m_srcVarDsc->lvRegStruct)) + // If either src or dest is a reg-sized non-field-addressed struct, keep the copyBlock; + // this will avoid having to DNER the enregisterable local when creating LCL_FLD nodes. + if ((m_dst->OperIs(GT_LCL_VAR) && m_dstVarDsc->lvRegStruct) || + (m_src->OperIs(GT_LCL_VAR) && m_srcVarDsc->lvRegStruct)) { requiresCopyBlock = true; }