Repository navigation
view-types: lower view types from HIR - #165565
Conversation
48b4287 to
cca7f38
Compare
|
r? oli-obk |
|
changes to the core type system cc @lcnr Some changes occurred in compiler/rustc_sanitizers cc @rcvalle Some changes occurred to the CTFE machinery Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri HIR ty lowering was modified cc @fmease Some changes occurred in exhaustiveness checking cc @Nadrieril Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt
cc @rust-lang/clippy This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a, @makai410 Some changes occurred in compiler/rustc_codegen_llvm/src/debuginfo cc @Walnut356 |
There was a problem hiding this comment.
should also add a test showing that view types are actually unsized. nevermind, just saw #165694
|
Reminder, once the PR becomes ready for a review, use |
after some discussion, we decided we want view types to be `!Sized`, at least at the beginning. this commit updates the test suite so that view types are not passed by value anymore.
this commit is quite big because we want to always exhaustively match on all the `TyKind` variants. none of the `unimplemented!()` is reachable because we don't *actually* lower view types (yet!).
/!\ the test suite is has not been updated /!\ the `unreachable!()`s added previously are suddenly reached, triggering literally all the view types test suite to ICE. this is fixed by the next commit.
cca7f38 to
3601d42
Compare
|
cc @rust-lang/rustfmt |
…uwer Rollup of 12 pull requests Successful merges: - #164707 (Re-enable rustc profile generation for static linked llvm on Windows x64 builds ) - #165221 (Canonicalize more comparison operators) - #165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`) - #164108 (Add unstable `-Zllvm-tpde` flag to `rustc_codegen_llvm`) - #165565 (view-types: lower view types from HIR) - #165771 (tests: cover MSVC ThinLTO exported symbol preservation) - #165810 (reflection: reflect attributes from adts, fields, and variants) - #165823 (Tweak crate error wording and turn them into fatal errors) - #165849 (More opt-dist improvements) - #165855 (Update `sysinfo` version to `0.40.3`) - #165861 (cg_llvm: Use an invariant lifetime brand for LLVM attributes) - #165872 (Some attribute related cleanups)
…g, r=oli-obk view-types: lower view types from HIR
Rollup of 13 pull requests Successful merges: - #164707 (Re-enable rustc profile generation for static linked llvm on Windows x64 builds ) - #165068 (Change color usage for highlights) - #165841 (Tell Miri about the alignment handling in the Windows System allocator) - #165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`) - #164108 (Add unstable `-Zllvm-tpde` flag to `rustc_codegen_llvm`) - #165565 (view-types: lower view types from HIR) - #165622 (small cleanups in rustc_codegen_llvm) - #165771 (tests: cover MSVC ThinLTO exported symbol preservation) - #165810 (reflection: reflect attributes from adts, fields, and variants) - #165823 (Tweak crate error wording and turn them into fatal errors) - #165849 (More opt-dist improvements) - #165855 (Update `sysinfo` version to `0.40.3`) - #165872 (Some attribute related cleanups) Failed merges: - #165861 (cg_llvm: Use an invariant lifetime brand for LLVM attributes)
…g, r=oli-obk view-types: lower view types from HIR
Rollup of 11 pull requests Successful merges: - #165068 (Change color usage for highlights) - #165841 (Tell Miri about the alignment handling in the Windows System allocator) - #165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`) - #164108 (Add unstable `-Zllvm-tpde` flag to `rustc_codegen_llvm`) - #165565 (view-types: lower view types from HIR) - #165622 (small cleanups in rustc_codegen_llvm) - #165771 (tests: cover MSVC ThinLTO exported symbol preservation) - #165810 (reflection: reflect attributes from adts, fields, and variants) - #165849 (More opt-dist improvements) - #165855 (Update `sysinfo` version to `0.40.3`) - #165872 (Some attribute related cleanups) Failed merges: - #165861 (cg_llvm: Use an invariant lifetime brand for LLVM attributes)
…g, r=oli-obk view-types: lower view types from HIR
…uwer Rollup of 18 pull requests Successful merges: - #164828 (When suggesting path of renamed crate, use the renamed name) - #164864 (Avoid hoisting uninitialized reads in EarlyOtherwiseBranch) - #165068 (Change color usage for highlights) - #165221 (Canonicalize more comparison operators) - #165841 (Tell Miri about the alignment handling in the Windows System allocator) - #165869 (Cleanup: Remove `path_matches` and `value_str` from `AttributeExt`) - #165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`) - #164108 (Add unstable `-Zllvm-tpde` flag to `rustc_codegen_llvm`) - #165565 (view-types: lower view types from HIR) - #165622 (small cleanups in rustc_codegen_llvm) - #165745 (Don't ICE when a guard condition is a place of type `!`) - #165771 (tests: cover MSVC ThinLTO exported symbol preservation) - #165810 (reflection: reflect attributes from adts, fields, and variants) - #165823 (Tweak crate error wording and turn them into fatal errors) - #165849 (More opt-dist improvements) - #165855 (Update `sysinfo` version to `0.40.3`) - #165872 (Some attribute related cleanups) - #165905 (CI: Use a consistent locale when sorting docker build inputs)
…uwer Rollup of 17 pull requests Successful merges: - #164828 (When suggesting path of renamed crate, use the renamed name) - #164864 (Avoid hoisting uninitialized reads in EarlyOtherwiseBranch) - #165068 (Change color usage for highlights) - #165221 (Canonicalize more comparison operators) - #165841 (Tell Miri about the alignment handling in the Windows System allocator) - #165869 (Cleanup: Remove `path_matches` and `value_str` from `AttributeExt`) - #165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`) - #164108 (Add unstable `-Zllvm-tpde` flag to `rustc_codegen_llvm`) - #165565 (view-types: lower view types from HIR) - #165622 (small cleanups in rustc_codegen_llvm) - #165771 (tests: cover MSVC ThinLTO exported symbol preservation) - #165810 (reflection: reflect attributes from adts, fields, and variants) - #165823 (Tweak crate error wording and turn them into fatal errors) - #165849 (More opt-dist improvements) - #165855 (Update `sysinfo` version to `0.40.3`) - #165872 (Some attribute related cleanups) - #165905 (CI: Use a consistent locale when sorting docker build inputs)
Rollup merge of #165565 - scrabsha:view-types/middle-lowering, r=oli-obk view-types: lower view types from HIR
|
Note This PR was benchmarked as part of triage of its containing rollup: triage URL. Finished benchmarking commit (885e31b): comparison URL. Overall result: ❌ regressions - please read:Our benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary -1.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis perf run didn't have relevant results for this metric. Binary sizeThis perf run didn't have relevant results for this metric. Artifact size: 406.05 MiB -> 406.12 MiB (0.02%) |
|
hi @rust-lang/wg-compiler-performance! i cannot immediately tell why this PR slows down edit: realized it's a edit: desperately trying to make sense out of it. i did the following edits to
i genuinely cannot explain why the |
|
I don't think we need to revert. Those benchmarks are mostly tiny. It actually resembles the dreaded |
|
@panstromek edited my previous message with a cachegrind output (sorry, i saw your message too late). let me know if you need anything more. |
|
For changes like this that are small and seem noisy, it's usually more informative to run it with CI artifacts (the command suggested in the results page). That said, I don't see much specific there. It seems like there's more metadata decoding stuff, but I'm not sure where is that coming from.
Maybe that's it in the end, metadata decoding goes through these codepaths (interning types and stuff like that). It adds some panic paths, those can impact perf as well. |
…uwer Rollup of 17 pull requests Successful merges: - rust-lang/rust#164828 (When suggesting path of renamed crate, use the renamed name) - rust-lang/rust#164864 (Avoid hoisting uninitialized reads in EarlyOtherwiseBranch) - rust-lang/rust#165068 (Change color usage for highlights) - rust-lang/rust#165221 (Canonicalize more comparison operators) - rust-lang/rust#165841 (Tell Miri about the alignment handling in the Windows System allocator) - rust-lang/rust#165869 (Cleanup: Remove `path_matches` and `value_str` from `AttributeExt`) - rust-lang/rust#165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`) - rust-lang/rust#164108 (Add unstable `-Zllvm-tpde` flag to `rustc_codegen_llvm`) - rust-lang/rust#165565 (view-types: lower view types from HIR) - rust-lang/rust#165622 (small cleanups in rustc_codegen_llvm) - rust-lang/rust#165771 (tests: cover MSVC ThinLTO exported symbol preservation) - rust-lang/rust#165810 (reflection: reflect attributes from adts, fields, and variants) - rust-lang/rust#165823 (Tweak crate error wording and turn them into fatal errors) - rust-lang/rust#165849 (More opt-dist improvements) - rust-lang/rust#165855 (Update `sysinfo` version to `0.40.3`) - rust-lang/rust#165872 (Some attribute related cleanups) - rust-lang/rust#165905 (CI: Use a consistent locale when sorting docker build inputs)
|
This is making only rustdoc a little slower. It's not clear why at this time, Thanks for poking at it! @rustbot label +perf-regression-triaged |
|
I threw an LLM at this regression. My summary of what it said:
One way to avoid this would be to change the variant from this: to this: with a requirement that the first Another option would be to mark Neither option seems worth it for this tiny, docs-only, x86-64-only regression. |
|
thank you for taking a look! i agree that |
view-types: lower view types from HIR
…uwer Rollup of 17 pull requests Successful merges: - rust-lang/rust#164828 (When suggesting path of renamed crate, use the renamed name) - rust-lang/rust#164864 (Avoid hoisting uninitialized reads in EarlyOtherwiseBranch) - rust-lang/rust#165068 (Change color usage for highlights) - rust-lang/rust#165221 (Canonicalize more comparison operators) - rust-lang/rust#165841 (Tell Miri about the alignment handling in the Windows System allocator) - rust-lang/rust#165869 (Cleanup: Remove `path_matches` and `value_str` from `AttributeExt`) - rust-lang/rust#165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`) - rust-lang/rust#164108 (Add unstable `-Zllvm-tpde` flag to `rustc_codegen_llvm`) - rust-lang/rust#165565 (view-types: lower view types from HIR) - rust-lang/rust#165622 (small cleanups in rustc_codegen_llvm) - rust-lang/rust#165771 (tests: cover MSVC ThinLTO exported symbol preservation) - rust-lang/rust#165810 (reflection: reflect attributes from adts, fields, and variants) - rust-lang/rust#165823 (Tweak crate error wording and turn them into fatal errors) - rust-lang/rust#165849 (More opt-dist improvements) - rust-lang/rust#165855 (Update `sysinfo` version to `0.40.3`) - rust-lang/rust#165872 (Some attribute related cleanups) - rust-lang/rust#165905 (CI: Use a consistent locale when sorting docker build inputs)
View all comments
part of #155938.
this PR is big but most of the changes come from the second commit and are quite boring. it leaves a whole lot of
unimplemented!()in the codebase, but i believe this is ok for a nightly feature that nobody is seriously using. i will fix them later.