Skip to content

Commit 9658056

Browse files
Use OperIsAnyLocal in more places
1 parent ceb634e commit 9658056

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/coreclr/jit/fgdiagnostic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3436,7 +3436,7 @@ void Compiler::fgDebugCheckLinkedLocals()
34363436

34373437
bool ShouldLink(GenTree* node)
34383438
{
3439-
return node->OperIsLocal() || node->OperIs(GT_LCL_ADDR);
3439+
return node->OperIsAnyLocal();
34403440
}
34413441

34423442
public:
@@ -3524,7 +3524,7 @@ void Compiler::fgDebugCheckLinkedLocals()
35243524
int nodeIndex = 0;
35253525
for (GenTree* cur = first; cur != nullptr; cur = cur->gtNext)
35263526
{
3527-
success &= cur->OperIsLocal() || cur->OperIs(GT_LCL_ADDR);
3527+
success &= cur->OperIsAnyLocal();
35283528
success &= (nodeIndex < expected->Height()) && (cur == expected->Bottom(nodeIndex));
35293529
nodeIndex++;
35303530
}

src/coreclr/jit/gentree.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ void GenTree::DumpNodeSizes(FILE* fp)
567567
LocalsGenTreeList::iterator LocalsGenTreeList::begin() const
568568
{
569569
GenTree* first = m_stmt->GetTreeList();
570-
assert((first == nullptr) || first->OperIsLocal() || first->OperIs(GT_LCL_ADDR));
570+
assert((first == nullptr) || first->OperIsAnyLocal());
571571
return iterator(static_cast<GenTreeLclVarCommon*>(first));
572572
}
573573

@@ -2953,7 +2953,7 @@ bool GenTree::Compare(GenTree* op1, GenTree* op2, bool swapOK)
29532953

29542954
if (tree->OperIsLeaf())
29552955
{
2956-
if ((tree->OperIsLocal() || tree->OperIs(GT_LCL_ADDR)) && (tree->AsLclVarCommon()->GetLclNum() == lclNum))
2956+
if (tree->OperIsAnyLocal() && (tree->AsLclVarCommon()->GetLclNum() == lclNum))
29572957
{
29582958
return true;
29592959
}

src/coreclr/jit/gschecks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ void Compiler::gsParamsToShadows()
493493
{
494494
GenTree* tree = *use;
495495

496-
if (tree->OperIsLocal() || tree->OperIs(GT_LCL_ADDR))
496+
if (tree->OperIsAnyLocal())
497497
{
498498
unsigned int lclNum = tree->AsLclVarCommon()->GetLclNum();
499499
unsigned int shadowLclNum = m_compiler->gsShadowVarInfo[lclNum].shadowCopy;

src/coreclr/jit/lclmorph.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class LocalSequencer final : public GenTreeVisitor<LocalSequencer>
6565
else
6666
{
6767
assert(lastNode->gtNext == nullptr);
68-
assert(lastNode->OperIsLocal() || lastNode->OperIs(GT_LCL_ADDR));
68+
assert(lastNode->OperIsAnyLocal());
6969
}
7070

7171
firstNode->gtPrev = nullptr;
@@ -78,7 +78,7 @@ class LocalSequencer final : public GenTreeVisitor<LocalSequencer>
7878
fgWalkResult PostOrderVisit(GenTree** use, GenTree* user)
7979
{
8080
GenTree* node = *use;
81-
if (node->OperIsLocal() || node->OperIs(GT_LCL_ADDR))
81+
if (node->OperIsAnyLocal())
8282
{
8383
SequenceLocal(node->AsLclVarCommon());
8484
}
@@ -564,7 +564,7 @@ class LocalAddressVisitor final : public GenTreeVisitor<LocalAddressVisitor>
564564
MorphLocalField(node, user);
565565
}
566566

567-
if (node->OperIsLocal() || node->OperIs(GT_LCL_ADDR))
567+
if (node->OperIsAnyLocal())
568568
{
569569
unsigned const lclNum = node->AsLclVarCommon()->GetLclNum();
570570
LclVarDsc* const varDsc = m_compiler->lvaGetDesc(lclNum);

src/coreclr/jit/liveness.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,7 +2732,7 @@ void Compiler::fgInterBlockLocalVarLiveness()
27322732
{
27332733
for (GenTree* cur = stmt->GetTreeListEnd(); cur != nullptr;)
27342734
{
2735-
assert(cur->OperIsLocal() || cur->OperIs(GT_LCL_ADDR));
2735+
assert(cur->OperIsAnyLocal());
27362736
bool isDef = ((cur->gtFlags & GTF_VAR_DEF) != 0) && ((cur->gtFlags & GTF_VAR_USEASG) == 0);
27372737
bool conditional = cur != dst;
27382738
// Ignore conditional defs that would otherwise
@@ -2758,7 +2758,7 @@ void Compiler::fgInterBlockLocalVarLiveness()
27582758
{
27592759
for (GenTree* cur = stmt->GetTreeListEnd(); cur != nullptr;)
27602760
{
2761-
assert(cur->OperIsLocal() || cur->OperIs(GT_LCL_ADDR));
2761+
assert(cur->OperIsAnyLocal());
27622762
if (!fgComputeLifeLocal(life, keepAliveVars, cur))
27632763
{
27642764
cur = cur->gtPrev;

0 commit comments

Comments
 (0)