This is an archive of the discontinued LLVM Phabricator instance.

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

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

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

strtol?

786

Is the .get() useful here?

789

same

803

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

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

135

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

786

Removed

789

Removed

803

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
109

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
109

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.