Skip to content

MIR Body: Cache result of is_cyclic call #78454

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

Merged
merged 1 commit into from
Dec 28, 2020
Merged

Conversation

bugadani
Copy link
Contributor

No description provided.

@rust-highfive
Copy link
Contributor

r? @eddyb

(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 Oct 27, 2020
@bugadani
Copy link
Contributor Author

Well since I've basically copied the predecessor cache, I've also copied it's testing strategy - i.e., none. I'll try to think about a way to avoid having to eagerly invalidate the caches.

@crlf0710 crlf0710 assigned eddyb and unassigned eddyb Nov 13, 2020
@crlf0710 crlf0710 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 13, 2020
@JohnCSimon JohnCSimon 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 Nov 30, 2020
@JohnCSimon
Copy link
Member

@bugadani - ping from triage - can you post your status on this PR? I've assigned it S-waiting-on-author because it looks like your PR still needs more work.

@bugadani
Copy link
Contributor Author

@JohnCSimon I considered this PR "done", We could do a perf run to see if this change has any practical benefits, but otherwise I don't intend to make more modifications.

looks like your PR still needs more work.

Do you have anything particular in mind?

@crlf0710
Copy link
Member

Switching back to S-waiting-on-review.

@crlf0710 crlf0710 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 18, 2020
@Dylan-DPC-zz
Copy link

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@bors
Copy link
Collaborator

bors commented Dec 20, 2020

⌛ Trying commit 039f54a4884803f65c1af5b6a8d7b9b5faba98bb with merge 7bf4a51615b645428dbc325d087b4e41d0ae0cca...

@bors
Copy link
Collaborator

bors commented Dec 20, 2020

💔 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 Dec 20, 2020
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/compiler/rustc_ast_lowering)
   Compiling chalk-engine v0.36.0
   Compiling rustc_middle v0.0.0 (/checkout/compiler/rustc_middle)
   Compiling rustc_ast_passes v0.0.0 (/checkout/compiler/rustc_ast_passes)
error: cannot find macro `CloneTypeFoldableAndLiftImpls` in this scope
  --> compiler/rustc_middle/src/mir/graph_cyclic_cache.rs:60:1
   |
60 | CloneTypeFoldableAndLiftImpls! {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `TrivialTypeFoldableAndLiftImpls`
  ::: compiler/rustc_middle/src/macros.rs:83:1
   |
   |
83 | macro_rules! TrivialTypeFoldableAndLiftImpls {
   | -------------------------------------------- similarly named macro `TrivialTypeFoldableAndLiftImpls` defined here
   Compiling rustc_expand v0.0.0 (/checkout/compiler/rustc_expand)
   Compiling rustc_builtin_macros v0.0.0 (/checkout/compiler/rustc_builtin_macros)
   Compiling rustc_builtin_macros v0.0.0 (/checkout/compiler/rustc_builtin_macros)
error[E0277]: the trait bound `GraphIsCyclicCache: ty::fold::TypeFoldable<'_>` is not satisfied
    |
    |
148 |   #[derive(Clone, TyEncodable, TyDecodable, Debug, HashStable, TypeFoldable)]
    |                                                                |
    |                                                                |
    |                                                                the trait `ty::fold::TypeFoldable<'_>` is not implemented for `GraphIsCyclicCache`
    | 
   ::: compiler/rustc_middle/src/ty/fold.rs:48:5
    |
    |
48  |       fn fold_with<F: TypeFolder<'tcx>>(self, folder: &mut F) -> Self {
    |       --------------------------------------------------------------- required by `ty::fold::TypeFoldable::fold_with`
   ::: /cargo/registry/src/github.com-1ecc6299db9ec823/synstructure-0.12.4/src/macros.rs:94:9
    |
    |
94  | /         pub fn $derives(
95  | |             i: $crate::macros::TokenStream
96  | |         ) -> $crate::macros::TokenStream {
    | |________________________________________- in this expansion of `#[derive(TypeFoldable)]`

error[E0277]: the trait bound `GraphIsCyclicCache: ty::fold::TypeFoldable<'_>` is not satisfied
    |
    |
148 |   #[derive(Clone, TyEncodable, TyDecodable, Debug, HashStable, TypeFoldable)]
    |                                                                |
    |                                                                |
    |                                                                the trait `ty::fold::TypeFoldable<'_>` is not implemented for `GraphIsCyclicCache`
    | 
   ::: compiler/rustc_middle/src/ty/fold.rs:53:5
    |
    |
53  |       fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> {
    |       -------------------------------------------------------------------------------------- required by `ty::fold::TypeFoldable::visit_with`
   ::: /cargo/registry/src/github.com-1ecc6299db9ec823/synstructure-0.12.4/src/macros.rs:94:9
    |
    |
94  | /         pub fn $derives(
95  | |             i: $crate::macros::TokenStream
96  | |         ) -> $crate::macros::TokenStream {
    | |________________________________________- in this expansion of `#[derive(TypeFoldable)]`
error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0277`.
error: could not compile `rustc_middle`
error: could not compile `rustc_middle`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "16" "--release" "--locked" "--color" "always" "--features" "jemalloc llvm max_level_info" "--manifest-path" "/checkout/compiler/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
failed to run: /checkout/obj/build/bootstrap/debug/bootstrap dist --host x86_64-unknown-linux-gnu --target x86_64-unknown-linux-gnu --include-default-paths src/tools/build-manifest
Build completed unsuccessfully in 0:09:42

@jyn514
Copy link
Member

jyn514 commented Dec 20, 2020

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@bors
Copy link
Collaborator

bors commented Dec 20, 2020

⌛ Trying commit 119879c with merge 08b66ce00bc45651e97c490b2aab2bd5dad9d9b1...

@bors
Copy link
Collaborator

bors commented Dec 20, 2020

☀️ Try build successful - checks-actions
Build commit: 08b66ce00bc45651e97c490b2aab2bd5dad9d9b1 (08b66ce00bc45651e97c490b2aab2bd5dad9d9b1)

@rust-timer
Copy link
Collaborator

Queued 08b66ce00bc45651e97c490b2aab2bd5dad9d9b1 with parent 2ad5292, future comparison URL.

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

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 20, 2020
@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (08b66ce00bc45651e97c490b2aab2bd5dad9d9b1): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf

@rustbot rustbot added 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 Dec 20, 2020
@jyn514
Copy link
Member

jyn514 commented Dec 20, 2020

Up to -.8% instruction counts on many-assoc-items. No regressions :)

@oli-obk
Copy link
Contributor

oli-obk commented Dec 28, 2020

@bors r+

Thanks! Once we get a third cache we should start thinking about a more generic concept for caches, but at this stage, copying seems absolutely right to me.

@bors
Copy link
Collaborator

bors commented Dec 28, 2020

📌 Commit 119879c 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-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 28, 2020
@oli-obk
Copy link
Contributor

oli-obk commented Dec 28, 2020

r? @oli-obk

@rust-highfive rust-highfive assigned oli-obk and unassigned eddyb Dec 28, 2020
@bors
Copy link
Collaborator

bors commented Dec 28, 2020

⌛ Testing commit 119879c with merge 76aca66...

@bors
Copy link
Collaborator

bors commented Dec 28, 2020

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 28, 2020
@bors bors merged commit 76aca66 into rust-lang:master Dec 28, 2020
@rustbot rustbot added this to the 1.51.0 milestone Dec 28, 2020
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.