This is an archive of the discontinued LLVM Phabricator instance.

Fix thinLTO long compile time problem
Needs ReviewPublic

Authored by JohnLee1243 on Jul 24 2023, 6:15 PM.

Details

Reviewers
jhuber6
tejohnson
Summary

ThinLTO compile time is longer on aarch64 system than on x86 system. The reason is that on aarch64 the function of getting physical core number return is 1, so thinLTO cannot work parallel.

Diff Detail

Event Timeline

JohnLee1243 created this revision.Jul 24 2023, 6:15 PM
JohnLee1243 requested review of this revision.Jul 24 2023, 6:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2023, 6:15 PM
tejohnson added inline comments.Aug 10 2023, 7:05 AM
llvm/lib/Support/Unix/Threading.inc
421

Are you compiling for Android? If not, it should have used this case, which does a superset of what you have added above. I tracked the Android exclusion down to this commit: e9b213131ae9c57f4f151d3206916676135b31b0, which says:

Android is excluded because of the higher API level requirement:
`sched_getaffinity; # introduced-arm=12 introduced-arm64=21 introduced-x86=12 introduced-x86_64=21`

Is that an issue then for aarch64 which iiuc is arm64? Or should the code be restructured so aarch64 falls into this case for Android?