This is an archive of the discontinued LLVM Phabricator instance.

[clang-doc] Parallelize reducing phase
ClosedPublic

Authored by DiegoAstiazaran on Aug 1 2019, 7:03 PM.

Details

Summary

Reduce phase has been parallelized and a execution time was reduced by 60% with this.
The reading of bitcode (bitcode -> Info) was moved to this segment of code parallelized so it now happens just before reducing.

Diff Detail

Repository
rL LLVM

Event Timeline

DiegoAstiazaran created this revision.Aug 1 2019, 7:03 PM

LGTM other than a couple atomicity issues.

clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
244 ↗(On Diff #212950)

use std::atomic<bool>

262 ↗(On Diff #212950)

This isn't technically thread safe. Use an std::atomic<bool>

DiegoAstiazaran marked 2 inline comments as done.

Fix atomicity issues.

juliehockett added inline comments.Aug 5 2019, 4:42 PM
clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
72 ↗(On Diff #213425)

Can we use the pre-existing concurrency flag instead (https://github.com/llvm/llvm-project/blob/91e5cdfc93729c61c757db4efd4a82670ac7f929/clang/lib/Tooling/AllTUsExecution.cpp#L150)? It seems counterintuitive to have to set two different concurrency flags for one tool.

You'll have to put up a separate patch to expose that flag in the AllTUs header, so that you can access it (see rL344335, as an example).

DiegoAstiazaran marked 2 inline comments as done.

Use pre-existing concurrency flag --execute-concurrency instead implementing a new one.

clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
72 ↗(On Diff #213425)

Done in D65833.

juliehockett accepted this revision.Aug 7 2019, 1:33 PM

LGTM (after comment nit addressed)

clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
249 ↗(On Diff #213968)

nit: comment about where this var is coming from

This revision is now accepted and ready to land.Aug 7 2019, 1:33 PM
DiegoAstiazaran marked an inline comment as done.

Add comment

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2019, 1:54 PM