@@ -77,7 +77,8 @@ struct InitVarDscInfo; // defined in registerargconvention.h
7777class FgStack ; // defined in fgbasic.cpp
7878class Instrumentor ; // defined in fgprofile.cpp
7979class SpanningTreeVisitor ; // defined in fgprofile.cpp
80- class CSE_DataFlow ; // defined in OptCSE.cpp
80+ class CSE_DataFlow ; // defined in optcse.cpp
81+ struct CSEdsc ; // defined in optcse.h
8182class OptBoolsDsc ; // defined in optimizer.cpp
8283struct RelopImplicationInfo ; // defined in redundantbranchopts.cpp
8384struct JumpThreadInfo ; // defined in redundantbranchopts.cpp
@@ -2482,6 +2483,8 @@ class Compiler
24822483 friend class Phase ;
24832484 friend class Lowering ;
24842485 friend class CSE_DataFlow ;
2486+ friend class CSE_HeuristicCommon ;
2487+ friend class CSE_HeuristicRandom ;
24852488 friend class CSE_Heuristic ;
24862489 friend class CodeGenInterface ;
24872490 friend class CodeGen ;
@@ -7308,58 +7311,6 @@ class Compiler
73087311
73097312 EXPSET_TP cseCallKillsMask; // Computed once - A mask that is used to kill available CSEs at callsites
73107313
7311- /* Generic list of nodes - used by the CSE logic */
7312-
7313- struct treeLst
7314- {
7315- treeLst* tlNext;
7316- GenTree* tlTree;
7317- };
7318-
7319- struct treeStmtLst
7320- {
7321- treeStmtLst* tslNext;
7322- GenTree* tslTree; // tree node
7323- Statement* tslStmt; // statement containing the tree
7324- BasicBlock* tslBlock; // block containing the statement
7325- };
7326-
7327- // The following logic keeps track of expressions via a simple hash table.
7328-
7329- struct CSEdsc
7330- {
7331- CSEdsc* csdNextInBucket; // used by the hash table
7332- size_t csdHashKey; // the original hashkey
7333- ssize_t csdConstDefValue; // When we CSE similar constants, this is the value that we use as the def
7334- ValueNum csdConstDefVN; // When we CSE similar constants, this is the ValueNumber that we use for the LclVar
7335- // assignment
7336- unsigned csdIndex; // 1..optCSECandidateCount
7337- bool csdIsSharedConst; // true if this CSE is a shared const
7338- bool csdLiveAcrossCall;
7339-
7340- unsigned short csdDefCount; // definition count
7341- unsigned short csdUseCount; // use count (excluding the implicit uses at defs)
7342-
7343- weight_t csdDefWtCnt; // weighted def count
7344- weight_t csdUseWtCnt; // weighted use count (excluding the implicit uses at defs)
7345-
7346- GenTree* csdTree; // treenode containing the 1st occurrence
7347- Statement* csdStmt; // stmt containing the 1st occurrence
7348- BasicBlock* csdBlock; // block containing the 1st occurrence
7349-
7350- treeStmtLst* csdTreeList; // list of matching tree nodes: head
7351- treeStmtLst* csdTreeLast; // list of matching tree nodes: tail
7352-
7353- ValueNum defExcSetPromise; // The exception set that is now required for all defs of this CSE.
7354- // This will be set to NoVN if we decide to abandon this CSE
7355-
7356- ValueNum defExcSetCurrent; // The set of exceptions we currently can use for CSE uses.
7357-
7358- ValueNum defConservNormVN; // if all def occurrences share the same conservative normal value
7359- // number, this will reflect it; otherwise, NoVN.
7360- // not used for shared const CSE's
7361- };
7362-
73637314 static const size_t s_optCSEhashSizeInitial;
73647315 static const size_t s_optCSEhashGrowthFactor;
73657316 static const size_t s_optCSEhashBucketSize;
0 commit comments