Uh oh!
There was an error while loading. Please reload this page.
Cleanup codegen_llvm/back - #54864
Conversation
rust-highfive
commented
Oct 6, 2018
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
pnkfelix
left a comment
There was a problem hiding this comment.
Is this commit the result of running rustfmt ? Just curious...
@pnkfelix: you mean the whitespace one? No; those lines were hand-picked after having done all the other changes. I adjusted those spots along the way. |
ljedrz
commented
Oct 16, 2018
It seems @pnkfelix is busy with NLL; r? @Mark-Simulacrum |
Mark-Simulacrum
left a comment
There was a problem hiding this comment.
I'm okay with landing this but some of these seem like they might not actually be improvements
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
a544455 to
60e123dCompareljedrz
commented
Oct 16, 2018
@Mark-Simulacrum thanks for the thorough review! I think I addressed all the issues. |
60e123d to
ec65cffCompareljedrz
commented
Oct 19, 2018
@Mark-Simulacrum r? I won't be able to rebase for the next few days. |
Uh oh!
There was an error while loading. Please reload this page.
ljedrz
commented
Oct 19, 2018
The deletion was an accident. Travis should still be happy. |
ec65cff to
d2f2446Compareljedrz
commented
Oct 29, 2018
Included the suggestion by @sinkuu. |
bors
commented
Nov 4, 2018
☔ The latest upstream changes (presumably #55349) made this pull request unmergeable. Please resolve the merge conflicts. |
d2f2446 to
b74c9d6Compareljedrz
commented
Nov 5, 2018
Rebased. |
Mark-Simulacrum
commented
Nov 5, 2018
@bors r+ |
bors
commented
Nov 5, 2018
📌 Commit b74c9d60bf23b7d975dc87f5efeadd5fe937f605 has been approved by |
bors
commented
Nov 5, 2018
⌛ Testing commit b74c9d60bf23b7d975dc87f5efeadd5fe937f605 with merge f0097bd6148de603f9f56d906f5a286d568be711... |
50c7e80 to
2f99d09Compareljedrz
commented
Nov 10, 2018
I removed the memory-related commit; maybe I will come up with a solution in the future, but there's no point in holding back the rest of the changes. |
nagisa
commented
Nov 10, 2018
@bors r=Mark-Simulacrum |
bors
commented
Nov 10, 2018
📌 Commit 2f99d09 has been approved by |
bors
commented
Nov 10, 2018
…acrum Cleanup codegen_llvm/back - improve allocations - use `Cow<'static, str>` where applicable - use `to_owned` instead of `to_string` with string literals - remove a redundant `continue` - possible minor speedup in logic - use `mem::replace` instead of `swap` where more concise - remove `'static` from consts - improve common patterns - remove explicit `return`s - whitespace & formatting fixes
bors
commented
Nov 11, 2018
☀️ Test successful - status-appveyor, status-travis |
codegen_llvm_back: improve allocations This commit was split out from #54864. Last time it was causing an LLVM OOM, presumably due to aggressive preallocation strategy in `thin_lto`. This time preallocations are more cautious and there are a few additional memory-related improvements (last 3 points from the list below). - _gently_ preallocate vectors of known length - `extend` instead of `append` where the argument is consumable - turn 2 `push` loops into `extend`s - create a vector from a function producing one instead of using `extend_from_slice` on it - consume `modules` when no longer needed - return an `impl Iterator` from `generate_lto_work` - don't `collect` `globals`, as they are iterated over and consumed right afterwards While I'm hoping it won't cause an OOM anymore, I would still consider this a "high-risk" PR and not roll it up.
codegen_llvm_back: improve allocations This commit was split out from #54864. Last time it was causing an LLVM OOM, which was most probably caused by not collecting the globals. - preallocate vectors of known length - `extend` instead of `append` where the argument is consumable - turn 2 `push` loops into `extend`s - create a vector from a function producing one instead of using `extend_from_slice` on it - consume `modules` when no longer needed - ~~return an `impl Iterator` from `generate_lto_work`~~ - ~~don't `collect` `globals`, as they are iterated over and consumed right afterwards~~ While I'm hoping it won't cause an OOM anymore, I would still consider this a "high-risk" PR and not roll it up.
Cow<'static, str>where applicableto_ownedinstead ofto_stringwith string literalscontinuemem::replaceinstead ofswapwhere more concise'staticfrom constsreturns