Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 1dbbc0f

Browse files
Rename cseArrLenMap to optCseArrLenMap
This lines up better with other names in code that optimizes common sub- expressions.
1 parent 98492cf commit 1dbbc0f

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/jit/compiler.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5412,11 +5412,11 @@ class Compiler
54125412

54135413
typedef SimplerHashTable<GenTreePtr, PtrKeyFuncs<GenTree>, GenTreePtr, JitSimplerHashBehavior> NodeToNodeMap;
54145414

5415-
NodeToNodeMap* cseArrLenMap; // Maps array length nodes to ancestor compares that should be
5416-
// re-numbered with the array length to improve range check elimination
5415+
NodeToNodeMap* optCseArrLenMap; // Maps array length nodes to ancestor compares that should be
5416+
// re-numbered with the array length to improve range check elimination
54175417

54185418
// Given a compare, look for a cse candidate arrlen feeding it and add a map entry if found.
5419-
void updateCseArrLenMap(GenTreePtr compare);
5419+
void optCseUpdateArrLenMap(GenTreePtr compare);
54205420

54215421
void optCSEstop();
54225422

src/jit/optcse.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@ void Compiler::optValnumCSE_Init()
510510
optCSECandidateCount = 0;
511511
optDoCSE = false; // Stays false until we find duplicate CSE tree
512512

513-
// cseArrLenMap is unused in most functions, allocated only when used
514-
cseArrLenMap = nullptr;
513+
// optCseArrLenMap is unused in most functions, allocated only when used
514+
optCseArrLenMap = nullptr;
515515
}
516516

517517
/*****************************************************************************
@@ -711,7 +711,7 @@ unsigned Compiler::optValnumCSE_Locate()
711711
// Check if this compare is a function of (one of) the arrary
712712
// length candidate(s); we may want to update its value number
713713
// if the array length gets CSEd
714-
updateCseArrLenMap(tree);
714+
optCseUpdateArrLenMap(tree);
715715
}
716716

717717
if (!optIsCSEcandidate(tree))
@@ -766,16 +766,16 @@ unsigned Compiler::optValnumCSE_Locate()
766766
}
767767

768768
//------------------------------------------------------------------------
769-
// updateCseArrLenMap: Check if this compare is a tractable function of
769+
// optCseUpdateArrLenMap: Check if this compare is a tractable function of
770770
// an array length that is a CSE candidate, and insert
771-
// an entry in the cseArrLenMap if so. This facilitates
771+
// an entry in the optCseArrLenMap if so. This facilitates
772772
// subsequently updating the compare's value number if
773773
// the array length gets CSEd.
774774
//
775775
// Arguments:
776776
// compare - The compare node to check
777777

778-
void Compiler::updateCseArrLenMap(GenTreePtr compare)
778+
void Compiler::optCseUpdateArrLenMap(GenTreePtr compare)
779779
{
780780
assert(compare->OperIsCompare());
781781

@@ -850,13 +850,13 @@ void Compiler::updateCseArrLenMap(GenTreePtr compare)
850850
// record this in the map so we can update the compare VN if the array length
851851
// node gets CSEd.
852852

853-
if (cseArrLenMap == nullptr)
853+
if (optCseArrLenMap == nullptr)
854854
{
855855
// Allocate map on first use.
856-
cseArrLenMap = new (getAllocator()) NodeToNodeMap(getAllocator());
856+
optCseArrLenMap = new (getAllocator()) NodeToNodeMap(getAllocator());
857857
}
858858

859-
cseArrLenMap->Set(arrLen, compare);
859+
optCseArrLenMap->Set(arrLen, compare);
860860
}
861861
}
862862
}
@@ -2024,8 +2024,8 @@ class CSE_Heuristic
20242024
cse->gtVNPair.SetConservative(defConservativeVN);
20252025

20262026
GenTreePtr cmp;
2027-
if ((exp->OperGet() == GT_ARR_LENGTH) && (m_pCompiler->cseArrLenMap != nullptr) &&
2028-
(m_pCompiler->cseArrLenMap->Lookup(exp, &cmp)))
2027+
if ((exp->OperGet() == GT_ARR_LENGTH) && (m_pCompiler->optCseArrLenMap != nullptr) &&
2028+
(m_pCompiler->optCseArrLenMap->Lookup(exp, &cmp)))
20292029
{
20302030
// Propagate the new value number to this compare node as well, since
20312031
// subsequent range check elimination will try to correlate it with

0 commit comments

Comments
 (0)