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 query for checking whether a function is an intrinsic. #97012

Merged
merged 1 commit into from
May 17, 2022

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented May 13, 2022

work towards #93145

This will reduce churn when we add more ways to declare intrinsics

r? @scottmcm

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

Some changes occurred in src/tools/clippy.

cc @rust-lang/clippy

Some changes occured 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 May 13, 2022
@oli-obk
Copy link
Contributor Author

oli-obk commented May 13, 2022

@bors try @rust-timer queue

could have perf effects due to the new query plus changes in how fn_sig is called

@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 May 13, 2022
@bors
Copy link
Contributor

bors commented May 13, 2022

⌛ Trying commit 85132260bf971f7292d93b2ca048ff82b15eb2f5 with merge 6b213e8c965232a466dbe92b778e7c0b868ae89a...

@rust-log-analyzer

This comment has been minimized.

@bjorn3
Copy link
Member

bjorn3 commented May 13, 2022

How would this exactly help? Checking the abi works fine, right?

@oli-obk
Copy link
Contributor Author

oli-obk commented May 13, 2022

So the plan was to actually move away from having a separate ABI (at least for compiler intrinsics, we'll see about platform intrinsics). We'll end up with regular Rust functions that backends can opt to either replace with custom logic or just run the pure rust (but likely slower) logic

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented May 13, 2022

💔 Test failed - checks-actions

@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-review Status: Awaiting review from the assignee but also interested parties. labels May 13, 2022
@oli-obk
Copy link
Contributor Author

oli-obk commented May 16, 2022

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

@bors
Copy link
Contributor

bors commented May 16, 2022

⌛ Trying commit 0a6b691 with merge 2c3dcdc0742a2a2bd9c43d4708c30d1612a9d995...

@bors
Copy link
Contributor

bors commented May 16, 2022

☀️ Try build successful - checks-actions
Build commit: 2c3dcdc0742a2a2bd9c43d4708c30d1612a9d995 (2c3dcdc0742a2a2bd9c43d4708c30d1612a9d995)

@rust-timer
Copy link
Collaborator

Queued 2c3dcdc0742a2a2bd9c43d4708c30d1612a9d995 with parent 56d540e, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2c3dcdc0742a2a2bd9c43d4708c30d1612a9d995): comparison url.

Summary:

  • Primary benchmarks: mixed results
  • Secondary benchmarks: mixed results
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 7 9 15 2 22
mean2 0.3% 0.3% -0.3% -0.5% -0.1%
max 0.3% 0.4% -0.5% -0.5% -0.5%

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

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

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

@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 May 16, 2022
@oli-obk
Copy link
Contributor Author

oli-obk commented May 16, 2022

The stm32f4 regression in cachegrind looks as follows:

12,359,260  ???:rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, bool>>
 6,552,710  ???:<rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
-3,640,522  ???:rustc_hir::intravisit::walk_ty::<rustc_typeck::check::wfcheck::CheckTypeWellFormedVisitor>
 3,323,413  ???:<rustc_typeck::check::wfcheck::CheckTypeWellFormedVisitor as rustc_hir::intravisit::Visitor>::visit_ty
 2,992,392  ???:rustc_query_system::dep_graph::graph::hash_result::<bool>
 2,756,993  ???:<rustc_query_system::dep_graph::serialized::SerializedDepGraph<rustc_middle::dep_graph::dep_node::DepKind> as rustc_serialize::serialize::Decodable<rustc_serialize::opaque::Decoder>>::decode
 2,074,107  ???:<rustc_middle::hir::map::Map>::par_visit_all_item_likes::<rustc_typeck::check::wfcheck::CheckTypeWellFormedVisitor>
-2,074,106  ???:rustc_data_structures::sync::par_for_each_in::<&alloc::vec::Vec<rustc_hir::hir::MaybeOwner<&rustc_hir::hir::OwnerInfo>>, <rustc_middle::hir::map::Map>::par_visit_all_item_likes<rustc_typeck::check::wfcheck::CheckTypeWellFormedVisitor>::{closure
 1,768,396  ???:<core::iter::adapters::map::Map<core::iter::adapters::map::Map<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_query_system::dep_graph::dep_node::DepNode<rustc_middle::dep_graph::dep_node::DepKind>>>, <rustc_index::vec::IndexVec<rustc_query_system::dep_graph::serialized::SerializedDepNodeIndex, rustc_query_system::dep_graph::dep_node::DepNode<rustc_middle::dep_graph::dep_node::DepKind>>>::iter_enumerated::{closure
 1,496,256  ???:rustc_middle::ty::util::is_intrinsic
 1,428,531  ???:<rustc_data_structures::intern::Interned<rustc_middle::ty::adt::AdtDefData> as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
 1,266,012  ???:<rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::is_intrinsic
 1,253,030  ???:<rustc_query_system::dep_graph::dep_node::DepNode<rustc_middle::dep_graph::dep_node::DepKind> as rustc_middle::dep_graph::dep_node::DepNodeExt>::extract_def_id
-1,192,331  ???:<rustc_middle::ty::context::CtxtInterners>::intern_ty
 1,127,739  ???:<hashbrown::raw::RawTable<(rustc_span::def_id::DefId, (bool, rustc_query_system::dep_graph::graph::DepNodeIndex))>>::reserve_rehash::<hashbrown::map::make_hasher<rustc_span::def_id::DefId, rustc_span::def_id::DefId, (bool, rustc_query_system::dep_graph::graph::DepNodeIndex), core::hash::BuildHasherDefault<rustc_hash::FxHasher>>::{closure
   997,882  ???:rustc_query_system::query::plumbing::try_get_cached::<rustc_middle::ty::context::TyCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, bool>, bool, rustc_middle::ty::query::copy<bool>>
   858,762  ???:<rustc_middle::dep_graph::dep_node::DepKind as rustc_query_system::dep_graph::DepKind>::read_deps::<<rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::read_index::{closure
   700,538  ???:<rustc_metadata::rmeta::encoder::EncodeContext as rustc_hir::intravisit::Visitor>::visit_item

@oli-obk
Copy link
Contributor Author

oli-obk commented May 16, 2022

The regression is pretty much expected. Some overhead will happen when query nodes get dirty and thus recomputed. Since it's overall actually a win, I'm not going to try to change anything.

@scottmcm
Copy link
Member

Awesome to see work towards #93145!

That said, I know nothing about queries and am not a compiler contributor, so I don't think I'm the right person to review.
r? rust-lang/compiler

@rust-highfive rust-highfive assigned davidtwco and unassigned scottmcm May 16, 2022
@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented May 17, 2022

📌 Commit 0a6b691 has been approved by davidtwco

@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. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 17, 2022
@bors
Copy link
Contributor

bors commented May 17, 2022

⌛ Testing commit 0a6b691 with merge c90bab9f75c2ec4b9f77efe9304ae809cdbfe904...

@bors
Copy link
Contributor

bors commented May 17, 2022

💔 Test failed - checks-actions

@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 May 17, 2022
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
.......... (60/64)
...       (64/64)


/checkout/src/test/rustdoc-gui/escape-key.goml escape-key... FAILED
[ERROR] (line 6) TimeoutError: waiting for selector "#search h1" failed: timeout 30000ms exceeded: for command `wait-for: "#search h1" // The search element is empty before the first search `
Build completed unsuccessfully in 0:00:41

@oli-obk
Copy link
Contributor Author

oli-obk commented May 17, 2022

@bors retry timeout

@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 17, 2022
@bors
Copy link
Contributor

bors commented May 17, 2022

⌛ Testing commit 0a6b691 with merge 735efc0...

@bors
Copy link
Contributor

bors commented May 17, 2022

☀️ Test successful - checks-actions
Approved by: davidtwco
Pushing 735efc0 to master...

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

Finished benchmarking commit (735efc0): comparison url.

Summary:

  • Primary benchmarks: mixed results
  • Secondary benchmarks: mixed results
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 7 9 16 2 23
mean2 0.3% 0.3% -0.3% -0.5% -0.1%
max 0.3% 0.4% -0.5% -0.5% -0.5%

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

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

@oli-obk oli-obk deleted the 🦀_intrinsics branch May 17, 2022 19:33
@oli-obk
Copy link
Contributor Author

oli-obk commented May 17, 2022

@rustbot label: +perf-regression-triaged

As per previous analysis #97012 (comment)

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label May 17, 2022
xFrednet pushed a commit to xFrednet/rust that referenced this pull request May 21, 2022
Add a query for checking whether a function is an intrinsic.

work towards rust-lang#93145

This will reduce churn when we add more ways to declare intrinsics

r? `@scottmcm`
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. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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