@@ -719,7 +719,7 @@ class LocalAddressVisitor final : public GenTreeVisitor<LocalAddressVisitor>
719
719
GenTreeCall* callUser = user->IsCall() ? user->AsCall() : nullptr;
720
720
bool hasHiddenStructArg = false;
721
721
if (m_compiler->opts.compJitOptimizeStructHiddenBuffer && (callUser != nullptr) &&
722
- IsValidLclAddr(lclNum, val.Offset()))
722
+ m_compiler-> IsValidLclAddr(lclNum, val.Offset()))
723
723
{
724
724
// We will only attempt this optimization for locals that are:
725
725
// a) Not susceptible to liveness bugs (see "lvaSetHiddenBufferStructArg").
@@ -805,6 +805,7 @@ class LocalAddressVisitor final : public GenTreeVisitor<LocalAddressVisitor>
805
805
unsigned indirSize = node->AsIndir()->Size();
806
806
bool isWide;
807
807
808
+ // TODO-Cleanup: delete "indirSize == 0", use "Compiler::IsValidLclAddr".
808
809
if ((indirSize == 0) || ((offset + indirSize) > UINT16_MAX))
809
810
{
810
811
// 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>
856
857
assert(addr->TypeIs(TYP_BYREF, TYP_I_IMPL));
857
858
assert(m_compiler->lvaVarAddrExposed(lclNum) || m_compiler->lvaGetDesc(lclNum)->IsHiddenBufferStructArg());
858
859
859
- if (IsValidLclAddr(lclNum, offset))
860
+ if (m_compiler-> IsValidLclAddr(lclNum, offset))
860
861
{
861
862
addr->ChangeOper(GT_LCL_ADDR);
862
863
addr->AsLclFld()->SetLclNum(lclNum);
@@ -1449,24 +1450,6 @@ class LocalAddressVisitor final : public GenTreeVisitor<LocalAddressVisitor>
1449
1450
}
1450
1451
1451
1452
private:
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
-
1470
1453
//------------------------------------------------------------------------
1471
1454
// IsUnused: is the given node unused?
1472
1455
//
0 commit comments