Skip to content

Commit

Permalink
Do not produce full-width local field stores for normalize-on-store l…
Browse files Browse the repository at this point in the history
…ocals (#76549)

The underlying stack location must always remain normalized.
  • Loading branch information
SingleAccretion authored Oct 4, 2022
1 parent 782aa15 commit dd6696a
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/coreclr/jit/lclmorph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1012,14 +1012,6 @@ class LocalAddressVisitor final : public GenTreeVisitor<LocalAddressVisitor>
return IndirTransform::LclVar;
}

// Locals are not enregistered when optimizations are disabled; there is no point
// in spending time finding LCL_VAR-equivalent trees for them. TODO-ADDR: move
// this check earlier.
if (m_compiler->opts.OptimizationDisabled())
{
return IndirTransform::LclFld;
}

// Bool and ubyte are the same type.
if ((indir->TypeIs(TYP_BOOL) && (varDsc->TypeGet() == TYP_UBYTE)) ||
(indir->TypeIs(TYP_UBYTE) && (varDsc->TypeGet() == TYP_BOOL)))
Expand All @@ -1035,6 +1027,11 @@ class LocalAddressVisitor final : public GenTreeVisitor<LocalAddressVisitor>
return IndirTransform::LclVar;
}

if (m_compiler->opts.OptimizationDisabled())
{
return IndirTransform::LclFld;
}

// Turn this into a bitcast if we can.
if ((genTypeSize(indir) == genTypeSize(varDsc)) && (varTypeIsFloating(indir) || varTypeIsFloating(varDsc)))
{
Expand Down

0 comments on commit dd6696a

Please sign in to comment.