This is an archive of the discontinued LLVM Phabricator instance.

[AIX] Define llvm::thread::DefaultStackSize to 4 megabytes on AIX
ClosedPublic

Authored by w2yehia on Jul 19 2023, 10:57 AM.

Details

Summary

Link time thinLTO spawns pthreads to parallelize optimization and codegen of the input bitcode files.
On AIX, the pthread's stack size limit is ~192k for 64-bit programs.
If std::optional<unsigned> llvm::thread::DefaultStackSize is initialized, then its value is used on a call to pthread_attr_setstacksize before pthread_create occurs.

We think increasing the default thread stack size limit in llvm on AIX to 4mb make sense.

Diff Detail

Event Timeline

w2yehia created this revision.Jul 19 2023, 10:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2023, 10:57 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
w2yehia requested review of this revision.Jul 19 2023, 10:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2023, 10:57 AM
MaskRay accepted this revision.Jul 19 2023, 11:02 AM
This revision is now accepted and ready to land.Jul 19 2023, 11:02 AM
ZarkoCA accepted this revision.Jul 19 2023, 11:11 AM
ZarkoCA added inline comments.
llvm/lib/Support/Threading.cpp
86–87

Minor nit to have the comment explaining why like Darwin does above.

This revision was landed with ongoing or failed builds.Jul 19 2023, 11:58 AM
This revision was automatically updated to reflect the committed changes.
w2yehia marked an inline comment as done.Jul 19 2023, 12:00 PM