Skip to content
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

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jan 20, 2025

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.

@rustbot
Copy link
Collaborator

rustbot commented Jan 20, 2025

r? @oli-obk

rustbot has assigned @oli-obk.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 20, 2025

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

@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Jan 20, 2025

@bors r+ rollup=never

May be perf sensitive

@bors
Copy link
Contributor

bors commented Jan 20, 2025

📌 Commit e9a5660 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 20, 2025
@scottmcm
Copy link
Member

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.

...and you'll be deleting this shortly (in #135748) anyway :)

@jieyouxu
Copy link
Member

@bors p=5 (threading between rollups)

@bors
Copy link
Contributor

bors commented Jan 26, 2025

⌛ Testing commit e9a5660 with merge d9b4598...

@bors
Copy link
Contributor

bors commented Jan 26, 2025

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing d9b4598 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 26, 2025
@bors bors merged commit d9b4598 into rust-lang:master Jan 26, 2025
7 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 26, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d9b4598): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.2% [3.2%, 3.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
6.6% [6.6%, 6.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results (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.

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.0%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.0%] 1

Bootstrap: 771.892s -> 773.047s (0.15%)
Artifact size: 325.83 MiB -> 325.89 MiB (0.02%)

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 28, 2025
…-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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants