-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get rid of mir::Const::from_ty_const
#135753
Conversation
Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in exhaustiveness checking cc @Nadrieril |
This comment has been minimized.
This comment has been minimized.
6433753
to
e9a5660
Compare
@bors r+ rollup=never May be perf sensitive |
...and you'll be deleting this shortly (in #135748) anyway :) |
@bors p=5 (threading between rollups) |
☀️ Test successful - checks-actions |
Finished benchmarking commit (d9b4598): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (secondary 3.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary 6.6%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary 0.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 771.892s -> 773.047s (0.15%) |
…-obk Get rid of `mir::Const::from_ty_const` This function is strange, because it turns valtrees into `mir::Const::Value`, but the rest of the const variants stay as type system consts. All of the callsites except for one in `instsimplify` (array length simplification of `ptr_metadata` call) just go through the valtree arm of the function, so it's easier to just create a `mir::Const` directly for those. For the instsimplify case, if we have a type system const we should *keep* having a type system const, rather than turning it into a `mir::Const::Value`; it doesn't really matter in practice, though, bc `usize` has no padding, but it feels more principled.
This function is strange, because it turns valtrees into
mir::Const::Value
, but the rest of the const variants stay as type system consts.All of the callsites except for one in
instsimplify
(array length simplification ofptr_metadata
call) just go through the valtree arm of the function, so it's easier to just create amir::Const
directly for those.For the instsimplify case, if we have a type system const we should keep having a type system const, rather than turning it into a
mir::Const::Value
; it doesn't really matter in practice, though, bcusize
has no padding, but it feels more principled.