Skip to content

Commit

Permalink
Skip processor info on i386 mingw-w64 < 7
Browse files Browse the repository at this point in the history
This will limit LLVM thread pools to a single thread on that target, but
we don't use that functionality in rustc anyway.

See also:
llvm@8404aeb#commitcomment-37406150
  • Loading branch information
cuviper committed Sep 22, 2020
1 parent 5bb9c1d commit 23a0442
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions llvm/lib/Support/Windows/Threading.inc
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ struct ProcessorGroup {

template <typename F>
static bool IterateProcInfo(LOGICAL_PROCESSOR_RELATIONSHIP Relationship, F Fn) {
#if !defined(_WIN64) && defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 7
// `GetLogicalProcessorInformationEx@12` was only added to i386 mingw-w64 in v7.0.0
// https://github.com/mingw-w64/mingw-w64/commit/24842d45e025db0d38fa2bbd932b95a83282efa2#diff-faf1d8a1556e75a84b7cef2e89512e79R634
return false;
#else
DWORD Len = 0;
BOOL R = ::GetLogicalProcessorInformationEx(Relationship, NULL, &Len);
if (R || GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
Expand All @@ -159,6 +164,7 @@ static bool IterateProcInfo(LOGICAL_PROCESSOR_RELATIONSHIP Relationship, F Fn) {
}
free(Info);
return true;
#endif
}

static ArrayRef<ProcessorGroup> getProcessorGroups() {
Expand Down

0 comments on commit 23a0442

Please sign in to comment.