Skip to content

[MIR-trans] Small fixes for the initial trans support #29583

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

Merged
merged 3 commits into from
Nov 5, 2015

Conversation

dotdash
Copy link
Contributor

@dotdash dotdash commented Nov 4, 2015

Fix handling of small aggregate function arguments and assignments of temporaries to lvalues.

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

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

Function arguments that are small aggregates get passed as integer types
instead. To correctly handle that, we need to use store_ty instead of
plain Store.
@dotdash dotdash changed the title [MIR-trans] Fix handling of small aggregate arguments [MIR-trans] Small fixes for the initial trans support Nov 4, 2015
@@ -94,6 +94,24 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {

match *operand {
mir::Operand::Consume(ref lvalue) => {
// watch out for temporaries that do not have an
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this "trans operand into" path is all that useful. It seems like we could generate the same code by just calling trans_operand and then store the resulting operand instead, so as not to duplicate this logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh right! I wanted to preserve the memcpy for lvalue-to-lvalue copies, but for immediate values, the load/store combo is even actually better I suppose.

@nikomatsakis
Copy link
Contributor

@bors r+

nice

@bors
Copy link
Collaborator

bors commented Nov 4, 2015

📌 Commit 5a35f49 has been approved by nikomatsakis

@bors
Copy link
Collaborator

bors commented Nov 4, 2015

⌛ Testing commit 5a35f49 with merge 646afb2...

@bors
Copy link
Collaborator

bors commented Nov 5, 2015

💔 Test failed - auto-mac-64-opt

@alexcrichton
Copy link
Member

@bors: retry

On Wed, Nov 4, 2015 at 5:07 PM, bors [email protected] wrote:

[image: 💔] Test failed - auto-mac-64-opt
http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/6983


Reply to this email directly or view it on GitHub
#29583 (comment).

@bors
Copy link
Collaborator

bors commented Nov 5, 2015

💔 Test failed - auto-mac-64-opt

@alexcrichton
Copy link
Member

@bors: retry

On Wed, Nov 4, 2015 at 8:24 PM, bors [email protected] wrote:

[image: 💔] Test failed - auto-mac-64-opt
http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/6987


Reply to this email directly or view it on GitHub
#29583 (comment).

@bors
Copy link
Collaborator

bors commented Nov 5, 2015

💔 Test failed - auto-win-gnu-64-nopt-t

@alexcrichton
Copy link
Member

@bors: retry

On Wed, Nov 4, 2015 at 11:33 PM, bors [email protected] wrote:

[image: 💔] Test failed - auto-win-gnu-64-nopt-t
http://buildbot.rust-lang.org/builders/auto-win-gnu-64-nopt-t/builds/1983


Reply to this email directly or view it on GitHub
#29583 (comment).

The store for the "extra" data went to the wrong destination.
@dotdash
Copy link
Contributor Author

dotdash commented Nov 5, 2015

Added one more commit to fix handling of fat pointer function arguments.

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 5, 2015

📌 Commit 3235b22 has been approved by nikomatsakis

@bors
Copy link
Collaborator

bors commented Nov 5, 2015

⌛ Testing commit 3235b22 with merge 96c95f1...

bors added a commit that referenced this pull request Nov 5, 2015
Fix handling of small aggregate function arguments and assignments of temporaries to lvalues.
@bors bors merged commit 3235b22 into rust-lang:master Nov 5, 2015
@dotdash dotdash deleted the mir_small_agg branch January 31, 2016 15:28
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