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

interpret: use new OpTy::len for Len rvalue #100085

Merged
merged 2 commits into from
Aug 31, 2022
Merged

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Aug 3, 2022

This avoids a force_allocation.

@rustbot
Copy link
Collaborator

rustbot commented Aug 3, 2022

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 3, 2022
@rust-highfive
Copy link
Collaborator

r? @lcnr

(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 Aug 3, 2022
@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Member Author

RalfJung commented Aug 3, 2022

Ouch, this regresses the lints because we are not conceptually 'reading' from the local rather than 'writing' to it (which is what force_allocation does).

Uh, how is that sound? If it is okay for force_allocation to make a local with unknown content into uninit and then rely on the usual checks for reading from uninit memory, then why does ConstProp even need/have this check? They better not be load-bearing, since they can be circumvented any time using force_allocation...

@lcnr
Copy link
Contributor

lcnr commented Aug 7, 2022

i can't completely follow what's going on here

r? @oli-obk

@RalfJung
Copy link
Member Author

RalfJung commented Aug 7, 2022

Blocked on #100239.

@RalfJung RalfJung added S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 7, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Aug 29, 2022
remove an ineffective check in const_prop

Based on rust-lang#100043, only the last two commits are new.

ConstProp has a special check when reading from a local that prevents reading uninit locals. However, if that local flows into `force_allocation`, then no check fires and evaluation proceeds. So this check is not really effective at preventing accesses to uninit locals.

With rust-lang#100043, `read_immediate` and friends always fail when reading uninit locals, so I don't see why ConstProp would need a separate check. Thus I propose we remove it. This is needed to be able to do rust-lang#100085.
@RalfJung
Copy link
Member Author

Now that #100239 landed, let's see if this works.

@RalfJung
Copy link
Member Author

Looks good. @oli-obk this is @rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. labels Aug 30, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Aug 30, 2022

@bors try @rust-timer queue

I don't expect this to affect things, but the stress tests are weird, so let's run perf first. r=me once perf is done (just so we know whether to rollup or never)

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 30, 2022
@bors
Copy link
Contributor

bors commented Aug 30, 2022

⌛ Trying commit ea8671e with merge 71d63d591e99dec6d4b2746b88e659e423649409...

@bors
Copy link
Contributor

bors commented Aug 30, 2022

☀️ Try build successful - checks-actions
Build commit: 71d63d591e99dec6d4b2746b88e659e423649409 (71d63d591e99dec6d4b2746b88e659e423649409)

@rust-timer
Copy link
Collaborator

Queued 71d63d591e99dec6d4b2746b88e659e423649409 with parent 230a8ee, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (71d63d591e99dec6d4b2746b88e659e423649409): comparison URL.

Overall result: ❌ regressions - no 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.

@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.3% [1.3%, 1.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

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)
3.4% [3.4%, 3.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.9% [-3.5%, -2.1%] 3
All ❌✅ (primary) - - 0

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.6% [-2.6%, -2.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.6% [-2.6%, -2.6%] 1

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 30, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Aug 30, 2022

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 30, 2022

📌 Commit ea8671e 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 Aug 30, 2022
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Aug 30, 2022
interpret: use new OpTy::len for Len rvalue

This avoids a `force_allocation`.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 31, 2022
interpret: use new OpTy::len for Len rvalue

This avoids a `force_allocation`.
@JohnTitor
Copy link
Member

Failed in rollup: #101218 (comment)

@bors r-

@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 Aug 31, 2022
@RalfJung
Copy link
Member Author

Still rather strange that it would slow down the externs test...

This avoids a `force_allocation`
@rustbot
Copy link
Collaborator

rustbot commented Aug 31, 2022

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@RalfJung
Copy link
Member Author

@bors r=oli-obk rollup=iffy

@bors
Copy link
Contributor

bors commented Aug 31, 2022

📌 Commit 7913edb 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 31, 2022
@bors
Copy link
Contributor

bors commented Aug 31, 2022

⌛ Testing commit 7913edb with merge 9243168...

@bors
Copy link
Contributor

bors commented Aug 31, 2022

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

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

Finished benchmarking commit (9243168): 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

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)
2.5% [2.0%, 3.2%] 3
Improvements ✅
(primary)
-3.3% [-3.3%, -3.3%] 1
Improvements ✅
(secondary)
-2.3% [-2.6%, -2.0%] 2
All ❌✅ (primary) -3.3% [-3.3%, -3.3%] 1

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)
2.5% [2.5%, 2.5%] 1
Regressions ❌
(secondary)
4.4% [4.4%, 4.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.7% [-6.2%, -3.2%] 2
All ❌✅ (primary) 2.5% [2.5%, 2.5%] 1

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@RalfJung RalfJung deleted the op-ty-len branch September 1, 2022 07:37
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.

9 participants