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

Some preliminary work towards making trans "collector driven". #33171

Merged
merged 3 commits into from
Apr 28, 2016

Conversation

michaelwoerister
Copy link
Member

The trans::collector already collects all translation items and trans::partitioning distributes these translation items into codegen units. The changes in this PR provide the following extensions to this functionality:

  1. Drop-glue is handled more accurately now, knowing about the difference between DropGlueKind::Ty and DropGlueKind::TyContents.
  2. The partitioning module now supports the FixedUnitCount strategy which more or less corresponds to the partitioning one gets via supplying -Ccodegen-units today.
  3. The partitioning scheme also takes care of assigned LLVM declarations to codegen units, not just definitions (declarations for external items not yet implemented).

It's debatable whether declarations should be handled by the partitioning scheme or whether they should just be emitted on demand.

@rust-highfive
Copy link
Collaborator

r? @jroesch

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

@michaelwoerister
Copy link
Member Author

cc @nikomatsakis

@@ -52,7 +52,7 @@ impl BitVector {

pub fn grow(&mut self, num_bits: usize) {
let num_words = u64s(num_bits);
let extra_words = self.data.len() - num_words;
let extra_words = (num_words as i64) - (self.data.len() as i64);
Copy link
Member

@nagisa nagisa Apr 23, 2016

Choose a reason for hiding this comment

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

if self.data.len() < num_words { self.data.resize(num_words, 0) } instead?

Also needs a regression test.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that would be nicer. I'll add the test too.

@michaelwoerister
Copy link
Member Author

Changed the implementation of BitVector::grow to @nagisa's nicer version and made the corresponding test case more comprehensive.

@nikomatsakis
Copy link
Contributor

r? @nikomatsakis

@@ -9,7 +9,7 @@
// except according to those terms.

// ignore-tidy-linelength
// compile-flags:-Zprint-trans-items=eager
// compile-flags:-Zprint-trans-items=eager -Zincremental=""
Copy link
Contributor

Choose a reason for hiding this comment

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

why -Z incremental=""?

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 27, 2016

📌 Commit e6d3ac3 has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented Apr 27, 2016

⌛ Testing commit e6d3ac3 with merge 1b707b1...

bors added a commit that referenced this pull request Apr 27, 2016
…tsakis

Some preliminary work towards making trans "collector driven".

The `trans::collector` already collects all translation items and `trans::partitioning` distributes these translation items into codegen units. The changes in this PR provide the following extensions to this functionality:

1. Drop-glue is handled more accurately now, knowing about the difference between `DropGlueKind::Ty` and `DropGlueKind::TyContents`.
2. The partitioning module now supports the `FixedUnitCount` strategy which more or less corresponds to the partitioning one gets via supplying `-Ccodegen-units` today.
3. The partitioning scheme also takes care of assigned LLVM declarations to codegen units, not just definitions (declarations for external items not yet implemented).

It's debatable whether declarations should be handled by the partitioning scheme or whether they should just be emitted on demand.
@bors
Copy link
Contributor

bors commented Apr 27, 2016

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

@michaelwoerister
Copy link
Member Author

I'll take the failed test as an opportunity to address the nits.

@michaelwoerister
Copy link
Member Author

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Apr 28, 2016

📌 Commit 0fc9f9a has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented Apr 28, 2016

⌛ Testing commit 0fc9f9a with merge 8da2bca...

bors added a commit that referenced this pull request Apr 28, 2016
…tsakis

Some preliminary work towards making trans "collector driven".

The `trans::collector` already collects all translation items and `trans::partitioning` distributes these translation items into codegen units. The changes in this PR provide the following extensions to this functionality:

1. Drop-glue is handled more accurately now, knowing about the difference between `DropGlueKind::Ty` and `DropGlueKind::TyContents`.
2. The partitioning module now supports the `FixedUnitCount` strategy which more or less corresponds to the partitioning one gets via supplying `-Ccodegen-units` today.
3. The partitioning scheme also takes care of assigned LLVM declarations to codegen units, not just definitions (declarations for external items not yet implemented).

It's debatable whether declarations should be handled by the partitioning scheme or whether they should just be emitted on demand.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Oct 12, 2020
Mono collector: replace pair of ints with Range

I found the initial PR (rust-lang#33171) that introduced this piece of code but I didn't find any information about why a tuple was preferred over a `Range<usize>`.

I'm hoping there are no technical reasons to not do this.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Oct 12, 2020
Mono collector: replace pair of ints with Range

I found the initial PR (rust-lang#33171) that introduced this piece of code but I didn't find any information about why a tuple was preferred over a `Range<usize>`.

I'm hoping there are no technical reasons to not do this.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Oct 12, 2020
Mono collector: replace pair of ints with Range

I found the initial PR (rust-lang#33171) that introduced this piece of code but I didn't find any information about why a tuple was preferred over a `Range<usize>`.

I'm hoping there are no technical reasons to not do this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants