Repository navigation
Conversation
|
cc @bjorn3 |
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Cc @nikic |
| ) -> TargetMachineFactoryFn<Self> { | ||
| back::write::target_machine_factory(sess, optlvl) | ||
| fn target_machine_factory(&self, sess: &Session) -> TargetMachineFactoryFn<Self> { | ||
| back::write::target_machine_factory(sess, sess.opts.optimize) |
There was a problem hiding this comment.
Can this be changed to only accept sess?
There was a problem hiding this comment.
I was considering that, but there is a "create_informational_machine" (or thereabouts) function that passes OptLevel::No, and I was unsure whether passing the opt level there would cause perf regressions.
There was a problem hiding this comment.
That function is only used for fetching information from LLVM, not for any actual compilation, so I think it would't affect performance at all, but I don't know if LLVM does some work on creating the optimization pipeline in advance when creating a target machine.
There was a problem hiding this comment.
Yep, that's exactly my doubt too :-)
04c5c5d to
43aa445
Compare
This comment has been minimized.
This comment has been minimized.
|
r? nikic |
43aa445 to
17a8df9
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
Turns out that all uses were effectively equivalent to using sess.opts.optimize.
17a8df9 to
b52077c
Compare
|
@bors r+ |
Remove `backend_optimization_level`. Turns out that all uses were effectively equivalent to using sess.opts.optimize. In particular, the output of that function was only ever passed to target_machine_factory, which ignores it on anything but llvm, and on llvm it only passed it to to_llvm_opt_settings, where the difference between Size/SizeMin/More is only the second return value, which is immediately dropped. So replacing all uses of backend_optimization_level with sess.opts.optimize is effectively equivalent. LLM usage: I asked $LLM to review the commit, and it didn't complain about anything. Also $LLM initially figured out (and I confirmed) that backend_optimization_level was effectively a no-op.
Remove `backend_optimization_level`. Turns out that all uses were effectively equivalent to using sess.opts.optimize. In particular, the output of that function was only ever passed to target_machine_factory, which ignores it on anything but llvm, and on llvm it only passed it to to_llvm_opt_settings, where the difference between Size/SizeMin/More is only the second return value, which is immediately dropped. So replacing all uses of backend_optimization_level with sess.opts.optimize is effectively equivalent. LLM usage: I asked $LLM to review the commit, and it didn't complain about anything. Also $LLM initially figured out (and I confirmed) that backend_optimization_level was effectively a no-op.
…uwer Rollup of 16 pull requests Successful merges: - #165575 (Upgrade bundled musl to 1.2.6) - #163992 (add `core::arch::{x86, x86_64}::x87_f80`) - #165117 (std: use skip_unsupported_miri_tests to control when tests should be skipped in Miri due to missing shims) - #165458 (fix incorrect byte count suffix on MSVC) - #165487 (Migrate built-in macros `pattern_type` & `view_type` to macros 2.0 that expand to internal syntax) - #165490 (Mark the compile unit for `-Zdebuginfo-for-profiling`) - #165586 (Remove `backend_optimization_level`.) - #165646 (fix NumScalableVectors::from_field_count) - #165655 (Unignore passing GCC backend tests) - #165740 (miri subtree update) - #164559 (Windows: fix Dir::remove and Dir::rename following symlinks) - #165682 (interpret: ensure newly created unions have uninit in their padding) - #165693 (Move `check_attr` to attribute parsing) - #165715 (windows: check for null before wide encoding) - #165717 (mpsc_sync::stream_send_recv_stress: wait for all threads to finish) - #165733 (docs(num): remove needless whitespaces) Failed merges: - #165727 (Normalize "beta release channel" in `const-supertrait-unstable` test) - #153261 (Partially stabilize `ptr_alignment_type` as `alignment_type`) - #164218 (Tweak private re-export errors to point at correct span and have more context) - #165709 (remove 'x miri' smoke test from PR CI)
Turns out that all uses were effectively equivalent to using sess.opts.optimize.
In particular, the output of that function was only ever passed to target_machine_factory, which ignores it on anything but llvm, and on llvm it only passed it to to_llvm_opt_settings, where the difference between Size/SizeMin/More is only the second return value, which is immediately dropped. So replacing all uses of backend_optimization_level with sess.opts.optimize is effectively equivalent.
LLM usage: I asked $LLM to review the commit, and it didn't complain about anything. Also $LLM initially figured out (and I confirmed) that backend_optimization_level was effectively a no-op.