Uh oh!
There was an error while loading. Please reload this page.
librustc_mir: Remove &*x when x has a reference type. - #36504
Conversation
pcwalton
commented
Sep 15, 2016
This should open up some new copy prop opportunities. |
cbreeden
commented
Sep 15, 2016
Does this include |
eddyb
commented
Sep 15, 2016
@cbreeden No, that's somewhat more complex because it's not self-contained within a statement. |
pcwalton
commented
Sep 15, 2016
How's this? |
eddyb
left a comment
There was a problem hiding this comment.
r=me with comments addressed. It might be good to also explain (in a comment?) why the optimizations are collected ahead of time instead of done in-place.
There was a problem hiding this comment.
Should use FnvHashSet (from rustc::utils::nodemap) in the compiler.
There was a problem hiding this comment.
This can be done via #[derive(Default)].
There was a problem hiding this comment.
Can use remove instead of contains to do both at once.
There was a problem hiding this comment.
Should use bug! in the compiler.
pcwalton
commented
Sep 16, 2016
Updated. r? @eddyb |
eddyb
commented
Sep 16, 2016
@bors r+ |
bors
commented
Sep 16, 2016
📌 Commit 11a4965 has been approved by |
arielb1
commented
Sep 16, 2016
@bors r- This will cause drop elaboration to crash and burn, because the newly-created code moves behind |
eddyb
commented
Sep 16, 2016
Ah, right, my bad, I forgot that it had to go after drop elaboration. We need more comments in the pass list. |
arielb1
commented
Sep 16, 2016
I would like to have more understanding on what properties MIR must have at every step before we start doing destructive optimizations. |
@arielb1 Right now we are generating very bad code. I think it would be unwise to gate needed optimizations on "understanding of what properties MIR must have at every step". We need these optimizations now. As long as everything works, we can do that later. |
eddyb
left a comment
There was a problem hiding this comment.
r=me with the pass reordered.
There was a problem hiding this comment.
You only need to reorder the pass to go after this line, which should be separated and commented.
This is the point where moves stop existing and you only have raw semantic-less copies.
This introduces a new `InstCombine` pass for us to place such peephole optimizations.
pcwalton
commented
Sep 16, 2016
@bors-servo: r=eddyb |
bors
commented
Sep 16, 2016
📌 Commit e8a44d2 has been approved by |
librustc_mir: Remove `&*x` when `x` has a reference type. This introduces a new `InstCombine` pass for us to place such peephole optimizations. r? @eddyb
bors
commented
Sep 18, 2016
librustc_mir: Remove `&*x` when `x` has a reference type. This introduces a new `InstCombine` pass for us to place such peephole optimizations. r? @eddyb
This introduces a new
InstCombinepass for us to place such peepholeoptimizations.
r? @eddyb