Use globals instead of metadata for std::autodiff#147390
Merged
bors merged 3 commits intorust-lang:masterfrom Oct 8, 2025
Merged
Use globals instead of metadata for std::autodiff#147390bors merged 3 commits intorust-lang:masterfrom
bors merged 3 commits intorust-lang:masterfrom
Conversation
Collaborator
|
r? @nnethercote rustbot has assigned @nnethercote. Use |
Member
Author
|
r? @jieyouxu since you already reviewed my last two test PRs I might as well directly assign you ^^ Thanks! (and please reroll if you're too busy!) |
Collaborator
|
|
Member
|
You can r=me once tidy is green |
Member
Author
|
@bors r=jieyouxu rollup |
Collaborator
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Oct 7, 2025
Use globals instead of metadata for std::autodiff LLVM's Metadata is quite fragile. In debug builds we use incremental compilation, which caused the metadata to be dropped. With this change we use named globals instead of metadata to instruct Enzyme how to differentiate functions. Globals are proper llvm values and thus can't be dropped. Also added an incremental/dbg test which now passes, to unblock the EnzymeAD CI which wants to run Rust autodiff tests. r? compiler
bors
added a commit
that referenced
this pull request
Oct 7, 2025
Rollup of 7 pull requests Successful merges: - #143900 ([rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition) - #145608 (Prevent downstream `impl DerefMut for Pin<LocalType>`) - #146865 (kcfi: only reify trait methods when dyn-compatible) - #147390 (Use globals instead of metadata for std::autodiff) - #147398 (Fix; correct placement of type inference error for method calls) - #147431 (compiletest: Read the whole test file before parsing directives) - #147433 (Fix doc comment) r? `@ghost` `@rustbot` modify labels: rollup
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Oct 7, 2025
Use globals instead of metadata for std::autodiff LLVM's Metadata is quite fragile. In debug builds we use incremental compilation, which caused the metadata to be dropped. With this change we use named globals instead of metadata to instruct Enzyme how to differentiate functions. Globals are proper llvm values and thus can't be dropped. Also added an incremental/dbg test which now passes, to unblock the EnzymeAD CI which wants to run Rust autodiff tests. r? compiler
bors
added a commit
that referenced
this pull request
Oct 7, 2025
Rollup of 8 pull requests Successful merges: - #145608 (Prevent downstream `impl DerefMut for Pin<LocalType>`) - #146865 (kcfi: only reify trait methods when dyn-compatible) - #147205 (Add a new `wasm32-wasip3` target to Rust) - #147390 (Use globals instead of metadata for std::autodiff) - #147398 (Fix; correct placement of type inference error for method calls) - #147422 (collect-license-metadata: Print a diff of the expected output) - #147431 (compiletest: Read the whole test file before parsing directives) - #147433 (Fix doc comment) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
that referenced
this pull request
Oct 7, 2025
Rollup of 8 pull requests Successful merges: - #145608 (Prevent downstream `impl DerefMut for Pin<LocalType>`) - #146865 (kcfi: only reify trait methods when dyn-compatible) - #147205 (Add a new `wasm32-wasip3` target to Rust) - #147390 (Use globals instead of metadata for std::autodiff) - #147398 (Fix; correct placement of type inference error for method calls) - #147422 (collect-license-metadata: Print a diff of the expected output) - #147431 (compiletest: Read the whole test file before parsing directives) - #147433 (Fix doc comment) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
that referenced
this pull request
Oct 7, 2025
Rollup of 8 pull requests Successful merges: - #146865 (kcfi: only reify trait methods when dyn-compatible) - #147205 (Add a new `wasm32-wasip3` target to Rust) - #147322 (cg_llvm: Consistently import `llvm::Type` and `llvm::Value`) - #147398 (Fix; correct placement of type inference error for method calls) - #147410 (Update `S-waiting-on-team` refs to new `S-waiting-on-{team}` labels) - #147422 (collect-license-metadata: Print a diff of the expected output) - #147431 (compiletest: Read the whole test file before parsing directives) - #147433 (Fix doc comment) Failed merges: - #147390 (Use globals instead of metadata for std::autodiff) r? `@ghost` `@rustbot` modify labels: rollup
3e5fb1f to
1f3517b
Compare
Collaborator
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
Member
Author
|
@bors r=jieyouxu |
Collaborator
bors
added a commit
that referenced
this pull request
Oct 8, 2025
Rollup of 5 pull requests Successful merges: - #146385 (rustdoc-search: redesign throbber to be less distracting) - #147390 (Use globals instead of metadata for std::autodiff) - #147445 (sort attribute targets for more consistent error messages) - #147448 (collect-license-metadata: update submodules before running) - #147451 (fix panic with extra-const-ub-checks) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
that referenced
this pull request
Oct 8, 2025
Rollup merge of #147390 - ZuseZ4:autodiff-dbg, r=jieyouxu Use globals instead of metadata for std::autodiff LLVM's Metadata is quite fragile. In debug builds we use incremental compilation, which caused the metadata to be dropped. With this change we use named globals instead of metadata to instruct Enzyme how to differentiate functions. Globals are proper llvm values and thus can't be dropped. Also added an incremental/dbg test which now passes, to unblock the EnzymeAD CI which wants to run Rust autodiff tests. r? compiler
github-actions bot
pushed a commit
to model-checking/verify-rust-std
that referenced
this pull request
Oct 9, 2025
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#146865 (kcfi: only reify trait methods when dyn-compatible) - rust-lang#147205 (Add a new `wasm32-wasip3` target to Rust) - rust-lang#147322 (cg_llvm: Consistently import `llvm::Type` and `llvm::Value`) - rust-lang#147398 (Fix; correct placement of type inference error for method calls) - rust-lang#147410 (Update `S-waiting-on-team` refs to new `S-waiting-on-{team}` labels) - rust-lang#147422 (collect-license-metadata: Print a diff of the expected output) - rust-lang#147431 (compiletest: Read the whole test file before parsing directives) - rust-lang#147433 (Fix doc comment) Failed merges: - rust-lang#147390 (Use globals instead of metadata for std::autodiff) r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLVM's Metadata is quite fragile. In debug builds we use incremental compilation, which caused the metadata to be dropped. With this change we use named globals instead of metadata to instruct Enzyme how to differentiate functions.
Globals are proper llvm values and thus can't be dropped. Also added an incremental/dbg test which now passes, to unblock the EnzymeAD CI which wants to run Rust autodiff tests.
r? compiler