@@ -62,12 +62,6 @@ cl::opt<bool> ApplyExtTspWithoutProfile(
6262 " ext-tsp-apply-without-profile" ,
6363 cl::desc (" Whether to apply ext-tsp placement for instances w/o profile" ),
6464 cl::init(true ), cl::Hidden);
65-
66- namespace codelayout {
67- cl::opt<unsigned >
68- CDMaxChainSize (" cdsort-max-chain-size" , cl::Hidden, cl::init(128 ),
69- cl::desc (" The maximum size of a chain to create" ));
70- }
7165} // namespace llvm
7266
7367// Algorithm-specific params for Ext-TSP. The values are tuned for the best
@@ -129,6 +123,10 @@ static cl::opt<unsigned> CacheEntries("cds-cache-entries", cl::ReallyHidden,
129123static cl::opt<unsigned > CacheSize (" cds-cache-size" , cl::ReallyHidden,
130124 cl::desc (" The size of a line in the cache" ));
131125
126+ static cl::opt<unsigned >
127+ CDMaxChainSize (" cdsort-max-chain-size" , cl::ReallyHidden,
128+ cl::desc (" The maximum size of a chain to create" ));
129+
132130static cl::opt<double > DistancePower (
133131 " cds-distance-power" , cl::ReallyHidden,
134132 cl::desc (" The power exponent for the distance-based locality" ));
@@ -1163,7 +1161,7 @@ class CDSortImpl {
11631161 if (Edge->isSelfEdge ())
11641162 continue ;
11651163 if (Edge->srcChain ()->numBlocks () + Edge->dstChain ()->numBlocks () >
1166- CDMaxChainSize )
1164+ Config. MaxChainSize )
11671165 continue ;
11681166
11691167 // Compute the gain of merging the two chains.
@@ -1461,6 +1459,8 @@ std::vector<uint64_t> codelayout::computeCacheDirectedLayout(
14611459 Config.CacheEntries = CacheEntries;
14621460 if (CacheSize.getNumOccurrences () > 0 )
14631461 Config.CacheSize = CacheSize;
1462+ if (CDMaxChainSize.getNumOccurrences () > 0 )
1463+ Config.MaxChainSize = CDMaxChainSize;
14641464 if (DistancePower.getNumOccurrences () > 0 )
14651465 Config.DistancePower = DistancePower;
14661466 if (FrequencyScale.getNumOccurrences () > 0 )
0 commit comments