Page MenuHomePhabricator

gold-plugin: Implement parallel LTO code generation using llvm::LinkedCodeGen.
ClosedPublic

Authored by pcc on Aug 24 2015, 7:40 PM.

Details

Summary

Parallelism can be enabled using a new plugin option, jobs=N, where N is
the number of code generation threads.

Depends on D12260

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 33039.Aug 24 2015, 7:40 PM
pcc retitled this revision from to gold-plugin: Implement parallel LTO code generation using llvm::LinkedCodeGen..
pcc updated this object.
pcc added reviewers: rafael, chandlerc.
pcc added a subscriber: llvm-commits.

Few comment (I never used gold)

tools/gold/gold-plugin.cpp
134 ↗(On Diff #33039)

any reason not re-using the same -j that is used by most tool for the jobs?
(Maybe it is more coherent with gold, I don't know).

135 ↗(On Diff #33039)

strtol?

786 ↗(On Diff #33039)

Is the .get() useful here?

789 ↗(On Diff #33039)

same

803 ↗(On Diff #33039)

Same question as for llvm-lto, what about tool_output_file?

pcc updated this revision to Diff 33475.Aug 28 2015, 3:06 PM

Address review comments

tools/gold/gold-plugin.cpp
134 ↗(On Diff #33039)

-j is fine for the testing tools. But for user-facing tools I think a more descriptive flag would be more appropriate.

135 ↗(On Diff #33039)

Seems that StringRef::getAsInteger is the canonical way to do this.

786 ↗(On Diff #33039)

Removed

789 ↗(On Diff #33039)

Removed

803 ↗(On Diff #33039)

I believe that tool_output_file cannot be used with temporary files.

rafael edited edge metadata.Sep 1 2015, 7:35 AM

Needs a testcase. Do include one test using save-temps or obj-path showing the mulitple .o files that are created.

tools/gold/gold-plugin.cpp
108 ↗(On Diff #33475)

Why do you need to change this? All the errors in here still fail the build, no?

pcc added a comment.Sep 1 2015, 11:55 AM

Needs a testcase. Do include one test using save-temps or obj-path showing the mulitple .o files that are created.

This would be test/tools/gold/X86/parallel.ll, no?

tools/gold/gold-plugin.cpp
108 ↗(On Diff #33475)

I suppose it doesn't really matter much, but I think it is more appropriate to use the linker callbacks here rather than report_fatal_error which should only really be used for LLVM internal errors.

This revision was automatically updated to reflect the committed changes.