Conversation
This comment has been minimized.
This comment has been minimized.
src/librustc/ty/instance.rs
Outdated
There was a problem hiding this comment.
I forget where/if I left a comment, but the current situation with Instance's types and Instance::ty_env in particular is pretty bad and we should probably require passing ParamEnv around a lot (or maybe start using ParamEnvAnd<Instance>?).
|
Why does this use |
Using Also, if the parameters are truly unused then we might get away without a |
|
⌛ Testing commit 912db12b2987099ce7f0a3826106b92cf8e0cbde with merge b40298da8de398d2a20f6d0ec3ea9cb262a205c0... |
This comment has been minimized.
This comment has been minimized.
This commit implements the `unused_generic_params` query, an initial version of polymorphization which detects when an item does not use generic parameters and is being needlessly monomorphized as a result. Signed-off-by: David Wood <david@davidtw.co>
This commit normalizes function signatures for instances before substituting, a workaround for polymorphization considering parameters unused when they show up in the signature, but not the body (due to being normalized). Unfortunately, this causes test output to change with the parallel compiler only. Signed-off-by: David Wood <david@davidtw.co>
This commit records the results of `unused_generic_params` in crate metadata, hopefully improving performance. Signed-off-by: David Wood <david@davidtw.co>
This commit replaces the `-Z polymorphize-errors` debugging flag with a `#[rustc_polymorphize_error]` attribute for use on functions. Signed-off-by: David Wood <david@davidtw.co>
This commit introduces a `FiniteBitSet` type which replaces the manual bit manipulation which was being performed in polymorphization. Signed-off-by: David Wood <david@davidtw.co>
912db12 to
4b99699
Compare
|
@bors r=eddyb |
|
📌 Commit 4b99699 has been approved by |
|
🌲 The tree is currently closed for pull requests below priority 5, this pull request will be tested once the tree is reopened |
|
☀️ Test successful - checks-actions, checks-azure |
|
This was a perf loss on landing, as expected. |
This PR implements an analysis to detect when functions could remain polymorphic during code generation.
Fixes #46477
r? @eddyb
cc @rust-lang/wg-mir-opt @nikomatsakis @pnkfelix