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

Add a pointer to address cast kind #97582

Merged
merged 1 commit into from
May 31, 2022
Merged

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented May 31, 2022

A pointer to address cast are often special-cased. Introduce a dedicated cast kind to make them easy distinguishable.

A pointer to address cast are often special-cased.
Introduce a dedicated cast kind to make them easy distinguishable.
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 31, 2022
@rust-highfive
Copy link
Collaborator

Some changes occured to rustc_codegen_cranelift

cc @bjorn3

Some changes occured to the CTFE / Miri engine

cc @rust-lang/miri

@rust-highfive
Copy link
Collaborator

r? @compiler-errors

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 31, 2022
@tmiasko tmiasko force-pushed the pointer-address-cast branch 3 times, most recently from dc14747 to dff602f Compare May 31, 2022 14:32
@RalfJung
Copy link
Member

IMO we should also have a cast kind for the opposite direction. They don't read or write state, but they might be non-deterministic (depending on the model we end up with), which for some analyses is also a "side-effect".

@RalfJung
Copy link
Member

Oh, looks like the "may have side effects" commit was moved out of this MR. Please ping me in the PR where it is added then, I might have some comments. :)

@oli-obk
Copy link
Contributor

oli-obk commented May 31, 2022

cc @rust-lang/wg-mir-opt

@bors r+

misc casts do sound like we just gave up on categorization. Maybe we should do all the decision making in mir building and get rid of the catch-all Misc variant

@bors
Copy link
Contributor

bors commented May 31, 2022

📌 Commit dff602f has been approved by oli-obk

@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 May 31, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request May 31, 2022
…-obk

Add a pointer to address cast kind

A pointer to address cast are often special-cased. Introduce a dedicated cast kind to make them easy distinguishable.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 31, 2022
…-obk

Add a pointer to address cast kind

A pointer to address cast are often special-cased. Introduce a dedicated cast kind to make them easy distinguishable.
@bors
Copy link
Contributor

bors commented May 31, 2022

⌛ Testing commit dff602f with merge e094492...

@bors
Copy link
Contributor

bors commented May 31, 2022

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 31, 2022
@bors bors merged commit e094492 into rust-lang:master May 31, 2022
@rustbot rustbot added this to the 1.63.0 milestone May 31, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e094492): comparison url.

Instruction count

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

Max RSS (memory usage)

Results
  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
1.8% 2.3% 2
Regressions 😿
(secondary)
2.7% 2.7% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-4.0% -5.0% 3
All 😿🎉 (primary) 1.8% 2.3% 2

Cycles

Results
  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-2.4% -2.4% 1
Improvements 🎉
(secondary)
-3.5% -4.0% 2
All 😿🎉 (primary) -2.4% -2.4% 1

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@tmiasko tmiasko deleted the pointer-address-cast branch June 1, 2022 05:28
@RalfJung
Copy link
Member

RalfJung commented Jun 2, 2022

misc casts do sound like we just gave up on categorization. Maybe we should do all the decision making in mir building and get rid of the catch-all Misc variant

Yes... I opened #97649 to track the cleanup here.

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 3, 2022
add cast kind of from_exposed_addr (int-to-ptr casts)

This is basically the dual to rust-lang#97582, for int2ptr casts.

Cc `@tmiasko` rust-lang#97649
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Jun 4, 2022
add cast kind of from_exposed_addr (int-to-ptr casts)

This is basically the dual to rust-lang/rust#97582, for int2ptr casts.

Cc `@tmiasko` rust-lang/rust#97649
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