Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial version of codegen unit partitioning for incremental compilation. #32779

Merged
merged 2 commits into from
Apr 16, 2016

Conversation

michaelwoerister
Copy link
Member

The task of the partitioning module is to take the complete set of translation items of a crate and produce a set of codegen units from it, where a codegen unit is a named set of (translation-item, linkage) pairs. That is, this module decides which translation item appears in which codegen units with which linkage.

This version only handles the case of partitioning for incremental compilation, not the regular N-codegen units case. In the future the regular case should be handled too, maybe even doing a bit more analysis to intelligently figure out a good partitioning.

One thing that could be improved is the syntax of the codegen unit tests. Right now they still use the compile-fail error specification infrastructure, so everything has to be on one line. Would be nice to be able to format things in a more readable way.

@rust-highfive
Copy link
Collaborator

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

@michaelwoerister
Copy link
Member Author

r? @nikomatsakis

@michaelwoerister michaelwoerister added A-linkage Area: linking into static, shared libraries and binaries A-codegen Area: Code generation A-compiler A-incr-comp Area: Incremental compilation labels Apr 6, 2016
//! added or removed, the codegen unit has to be re-translated anyway.
//! (Note that this only makes sense if external crates actually don't change
//! frequently. For certain multi-crate projects this might not be a valid
//! assumption).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for explaining your logic =)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're welcome, Rust developers :)

@nikomatsakis
Copy link
Contributor

ok, seems like a great starting point, r=me modulo the comment

@michaelwoerister
Copy link
Member Author

Oh no! @eddy has sent hir::map paths into retirement. I guess, I'll need to adapt DefPath so I can find out if something is a module or not...

@michaelwoerister michaelwoerister force-pushed the partitioning branch 2 times, most recently from bba4024 to 808359f Compare April 14, 2016 19:07
@michaelwoerister
Copy link
Member Author

I've gotten rid of code duplication where possible and added more information on inlining.

@michaelwoerister
Copy link
Member Author

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Apr 14, 2016

📌 Commit 808359f has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented Apr 14, 2016

⌛ Testing commit 808359f with merge 95ffa44...

@bors
Copy link
Contributor

bors commented Apr 14, 2016

💔 Test failed - auto-win-gnu-32-opt

@alexcrichton
Copy link
Member

@bors: retry

On Thu, Apr 14, 2016 at 12:16 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-win-gnu-32-opt
http://buildbot.rust-lang.org/builders/auto-win-gnu-32-opt/builds/3785


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#32779 (comment)

@bors
Copy link
Contributor

bors commented Apr 15, 2016

⌛ Testing commit 808359f with merge d869d82...

@bors
Copy link
Contributor

bors commented Apr 15, 2016

💔 Test failed - auto-linux-64-nopt-t

@michaelwoerister
Copy link
Member Author

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Apr 15, 2016

📌 Commit e8441b6 has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented Apr 16, 2016

⌛ Testing commit e8441b6 with merge fef6c64...

bors added a commit that referenced this pull request Apr 16, 2016
Add initial version of codegen unit partitioning for incremental compilation.

The task of the partitioning module is to take the complete set of translation items of a crate and produce a set of codegen units from it, where a codegen unit is a named set of (translation-item, linkage) pairs. That is, this module decides which translation item appears in which codegen units with which linkage.

This version only handles the case of partitioning for incremental compilation, not the regular N-codegen units case. In the future the regular case should be handled too, maybe even doing a bit more analysis to intelligently figure out a good partitioning.

One thing that could be improved is the syntax of the codegen unit tests. Right now they still use the compile-fail error specification infrastructure, so everything has to be on one line. Would be nice to be able to format things in a more readable way.
@bors bors merged commit e8441b6 into rust-lang:master Apr 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-incr-comp Area: Incremental compilation A-linkage Area: linking into static, shared libraries and binaries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants