@@ -62,12 +62,6 @@ cl::opt<bool> ApplyExtTspWithoutProfile(
62
62
" ext-tsp-apply-without-profile" ,
63
63
cl::desc (" Whether to apply ext-tsp placement for instances w/o profile" ),
64
64
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
- }
71
65
} // namespace llvm
72
66
73
67
// 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,
129
123
static cl::opt<unsigned > CacheSize (" cds-cache-size" , cl::ReallyHidden,
130
124
cl::desc (" The size of a line in the cache" ));
131
125
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
+
132
130
static cl::opt<double > DistancePower (
133
131
" cds-distance-power" , cl::ReallyHidden,
134
132
cl::desc (" The power exponent for the distance-based locality" ));
@@ -1163,7 +1161,7 @@ class CDSortImpl {
1163
1161
if (Edge->isSelfEdge ())
1164
1162
continue ;
1165
1163
if (Edge->srcChain ()->numBlocks () + Edge->dstChain ()->numBlocks () >
1166
- CDMaxChainSize )
1164
+ Config. MaxChainSize )
1167
1165
continue ;
1168
1166
1169
1167
// Compute the gain of merging the two chains.
@@ -1461,6 +1459,8 @@ std::vector<uint64_t> codelayout::computeCacheDirectedLayout(
1461
1459
Config.CacheEntries = CacheEntries;
1462
1460
if (CacheSize.getNumOccurrences () > 0 )
1463
1461
Config.CacheSize = CacheSize;
1462
+ if (CDMaxChainSize.getNumOccurrences () > 0 )
1463
+ Config.MaxChainSize = CDMaxChainSize;
1464
1464
if (DistancePower.getNumOccurrences () > 0 )
1465
1465
Config.DistancePower = DistancePower;
1466
1466
if (FrequencyScale.getNumOccurrences () > 0 )
0 commit comments