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

Optimize mk_region #108020

Merged
merged 4 commits into from
Feb 16, 2023
Merged

Optimize mk_region #108020

merged 4 commits into from
Feb 16, 2023

Conversation

nnethercote
Copy link
Contributor

PR #107869 avoiding some interning under mk_ty by special-casing Ty variants with simple (integer) bodies. This PR does something similar for regions.

r? @compiler-errors

@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 Feb 14, 2023
@rustbot
Copy link
Collaborator

rustbot commented Feb 14, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me when perf comes back green, looks good to me.

edit: oh, also seems to need a rebase.

@nnethercote
Copy link
Contributor Author

Thanks for the fast review!

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

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

bors commented Feb 14, 2023

⌛ Trying commit a6d704eb87efb0a15e1d6b49ab44a8088ae5576f with merge 87ab11387193414f9cbceff868dd2f1f59f60803...

@bors
Copy link
Contributor

bors commented Feb 14, 2023

☀️ Try build successful - checks-actions
Build commit: 87ab11387193414f9cbceff868dd2f1f59f60803 (87ab11387193414f9cbceff868dd2f1f59f60803)

@rust-timer

This comment has been minimized.

@nnethercote
Copy link
Contributor Author

BTW, I tried similar things with mk_predicate, but predicates are more complex. There are no variants containing just an integer, for example. The existing reuse_or_mk_predicate function is effective, I couldn't improve on that.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (87ab11387193414f9cbceff868dd2f1f59f60803): comparison URL.

Overall result: ✅ improvements - 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-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.

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

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.

mean range count
Regressions ❌
(primary)
0.6% [0.6%, 0.6%] 1
Regressions ❌
(secondary)
2.1% [1.8%, 3.1%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.6% [-2.1%, -0.7%] 5
All ❌✅ (primary) 0.6% [0.6%, 0.6%] 1

Cycles

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

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

oli-obk commented Feb 14, 2023

@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Feb 14, 2023

📌 Commit a6d704eb87efb0a15e1d6b49ab44a8088ae5576f has been approved by compiler-errors

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 Feb 14, 2023
@bors
Copy link
Contributor

bors commented Feb 14, 2023

☔ The latest upstream changes (presumably #108052) made this pull request unmergeable. Please resolve the merge conflicts.

@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 Feb 14, 2023
It's not used on any hot paths, and so has little perf benefit, and it
interferes with the optimizations in the following commits.
Much like there are specialized variants of `mk_ty`. This will enable
some optimization in the next commit.

Also rename the existing `re_error*` functions as `mk_re_error*`, for
consistency.
@nnethercote
Copy link
Contributor Author

I rebased.

@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Feb 14, 2023

📌 Commit 9a53cee has been approved by compiler-errors

It is now in the queue for this repository.

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

@bors retry

@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 Feb 15, 2023
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
curl: (22) The requested URL returned error: 404

error: failed to download llvm from ci

    help: old builds get deleted after a certain time
    help: if trying to compile an old commit of rustc, disable `download-ci-llvm` in config.toml:

    [llvm]
    download-ci-llvm = false
Build completed unsuccessfully in 0:00:00

@bors
Copy link
Contributor

bors commented Feb 16, 2023

⌛ Testing commit 9a53cee with merge c5d1b3e...

@bors
Copy link
Contributor

bors commented Feb 16, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing c5d1b3e to master...

1 similar comment
@bors
Copy link
Contributor

bors commented Feb 16, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing c5d1b3e to master...

@bors bors added merged-by-bors This PR was explicitly merged by bors. labels Feb 16, 2023
@bors bors merged commit c5d1b3e into rust-lang:master Feb 16, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 16, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c5d1b3e): comparison URL.

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

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

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.1% [2.4%, 4.9%] 6
Improvements ✅
(primary)
-4.6% [-4.6%, -4.6%] 1
Improvements ✅
(secondary)
-2.8% [-4.6%, -1.0%] 5
All ❌✅ (primary) -4.6% [-4.6%, -4.6%] 1

Cycles

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

@nnethercote nnethercote deleted the opt-mk_region branch February 16, 2023 20:42
qinheping added a commit to qinheping/kani that referenced this pull request Mar 10, 2023
Remove some superfluous type parameters from layout.rs rust-lang/rust#107163
Introduce -Zterminal-urls to use OSC8 for error codes rust-lang/rust#107838
Unify validity checks into a single query rust-lang/rust#108364
s/eval_usize/eval_target_usize/ for clarity rust-lang/rust#108029
Use target instead of machine for mir interpreter integer handling rust-lang/rust#108047
Switch to EarlyBinder for type_of query rust-lang/rust#107753
Rename interner funcs rust-lang/rust#108250
Optimize mk_region rust-lang/rust#108020
Clarify iterator interners rust-lang/rust#108112
qinheping added a commit to qinheping/kani that referenced this pull request Mar 10, 2023
- Remove some superfluous type parameters from layout.rs rust-lang/rust#107163
- Introduce -Zterminal-urls to use OSC8 for error codes rust-lang/rust#107838
- Unify validity checks into a single query rust-lang/rust#108364
- s/eval_usize/eval_target_usize/ for clarity rust-lang/rust#108029
- Use target instead of machine for mir interpreter integer handling rust-lang/rust#108047
- Switch to EarlyBinder for type_of query rust-lang/rust#107753
- Rename interner funcs rust-lang/rust#108250
- Optimize mk_region rust-lang/rust#108020
- Clarify iterator interners rust-lang/rust#108112
tautschnig pushed a commit to qinheping/kani that referenced this pull request Mar 17, 2023
- Remove some superfluous type parameters from layout.rs rust-lang/rust#107163
- Introduce -Zterminal-urls to use OSC8 for error codes rust-lang/rust#107838
- Unify validity checks into a single query rust-lang/rust#108364
- s/eval_usize/eval_target_usize/ for clarity rust-lang/rust#108029
- Use target instead of machine for mir interpreter integer handling rust-lang/rust#108047
- Switch to EarlyBinder for type_of query rust-lang/rust#107753
- Rename interner funcs rust-lang/rust#108250
- Optimize mk_region rust-lang/rust#108020
- Clarify iterator interners rust-lang/rust#108112
tautschnig pushed a commit to qinheping/kani that referenced this pull request Mar 17, 2023
- Remove some superfluous type parameters from layout.rs rust-lang/rust#107163
- Introduce -Zterminal-urls to use OSC8 for error codes rust-lang/rust#107838
- Unify validity checks into a single query rust-lang/rust#108364
- s/eval_usize/eval_target_usize/ for clarity rust-lang/rust#108029
- Use target instead of machine for mir interpreter integer handling rust-lang/rust#108047
- Switch to EarlyBinder for type_of query rust-lang/rust#107753
- Rename interner funcs rust-lang/rust#108250
- Optimize mk_region rust-lang/rust#108020
- Clarify iterator interners rust-lang/rust#108112
tautschnig pushed a commit to qinheping/kani that referenced this pull request Mar 17, 2023
- Remove some superfluous type parameters from layout.rs rust-lang/rust#107163
- Introduce -Zterminal-urls to use OSC8 for error codes rust-lang/rust#107838
- Unify validity checks into a single query rust-lang/rust#108364
- s/eval_usize/eval_target_usize/ for clarity rust-lang/rust#108029
- Use target instead of machine for mir interpreter integer handling rust-lang/rust#108047
- Switch to EarlyBinder for type_of query rust-lang/rust#107753
- Rename interner funcs rust-lang/rust#108250
- Optimize mk_region rust-lang/rust#108020
- Clarify iterator interners rust-lang/rust#108112
tautschnig pushed a commit to qinheping/kani that referenced this pull request Mar 17, 2023
- Remove some superfluous type parameters from layout.rs rust-lang/rust#107163
- Introduce -Zterminal-urls to use OSC8 for error codes rust-lang/rust#107838
- Unify validity checks into a single query rust-lang/rust#108364
- s/eval_usize/eval_target_usize/ for clarity rust-lang/rust#108029
- Use target instead of machine for mir interpreter integer handling rust-lang/rust#108047
- Switch to EarlyBinder for type_of query rust-lang/rust#107753
- Rename interner funcs rust-lang/rust#108250
- Optimize mk_region rust-lang/rust#108020
- Clarify iterator interners rust-lang/rust#108112
tautschnig added a commit to tautschnig/kani that referenced this pull request Apr 16, 2023
Upstream PRs that require local changes:

- Don't ICE in might_permit_raw_init if reference is polymorphic rust-lang/rust#108012
- Use target instead of machine for mir interpreter integer handling rust-lang/rust#108047
- Optimize mk_region rust-lang/rust#108020

Co-authored-by: Qinheping Hu <qinhh@amazon.com>
tautschnig added a commit to tautschnig/kani that referenced this pull request Apr 16, 2023
Upstream PRs that require local changes:

- Don't ICE in might_permit_raw_init if reference is polymorphic rust-lang/rust#108012
- Use target instead of machine for mir interpreter integer handling rust-lang/rust#108047
- Optimize mk_region rust-lang/rust#108020

Co-authored-by: Qinheping Hu <qinhh@amazon.com>
tautschnig added a commit to tautschnig/kani that referenced this pull request Apr 16, 2023
Upstream PRs that require local changes:

- Don't ICE in might_permit_raw_init if reference is polymorphic rust-lang/rust#108012
- Use target instead of machine for mir interpreter integer handling rust-lang/rust#108047
- Optimize mk_region rust-lang/rust#108020

Co-authored-by: Qinheping Hu <qinhh@amazon.com>
tautschnig pushed a commit to qinheping/kani that referenced this pull request Apr 17, 2023
- Introduce -Zterminal-urls to use OSC8 for error codes rust-lang/rust#107838
- Unify validity checks into a single query rust-lang/rust#108364
- Rename interner funcs rust-lang/rust#108250
- Optimize mk_region rust-lang/rust#108020
- Clarify iterator interners rust-lang/rust#108112
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.

7 participants