From 2a2ebf9cf3e76d9672df77ec8597f5b8c96f3793 Mon Sep 17 00:00:00 2001 From: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com> Date: Tue, 23 Aug 2022 13:33:16 +0300 Subject: [PATCH] Fold TYP_STRUCT indirect access to promoted locals (#71584) --- src/coreclr/jit/lclmorph.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/coreclr/jit/lclmorph.cpp b/src/coreclr/jit/lclmorph.cpp index 6cfacbdf2e7ca..a94d89abd0b78 100644 --- a/src/coreclr/jit/lclmorph.cpp +++ b/src/coreclr/jit/lclmorph.cpp @@ -993,17 +993,17 @@ class LocalAddressVisitor final : public GenTreeVisitor return IndirTransform::None; } - if (varDsc->lvPromoted) - { - // TODO-ADDR: For now we ignore promoted variables, they require additional - // changes in subsequent phases. - return IndirTransform::None; - } - - // As we are only handling non-promoted STRUCT locals right now, the only - // possible transformation for non-STRUCT indirect uses is LCL_FLD. if (!varTypeIsStruct(indir)) { + if (varDsc->lvPromoted) + { + // TODO-ADDR: support promoted locals here by moving the promotion morphing + // from pre-order to post-order. + return IndirTransform::None; + } + + // As we are only handling non-promoted STRUCT locals right now, the only + // possible transformation for non-STRUCT indirect uses is LCL_FLD. assert(varDsc->TypeGet() == TYP_STRUCT); return IndirTransform::LclFld; }