diff options
author | Wael Yehia <wyehia@ca.ibm.com> | 2023-06-01 15:56:07 -0400 |
---|---|---|
committer | Wael Yehia <wyehia@ca.ibm.com> | 2023-07-19 18:57:55 +0000 |
commit | f94608a164896e7108de2a8647285cc7d429f17b (patch) | |
tree | 05bf4e74bedd090720feff221630b6d6d705169f /llvm/lib/Support/Threading.cpp | |
parent | aae2eaae2cefd3132059925c4592276defdb1faa (diff) | |
download | llvm-f94608a164896e7108de2a8647285cc7d429f17b.zip llvm-f94608a164896e7108de2a8647285cc7d429f17b.tar.gz llvm-f94608a164896e7108de2a8647285cc7d429f17b.tar.bz2 |
Define llvm::thread::DefaultStackSize to 4 megabytes on AIX
Link time thinLTO spawns pthreads to parallelize optimization and
codegen of the input bitcode files. On AIX, the default pthread
stack size limit is ~192k for 64-bit programs; insufficient for a
normal LLVM compilation.
Reviewed By: ZarkoCA, MaskRay
Differential Revision: https://reviews.llvm.org/D155731
Diffstat (limited to 'llvm/lib/Support/Threading.cpp')
-rw-r--r-- | llvm/lib/Support/Threading.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Support/Threading.cpp b/llvm/lib/Support/Threading.cpp index 923935b..7cc7ba4 100644 --- a/llvm/lib/Support/Threading.cpp +++ b/llvm/lib/Support/Threading.cpp @@ -83,6 +83,11 @@ unsigned llvm::ThreadPoolStrategy::compute_thread_count() const { // the same interface as std::thread but requests the same stack size as the // main thread (8MB) before creation. const std::optional<unsigned> llvm::thread::DefaultStackSize = 8 * 1024 * 1024; +#elif defined(_AIX) + // On AIX, the default pthread stack size limit is ~192k for 64-bit programs. + // This limit is easily reached when doing link-time thinLTO. AIX library + // developers have used 4MB, so we'll do the same. +const std::optional<unsigned> llvm::thread::DefaultStackSize = 4 * 1024 * 1024; #else const std::optional<unsigned> llvm::thread::DefaultStackSize; #endif |