Uh oh!
There was an error while loading. Please reload this page.
[MIR] Implement Inlining - #39648
Conversation
rust-highfive
commented
Feb 8, 2017
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Perhaps it would make sense to have some sort of guard for this instead?
There was a problem hiding this comment.
I thought 'Clone' was removed for a reason. Is there a good reason for bringing it back?
There was a problem hiding this comment.
It's required for the TypeFoldable impl.
There was a problem hiding this comment.
according to comments from the previous PR, listing fields and using _ is preferable to ..
There was a problem hiding this comment.
Not all functions have a MIR available and item_mir panics if there isn't a MIR available for that def id.
There was a problem hiding this comment.
wouldn't if !def_id.is_local() {} do the trick?
There was a problem hiding this comment.
I need the node id anyway, this combines that check.
There was a problem hiding this comment.
we know at least that def_id is local, maybe maybe_ isn't necessary?
There was a problem hiding this comment.
Being a local doesn't mean a MIR is available. The obvious case is intrinsics, since you can define those locally.
mrhota
left a comment
There was a problem hiding this comment.
Several comments from the original PR should probably be addressed here, like these.
The code lacks descriptions of approach or rationale. I get the impression (from the previous PR) that you intend for this code to be a kind of first strike at this problem. There are lots of details here, and it's hard to work out what's going on when there's not even a high-level description of how this pass works (or should work).
Moreover, it'd be nice to have tests verifying the efficacy of this new pass. Performance comparisons would be nice, too, since you mentioned improvements in the previous PR.
There was a problem hiding this comment.
Doesn't this invalidate the comment in line 1033?
There was a problem hiding this comment.
That comment is about line 1031, i.e. nothing below the comment can invalidate it.
There was a problem hiding this comment.
ok, I thought it might refer to what is now line 1035
There was a problem hiding this comment.
From comments in the previous version of this PR, this should be generified and moved into the graph algos module. Obviously, the same goes for StackElement.
eddyb
left a comment
There was a problem hiding this comment.
r=me with comments addressed (mine and others')
There was a problem hiding this comment.
That comment is about line 1031, i.e. nothing below the comment can invalidate it.
There was a problem hiding this comment.
Need to filter by .is_local(), cross-crate MIR should always be inspected on-demand (and not by accident).
There was a problem hiding this comment.
Pretty sure the accepted style doesn't have a space before :.
There was a problem hiding this comment.
You shouldn't be seeing DropAndReplace anymore at this point.
There was a problem hiding this comment.
Again, DropAndReplace shouldn't show up anymore at this point.
nikomatsakis
commented
Feb 21, 2017
I agree this would make the code stronger. At the same time, I don't want to raise the bar too high for this patch -- I'm afraid it will bitrot like last time, and I think I'd rather have something in-tree with which we can iterate than nothing (particularly since it is not enabled by default). It feels like we need to get a series of quality benchmarks and start tuning these MIR optimizations, and documenting the results of that tuning. Trying to divine rules in advance without benchmarks feels risky. |
bors
commented
Feb 28, 2017
☔ The latest upstream changes (presumably #40008) made this pull request unmergeable. Please resolve the merge conflicts. |
mrhota
commented
Mar 1, 2017
@Aatch ping? |
There was a problem hiding this comment.
I thought the semantics was that any such *i is "borrow-locked" for the duration of the call, so any unexpected assignments during function call evaluation result in UB (certainly, MIR construction always copies indexes to a temporary).
nikomatsakis
commented
Mar 2, 2017
Somebody ought to rebase this =) |
mrhota
commented
Mar 9, 2017
@Aatch ping again... 😦 |
Adds `get`/`get_mut` accessors and `drain`/`drain_enumerated` iterators to IndexVec. Implements TypeFoldable for IndexVec.
Fairly basic implementation of inlining for MIR. Uses conservative heuristics for inlining.
eddyb
commented
Mar 10, 2017
@bors r+ |
bors
commented
Mar 10, 2017
📌 Commit 3eb26d1 has been approved by |
bors
commented
Mar 10, 2017
⌛ Testing commit 3eb26d1 with merge 3123793... |
bors
commented
Mar 10, 2017
💔 Test failed - status-appveyor |
eddyb
commented
Mar 10, 2017
@bors retry
|
bors
commented
Mar 10, 2017
⌛ Testing commit 3eb26d1 with merge 1b53cd3... |
bors
commented
Mar 10, 2017
💔 Test failed - status-travis |
@bors retry
|
[MIR] Implement Inlining Fairly basic implementation of inlining for MIR. Uses conservative heuristics for inlining. Doesn't handle a number of cases, but can be extended later. This is basically the same as the previous inlining PR, but without the span-related changes (as the bugs it was dealing with have since been fixed). /cc @rust-lang/compiler
bors
commented
Mar 10, 2017
⌛ Testing commit 3eb26d1 with merge 38aa079... |
alexcrichton
commented
Mar 10, 2017
@bors: retry (prioritizing rollup) |
bors
commented
Mar 10, 2017
⌛ Testing commit 3eb26d1 with merge b37de9c... |
alexcrichton
commented
Mar 10, 2017
@bors: retry (prioritizing rollup) |
[MIR] Implement Inlining Fairly basic implementation of inlining for MIR. Uses conservative heuristics for inlining. Doesn't handle a number of cases, but can be extended later. This is basically the same as the previous inlining PR, but without the span-related changes (as the bugs it was dealing with have since been fixed). /cc @rust-lang/compiler
bors
commented
Mar 11, 2017
[MIR] Implement Inlining Fairly basic implementation of inlining for MIR. Uses conservative heuristics for inlining. Doesn't handle a number of cases, but can be extended later. This is basically the same as the previous inlining PR, but without the span-related changes (as the bugs it was dealing with have since been fixed). /cc @rust-lang/compiler
bors
commented
Mar 11, 2017
☀️ Test successful - status-appveyor, status-travis |
Fairly basic implementation of inlining for MIR. Uses conservative
heuristics for inlining.
Doesn't handle a number of cases, but can be extended later. This is basically the same as the previous inlining PR, but without the span-related changes (as the bugs it was dealing with have since been fixed).
/cc @rust-lang/compiler