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

stop using ty::UnevaluatedConst directly #103227

Merged
merged 4 commits into from
Oct 22, 2022

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Oct 19, 2022

best reviewed commit by commit.

simplifies #99798 because we now don't have to expand ty::UnevaluatedConst to ty::Const.
I also remember some other places where using ty::UnevaluatedConst directly was annoying and caused issues, though I don't quite remember what they were rn '^^

r? @oli-obk cc @JulianKnodt

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 19, 2022
@rustbot
Copy link
Collaborator

rustbot commented Oct 19, 2022

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 19, 2022
@lcnr lcnr force-pushed the bye-bye-unevaluated-const branch from cd7f8d4 to b93713f Compare October 19, 2022 08:15
@oli-obk
Copy link
Contributor

oli-obk commented Oct 19, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Oct 19, 2022

📌 Commit b93713f 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 Oct 19, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Oct 19, 2022

realized that we should probably check perf here 😅

@bors r-
@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 19, 2022
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 19, 2022
@bors
Copy link
Contributor

bors commented Oct 19, 2022

⌛ Trying commit b93713f with merge 5a201f44d27c36ac96ec78a2b161f47a0d2c05fb...

@bors
Copy link
Contributor

bors commented Oct 19, 2022

☀️ Try build successful - checks-actions
Build commit: 5a201f44d27c36ac96ec78a2b161f47a0d2c05fb (5a201f44d27c36ac96ec78a2b161f47a0d2c05fb)

@rust-timer
Copy link
Collaborator

Queued 5a201f44d27c36ac96ec78a2b161f47a0d2c05fb with parent 84365ff, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5a201f44d27c36ac96ec78a2b161f47a0d2c05fb): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.6% [1.3%, 2.0%] 6
Improvements ✅
(primary)
-0.3% [-0.4%, -0.2%] 8
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 1
All ❌✅ (primary) -0.3% [-0.4%, -0.2%] 8

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Footnotes

  1. the arithmetic mean of the percent change

  2. number of relevant changes

@rustbot rustbot added perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 19, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Oct 19, 2022

the regressions in deeply-nested-multi look like subtle inlining changes and they are small enough that I can't be bothered:

  300,939,473  ???:<rustc_middle::ty::fold::RegionFolder as rustc_middle::ty::fold::FallibleTypeFolder>::try_fold_ty
 -257,897,264  ???:<rustc_middle::ty::Ty as rustc_middle::ty::fold::TypeFoldable>::try_fold_with::<rustc_middle::ty::fold::RegionFolder>
   67,497,361  ???:rustc_middle::ty::util::fold_list::<rustc_middle::ty::fold::RegionFolder, rustc_middle::ty::subst::GenericArg, <&rustc_middle::ty::list::List<rustc_middle::ty::subst::GenericArg> as rustc_middle::ty::fold::TypeFoldable>::try_fold_with<rustc_middle::ty::fold::RegionFolder>::{closure#0}>
  -55,028,215  ???:<&rustc_middle::ty::list::List<rustc_middle::ty::subst::GenericArg> as rustc_middle::ty::fold::TypeFoldable>::try_fold_with::<rustc_middle::ty::fold::RegionFolder>
   30,150,640  ???:<rustc_middle::ty::Ty as rustc_middle::ty::fold::TypeFoldable>::fold_with::<rustc_middle::ty::fold::RegionFolder>
  -25,360,097  ???:<rustc_middle::ty::Ty as rustc_middle::ty::fold::TypeSuperFoldable>::super_fold_with::<rustc_middle::ty::fold::RegionFolder>
   -7,820,135  ???:<rustc_middle::ty::subst::GenericArg as rustc_middle::ty::visit::TypeVisitable>::visit_with::<rustc_privacy::DefIdVisitorSkeleton<rustc_privacy::TypePrivacyVisitor>>
   -7,294,284  ???:<rustc_infer::infer::resolve::OpportunisticVarResolver as rustc_middle::ty::fold::TypeFolder>::fold_ty
    4,230,287  ???:<rustc_middle::ty::Ty as rustc_middle::ty::fold::TypeSuperFoldable>::super_fold_with::<rustc_infer::infer::freshen::TypeFreshener>
    3,402,246  ???:<rustc_middle::ty::Ty as rustc_middle::ty::fold::TypeSuperFoldable>::super_fold_with::<rustc_infer::infer::resolve::OpportunisticVarResolver>
    2,359,900  ???:<rustc_infer::infer::resolve::OpportunisticVarResolver as rustc_middle::ty::fold::FallibleTypeFolder>::try_fold_ty
   -1,827,113  ???:<rustc_middle::ty::Ty as rustc_middle::ty::fold::TypeFoldable>::try_fold_with::<rustc_infer::infer::freshen::TypeFreshener>
   -1,630,338  ???:<rustc_infer::infer::freshen::TypeFreshener as rustc_middle::ty::fold::FallibleTypeFolder>::try_fold_ty
    1,186,867  ???:<&rustc_middle::ty::list::List<rustc_middle::ty::subst::GenericArg> as rustc_middle::ty::fold::TypeFoldable>::try_fold_with::<rustc_infer::infer::resolve::OpportunisticVarResolver>
     -783,182  ???:<rustc_infer::infer::freshen::TypeFreshener as rustc_middle::ty::fold::TypeFolder>::fold_ty
     -588,848  ???:<rustc_infer::infer::resolve::FullTypeResolver as rustc_middle::ty::fold::FallibleTypeFolder>::try_fold_ty
      510,288  ???:<rustc_middle::ty::Ty as rustc_middle::ty::fold::TypeSuperFoldable>::try_super_fold_with::<rustc_infer::infer::resolve::FullTypeResolver>

@bors r=oli-obk rollup=never

@bors
Copy link
Contributor

bors commented Oct 19, 2022

📌 Commit b93713f has been approved by oli-obk

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 19, 2022
@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 19, 2022
@bors
Copy link
Contributor

bors commented Oct 22, 2022

⌛ Testing commit b93713f with merge 26c96e3...

@bors
Copy link
Contributor

bors commented Oct 22, 2022

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 22, 2022
@bors bors merged commit 26c96e3 into rust-lang:master Oct 22, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 22, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (26c96e3): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.4%, -0.2%] 10
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.3% [-0.4%, -0.2%] 10

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results

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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.8% [-2.8%, -2.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.8% [-2.8%, -2.8%] 1

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@rustbot rustbot removed the perf-regression Performance regression. label Oct 22, 2022
@lcnr lcnr deleted the bye-bye-unevaluated-const branch October 28, 2022 15:12
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
…i-obk

stop using `ty::UnevaluatedConst` directly

best reviewed commit by commit.

simplifies rust-lang#99798 because we now don't have to expand `ty::UnevaluatedConst` to `ty::Const`.
I also remember some other places where using `ty::UnevaluatedConst` directly was annoying and caused issues, though I don't quite remember what they were rn '^^

r? `@oli-obk` cc `@JulianKnodt`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc 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.

6 participants