This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Parallelize legacy profile merging
ClosedPublic

Authored by kongyi on Apr 23 2023, 2:20 AM.

Details

Summary

Merging profiles is quite expensive, but easily paralleizable.

8359 profiles on n2d-standard-128:
single-thread: 808s
multi-thread: 200s (~75% speed up)

Diff Detail

Event Timeline

kongyi created this revision.Apr 23 2023, 2:20 AM
Herald added a reviewer: Amir. · View Herald Transcript
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
kongyi requested review of this revision.Apr 23 2023, 2:20 AM
kongyi updated this revision to Diff 516144.Apr 23 2023, 3:16 AM
rafauler added inline comments.Apr 24 2023, 3:36 PM
bolt/tools/merge-fdata/merge-fdata.cpp
276–289

Don't we need a lock here?

kongyi updated this revision to Diff 516623.Apr 24 2023, 10:13 PM
kongyi marked an inline comment as done.
kongyi added inline comments.
bolt/tools/merge-fdata/merge-fdata.cpp
276–289

You're right. Added a lock guard.

rafauler accepted this revision.Apr 26 2023, 11:32 AM
This revision is now accepted and ready to land.Apr 26 2023, 11:32 AM
This revision was automatically updated to reflect the committed changes.
kongyi marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2023, 11:37 PM

It might be that this commit introduced a sporadic test failure. My last revisions that ran the bolt tests seemed to sporadically trigger this issue, see: https://lab.llvm.org/buildbot/#/builders/241/builds/4711
We can also reproduce this sporadic test failure locally.

hiraditya added inline comments.
bolt/tools/merge-fdata/merge-fdata.cpp
291

nit: tabs