Uh oh!
There was an error while loading. Please reload this page.
Don't auto-inline const functions - #56024
Conversation
rust-highfive
commented
Nov 17, 2018
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
Uh oh!
There was an error while loading. Please reload this page.
eddyb
commented
Nov 17, 2018
6c84600 to
2b55e51Compare
This comment has been minimized.
This comment has been minimized.
64451e0 to
6f0c41aCompare
This comment has been minimized.
This comment has been minimized.
6f0c41a to
eb18dddComparecramertj
commented
Nov 19, 2018
r? @eddyb |
eddyb
commented
Nov 20, 2018
michaelwoerister
commented
Nov 21, 2018
Hm, the approach doesn't seem quite right to me. With the PR we would translate all const fns to machine code, even if they are never used anywhere. That would add code bloat. Shouldn't we be able to handle this like we handle regular |
oli-obk
commented
Nov 21, 2018
We also translate normal functions without If we start creating more complex const fns, they would get codegened multiple times if they are auto-inlined without any way to opt back out of the implicit inlining |
michaelwoerister
commented
Nov 21, 2018
Only, if they are publicly visible.
Yes, that's true. Let's do a perf run. I still think this PR is more of a work-around than a real solution to the problem. The compiler should be able to handle both cases. That it doesn't seems like a bug. |
michaelwoerister
commented
Nov 21, 2018
@bors try |
bors
commented
Nov 21, 2018
⌛ Trying commit eb18ddd with merge 5720c63ceb9a7b0029646d8a61763ae27f358b2f... |
oli-obk
commented
Nov 21, 2018
Yes indeed. I was going to fix the real thing and questioned the motive of auto-inlining const fns while I was doing so. Thus this PR
The bug is code asking whether functions have an |
bors
commented
Nov 21, 2018
☀️ Test successful - status-travis |
oli-obk
commented
Nov 21, 2018
@rust-timer build 5720c63 |
rust-timer
commented
Nov 21, 2018
Please provide the full 40 character commit hash. |
oli-obk
commented
Nov 21, 2018
@rust-timer build 5720c63ceb9a7b0029646d8a61763ae27f358b2f |
rust-timer
commented
Nov 21, 2018
Success: Queued 5720c63ceb9a7b0029646d8a61763ae27f358b2f with parent 289ad6e, comparison URL. |
rust-timer
commented
Nov 21, 2018
Finished benchmarking try commit 5720c63ceb9a7b0029646d8a61763ae27f358b2f |
oli-obk
commented
Nov 21, 2018
2% perf improvement on some benchmarks, 1% regression on +14% to -6% max memory usage, pretty wild results: https://perf.rust-lang.org/compare.html?start=289ad6e9922683807d455ca0020dc2a8f7bd1a7b&end=5720c63ceb9a7b0029646d8a61763ae27f358b2f&stat=max-rss |
michaelwoerister
commented
Nov 22, 2018
Many of those max-rss benchmarks seem to be very flaky to begin with, especially OK, let's do this. Const fns that are only every used in a const context and are not publicly visible should still never be instantiated (because the collector won't find any calls to them in that case). @bors r+ |
bors
commented
Nov 22, 2018
📌 Commit eb18ddd has been approved by |
bors
commented
Nov 24, 2018
⌛ Testing commit eb18ddd with merge a7cc9ff7aeaeac0dc2b706f7ccd56cf555cd1e9f... |
bors
commented
Nov 24, 2018
💔 Test failed - status-travis |
rust-highfive
commented
Nov 24, 2018
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
oli-obk
commented
Nov 24, 2018
@bors retry network test spuriously thinking it was able to connect |
…ichaelwoerister Don't auto-inline const functions fixesrust-lang#53451
Rollup of 14 pull requests Successful merges: - #56024 (Don't auto-inline const functions) - #56045 (Check arg/ret sizedness at ExprKind::Path) - #56072 (Stabilize macro_literal_matcher) - #56075 (Encode a custom "producers" section in wasm files) - #56100 (generator fields are not necessarily initialized) - #56101 (Incorporate `dyn` into more comments and docs.) - #56144 (Fix BTreeSet and BTreeMap gdb pretty-printers) - #56151 (Move a flaky process test out of libstd) - #56170 (Fix self profiler ICE on Windows) - #56176 (Panic setup msg) - #56204 (Suggest correct enum variant on typo) - #56207 (Stabilize the int_to_from_bytes feature) - #56210 (read_c_str should call the AllocationExtra hooks) - #56211 ([master] Forward-ports from beta) Failed merges: r? @ghost
fixes#53451