Skip to content

Add a pointer to address cast kind - #97582

Merged
bors merged 1 commit into
rust-lang:masterfrom
tmiasko:pointer-address-cast
May 31, 2022
Merged

Add a pointer to address cast kind#97582
bors merged 1 commit into
rust-lang:masterfrom
tmiasko:pointer-address-cast

Conversation

@tmiasko

Copy link
Copy Markdown
Contributor

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.
@rustbotrustbot 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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

r? @compiler-errors

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

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

bors commented May 31, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit dff602f has been approved by oli-obk

@borsbors 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.
@Dylan-DPCDylan-DPC mentioned this pull request May 31, 2022
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

bors commented May 31, 2022

Copy link
Copy Markdown
Collaborator

⌛ Testing commit dff602f with merge e094492...

@bors

bors commented May 31, 2022

Copy link
Copy Markdown
Collaborator

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

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label May 31, 2022
@bors
bors merged commit e094492 into rust-lang:masterMay 31, 2022
@rustbotrustbot added this to the 1.63.0 milestone May 31, 2022
@rust-timer

Copy link
Copy Markdown
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
mean1maxcount2
Regressions 😿
(primary)
1.8%2.3%2
Regressions 😿
(secondary)
2.7%2.7%1
Improvements 🎉
(primary)
N/AN/A0
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
mean1maxcount2
Regressions 😿
(primary)
N/AN/A0
Regressions 😿
(secondary)
N/AN/A0
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 change2

  2. number of relevant changes2

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

Copy link
Copy Markdown
Member

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
christian-schilling pushed a commit to christian-schilling/rustc_codegen_cranelift that referenced this pull request Jan 27, 2026
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
christian-schilling pushed a commit to christian-schilling/rustc_codegen_cranelift that referenced this pull request Jan 27, 2026
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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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

@tmiasko@rust-highfive@RalfJung@oli-obk@bors@rust-timer@compiler-errors@rustbot