This is an archive of the discontinued LLVM Phabricator instance.

Split up lld Parallel.h a bit
ClosedPublic

Authored by zturner on May 4 2017, 6:04 PM.

Details

Summary

This patch splits Parallel by introducing a new file called Executor.h and Executor.cpp.

Executor.h defines parallel infrastructure, but hides all concrete executor implementations in a cpp file inside of an anonymous namespaces so they can't leak out.

Diff Detail

Repository
rL LLVM

Event Timeline

zturner created this revision.May 4 2017, 6:04 PM
ruiu added inline comments.May 4 2017, 6:13 PM
lld/include/lld/Core/Executor.h
27–29 ↗(On Diff #97904)

You want to remove the leading underscores and make them start with uppercase.

krytarowski added inline comments.
lld/lib/Core/Executor.cpp
19 ↗(On Diff #97904)
#if !LLVM_ENABLE_THREADS

?

zturner updated this revision to Diff 97988.May 5 2017, 11:00 AM
  • Updated everything to use LLVM naming conventions.
  • Hid the Executor stuff even more. Previously the abstract base class was in the Executor.h, now even that is hidden in an anonymous namespace in a cpp file. The only thing exposed now is TaskGroup.

That doesn't mean I'm giving up on trying to get this to parity with the C++ Parallel TS, but I'd like to get this ready for LLVM sooner rather than later, and this seems like the method with the least friction.

I plan to go check the Parallel TS as a follow up and see if there's anything else I can do to get more parity on the interfaces, but at least this way Executor is out of the picture for now.

ruiu accepted this revision.May 5 2017, 11:19 AM

LGTM. This patch splits the files without changing any behavior and also fixes variable names. I want you to commit this before you make further changes, as I want to separate mechanical changes from non-mechanical ones.

lld/include/lld/Core/TaskGroup.h
28–31 ↗(On Diff #97988)

Please fix these names.

56 ↗(On Diff #97988)

And this.

This revision is now accepted and ready to land.May 5 2017, 11:19 AM

Just to be clear, do you want me to commit this without the latest update? i.e. I should commit Diff 1 of this (without the variable name changes etc), then do all the renames and stuff in a separate patch (without review), then do further improvements?

ruiu added a comment.May 5 2017, 1:52 PM

I don't have a strong preference, but as you already split the file and fixed the variable names, I'm fine if you check in both changes as one change.

This revision was automatically updated to reflect the committed changes.