@@ -719,7 +719,7 @@ class LocalAddressVisitor final : public GenTreeVisitor<LocalAddressVisitor>
719719 GenTreeCall* callUser = user->IsCall () ? user->AsCall () : nullptr ;
720720 bool hasHiddenStructArg = false ;
721721 if (m_compiler->opts .compJitOptimizeStructHiddenBuffer && (callUser != nullptr ) &&
722- IsValidLclAddr (lclNum, val.Offset ()))
722+ m_compiler-> IsValidLclAddr (lclNum, val.Offset ()))
723723 {
724724 // We will only attempt this optimization for locals that are:
725725 // a) Not susceptible to liveness bugs (see "lvaSetHiddenBufferStructArg").
@@ -805,6 +805,7 @@ class LocalAddressVisitor final : public GenTreeVisitor<LocalAddressVisitor>
805805 unsigned indirSize = node->AsIndir ()->Size ();
806806 bool isWide;
807807
808+ // TODO-Cleanup: delete "indirSize == 0", use "Compiler::IsValidLclAddr".
808809 if ((indirSize == 0 ) || ((offset + indirSize) > UINT16_MAX))
809810 {
810811 // If we can't figure out the indirection size then treat it as a wide indirection.
@@ -856,7 +857,7 @@ class LocalAddressVisitor final : public GenTreeVisitor<LocalAddressVisitor>
856857 assert (addr->TypeIs (TYP_BYREF, TYP_I_IMPL));
857858 assert (m_compiler->lvaVarAddrExposed (lclNum) || m_compiler->lvaGetDesc (lclNum)->IsHiddenBufferStructArg ());
858859
859- if (IsValidLclAddr (lclNum, offset))
860+ if (m_compiler-> IsValidLclAddr (lclNum, offset))
860861 {
861862 addr->ChangeOper (GT_LCL_ADDR);
862863 addr->AsLclFld ()->SetLclNum (lclNum);
@@ -1449,24 +1450,6 @@ class LocalAddressVisitor final : public GenTreeVisitor<LocalAddressVisitor>
14491450 }
14501451
14511452private:
1452- // ------------------------------------------------------------------------
1453- // IsValidLclAddr: Can the given local address be represented as "LCL_FLD_ADDR"?
1454- //
1455- // Local address nodes cannot point beyond the local and can only store
1456- // 16 bits worth of offset.
1457- //
1458- // Arguments:
1459- // lclNum - The local's number
1460- // offset - The address' offset
1461- //
1462- // Return Value:
1463- // Whether "LCL_FLD_ADDR<lclNum> [+offset]" would be valid IR.
1464- //
1465- bool IsValidLclAddr (unsigned lclNum, unsigned offset) const
1466- {
1467- return (offset < UINT16_MAX) && (offset < m_compiler->lvaLclExactSize (lclNum));
1468- }
1469-
14701453 // ------------------------------------------------------------------------
14711454 // IsUnused: is the given node unused?
14721455 //
0 commit comments