Fix mismatch between the provisioning of asyncExecutors and the actual thread count currently in the context (NFC)

This fixes an assert in some deployment where the threadpool is
customized.
This commit is contained in:
Mehdi Amini 2021-07-16 06:49:57 +00:00
parent b5a84e214d
commit 20113d66c7

View File

@ -564,8 +564,7 @@ void OpToOpPassAdaptor::runOnOperationAsyncImpl(bool verifyPasses) {
// Create the async executors if they haven't been created, or if the main
// pipeline has changed.
if (asyncExecutors.empty() || hasSizeMismatch(asyncExecutors.front(), mgrs))
asyncExecutors.assign(llvm::hardware_concurrency().compute_thread_count(),
mgrs);
asyncExecutors.assign(context->getThreadPool().getThreadCount(), mgrs);
// Run a prepass over the operation to collect the nested operations to
// execute over. This ensures that an analysis manager exists for each