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

Improve handling of immediate values #27600

Closed
wants to merge 2 commits into from

Conversation

Aatch
Copy link
Contributor

@Aatch Aatch commented Aug 8, 2015

The primary improvement here is to handle function calls that return
imemdiate values such that it doesn't force the use of a stack slot. It
also avoids loads from slots that have an store to it in the same block.

This especially improves the codegen for intrinsics, as most of them
produce immediate values.

cc @rust-lang/compiler

@rust-highfive
Copy link
Collaborator

r? @jroesch

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

@Aatch Aatch force-pushed the immediate-rvalue branch from e418b25 to 707db64 Compare August 8, 2015 12:59
}
} else {
llresult = C_nil(bcx.ccx());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer to add that check after the if-else block, so it can be merged with the same one in the else-arm.

@dotdash
Copy link
Contributor

dotdash commented Aug 8, 2015

👍 I wanted to get rid of the store/load combo for function calls for sooooo long.

I'm not sure about the load elision thing. How often / in which situations does that come into play?

@brson
Copy link
Contributor

brson commented Aug 8, 2015

Neat. Do compile times improve?

Aatch added 2 commits August 10, 2015 17:35
The primary improvement here is to handle function calls that return
imemdiate values such that it doesn't force the use of a stack slot. It
also avoids loads from slots that have an store to it in the same block.

This especially improves the codegen for intrinsics, as most of them
produce immediate values.
* Move the "get the value that will definitely be loaded" logic to it's
own method to reduce the duplication.
* Refactor base::invoke to avoid duplicating the diverging/zero-sized
return logic.
* Re-add debugging output I accidentally removed
* Add some more comments explaining stuff
@Aatch Aatch force-pushed the immediate-rvalue branch from 707db64 to 8905343 Compare August 10, 2015 05:35
@Aatch
Copy link
Contributor Author

Aatch commented Aug 10, 2015

Updated to address comments.

@brson I haven't tested, but my previous attempt at this suggested, no. At least, nothing that isn't covered by noise. The main reason presumably being that let a = foo() and similar expressions still compile to about the same code, which probably accounts for a fair amount of function calls.

@jroesch
Copy link
Member

jroesch commented Aug 11, 2015

@Aatch read the patch over and it looks good to me, not sure if you want someone who spends more time in trans to look it over instead, otherwise r=me.

@dotdash
Copy link
Contributor

dotdash commented Aug 11, 2015

@bors r+ 8905343

@Manishearth
Copy link
Member

@bors
Copy link
Contributor

bors commented Aug 12, 2015

⌛ Testing commit 8905343 with merge 924bd8b...

@bors
Copy link
Contributor

bors commented Aug 12, 2015

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

@bors
Copy link
Contributor

bors commented Aug 18, 2015

☔ The latest upstream changes (presumably #27169) made this pull request unmergeable. Please resolve the merge conflicts.

@jroesch
Copy link
Member

jroesch commented Aug 20, 2015

@Aatch ping, whats the status on this?

@dotdash
Copy link
Contributor

dotdash commented Aug 27, 2015

@Aatch Are you ok with me finishing this in a new PR?

@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to resubmit with a rebase! (also looks like @jroesch or @dotdash may be willing to help out on 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.

8 participants