@@ -91,10 +91,6 @@ static cl::list<std::string> InputFiles(cl::Positional, cl::OneOrMore,
91
91
cl::desc (" input files" ),
92
92
cl::cat(JITLinkCategory));
93
93
94
- static cl::opt<size_t > MaterializationThreads (
95
- " num-threads" , cl::desc(" Number of materialization threads to use" ),
96
- cl::init(std::numeric_limits<size_t >::max()), cl::cat(JITLinkCategory));
97
-
98
94
static cl::list<std::string>
99
95
LibrarySearchPaths (" L" ,
100
96
cl::desc (" Add dir to the list of library search paths" ),
@@ -404,7 +400,6 @@ bool lazyLinkingRequested() {
404
400
}
405
401
406
402
static Error applyHarnessPromotions (Session &S, LinkGraph &G) {
407
- std::lock_guard<std::mutex> Lock (S.M );
408
403
409
404
// If this graph is part of the test harness there's nothing to do.
410
405
if (S.HarnessFiles .empty () || S.HarnessFiles .count (G.getName ()))
@@ -455,11 +450,7 @@ static Error applyHarnessPromotions(Session &S, LinkGraph &G) {
455
450
return Error::success ();
456
451
}
457
452
458
- static void dumpSectionContents (raw_ostream &OS, Session &S, LinkGraph &G) {
459
- std::lock_guard<std::mutex> Lock (S.M );
460
-
461
- outs () << " Relocated section contents for " << G.getName () << " :\n " ;
462
-
453
+ static void dumpSectionContents (raw_ostream &OS, LinkGraph &G) {
463
454
constexpr orc::ExecutorAddrDiff DumpWidth = 16 ;
464
455
static_assert (isPowerOf2_64 (DumpWidth), " DumpWidth must be a power of two" );
465
456
@@ -851,7 +842,7 @@ static Expected<std::unique_ptr<ExecutorProcessControl>> launchExecutor() {
851
842
S.CreateMemoryManager = createSharedMemoryManager;
852
843
853
844
return SimpleRemoteEPC::Create<FDSimpleRemoteEPCTransport>(
854
- std::make_unique<DynamicThreadPoolTaskDispatcher>(MaterializationThreads ),
845
+ std::make_unique<DynamicThreadPoolTaskDispatcher>(std::nullopt ),
855
846
std::move (S), FromExecutor[ReadEnd], ToExecutor[WriteEnd]);
856
847
#endif
857
848
}
@@ -993,16 +984,10 @@ Expected<std::unique_ptr<Session>> Session::Create(Triple TT,
993
984
auto PageSize = sys::Process::getPageSize ();
994
985
if (!PageSize)
995
986
return PageSize.takeError ();
996
- std::unique_ptr<TaskDispatcher> Dispatcher;
997
- if (MaterializationThreads == 0 )
998
- Dispatcher = std::make_unique<InPlaceTaskDispatcher>();
999
- else
1000
- Dispatcher = std::make_unique<DynamicThreadPoolTaskDispatcher>(
1001
- MaterializationThreads);
1002
-
1003
987
EPC = std::make_unique<SelfExecutorProcessControl>(
1004
- std::make_shared<SymbolStringPool>(), std::move (Dispatcher),
1005
- std::move (TT), *PageSize, createInProcessMemoryManager ());
988
+ std::make_shared<SymbolStringPool>(),
989
+ std::make_unique<InPlaceTaskDispatcher>(), std::move (TT), *PageSize,
990
+ createInProcessMemoryManager ());
1006
991
}
1007
992
1008
993
Error Err = Error::success ();
@@ -1236,7 +1221,6 @@ void Session::modifyPassConfig(LinkGraph &G, PassConfiguration &PassConfig) {
1236
1221
1237
1222
if (ShowGraphsRegex)
1238
1223
PassConfig.PostFixupPasses .push_back ([this ](LinkGraph &G) -> Error {
1239
- std::lock_guard<std::mutex> Lock (M);
1240
1224
// Print graph if ShowLinkGraphs is specified-but-empty, or if
1241
1225
// it contains the given graph.
1242
1226
if (ShowGraphsRegex->match (G.getName ())) {
@@ -1255,8 +1239,9 @@ void Session::modifyPassConfig(LinkGraph &G, PassConfiguration &PassConfig) {
1255
1239
[this ](LinkGraph &G) { return applyHarnessPromotions (*this , G); });
1256
1240
1257
1241
if (ShowRelocatedSectionContents)
1258
- PassConfig.PostFixupPasses .push_back ([this ](LinkGraph &G) -> Error {
1259
- dumpSectionContents (outs (), *this , G);
1242
+ PassConfig.PostFixupPasses .push_back ([](LinkGraph &G) -> Error {
1243
+ outs () << " Relocated section contents for " << G.getName () << " :\n " ;
1244
+ dumpSectionContents (outs (), G);
1260
1245
return Error::success ();
1261
1246
});
1262
1247
@@ -1628,31 +1613,6 @@ static Error sanitizeArguments(const Triple &TT, const char *ArgV0) {
1628
1613
}
1629
1614
}
1630
1615
1631
- if (MaterializationThreads == std::numeric_limits<size_t >::max ()) {
1632
- if (auto HC = std::thread::hardware_concurrency ())
1633
- MaterializationThreads = HC;
1634
- else {
1635
- errs () << " Warning: std::thread::hardware_concurrency() returned 0, "
1636
- " defaulting to -threads=1.\n " ;
1637
- MaterializationThreads = 1 ;
1638
- }
1639
- }
1640
-
1641
- if (!!OutOfProcessExecutor.getNumOccurrences () ||
1642
- !!OutOfProcessExecutorConnect.getNumOccurrences ()) {
1643
- if (NoExec)
1644
- return make_error<StringError>(" -noexec cannot be used with " +
1645
- OutOfProcessExecutor.ArgStr + " or " +
1646
- OutOfProcessExecutorConnect.ArgStr ,
1647
- inconvertibleErrorCode ());
1648
-
1649
- if (MaterializationThreads == 0 )
1650
- return make_error<StringError>(" -threads=0 cannot be used with " +
1651
- OutOfProcessExecutor.ArgStr + " or " +
1652
- OutOfProcessExecutorConnect.ArgStr ,
1653
- inconvertibleErrorCode ());
1654
- }
1655
-
1656
1616
// Only one of -oop-executor and -oop-executor-connect can be used.
1657
1617
if (!!OutOfProcessExecutor.getNumOccurrences () &&
1658
1618
!!OutOfProcessExecutorConnect.getNumOccurrences ())
0 commit comments