Fix typetree generation for differentiated functions#158333
Merged
Merged
Conversation
Collaborator
|
r? @mu001999 rustbot has assigned @mu001999. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Member
Author
|
r? oli-obk |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Member
Author
|
Doesn't look like Github CI will merge the previous PR anytime soon, so I'll add a few more features here in the meantime. |
This comment has been minimized.
This comment has been minimized.
3227538 to
64d9d50
Compare
This comment has been minimized.
This comment has been minimized.
64d9d50 to
75c0091
Compare
oli-obk
reviewed
Jul 6, 2026
oli-obk
reviewed
Jul 6, 2026
oli-obk
reviewed
Jul 6, 2026
| bug!("incorrect autodiff typetree handling for slice: {}", ty); | ||
| } | ||
|
|
||
| if ty.is_ref() || ty.is_raw_ptr() || ty.is_box() { |
Contributor
There was a problem hiding this comment.
I think you should really turn all those if ty.thing()s into one big match on the ty.kind().
oli-obk
requested changes
Jul 6, 2026
75c0091 to
b079a9d
Compare
…r generation for memcpy. This moves a TA failure in the testcase from memcpy to a later location.
b079a9d to
6bb1c07
Compare
Collaborator
|
This PR was rebased onto a different main 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. |
oli-obk
approved these changes
Jul 7, 2026
Contributor
m-ou-se
added a commit
to m-ou-se/rust
that referenced
this pull request
Jul 7, 2026
…i-obk Fix typetree generation for differentiated functions Further improvements after rust-lang#158278 This fixes a test failure on main (encountered while working on the PR above) in `tests/codegen-llvm/autodiff/autodiffv2.rs`. Further improvements are split out into rust-lang#158440, with high-level docs available in rust-lang/rustc-dev-guide#2911 Also noticed that I can (probably?) remove the llvm_enzyme cfg at this point, rust-lang#158460
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 7, 2026
Rollup of 8 pull requests Successful merges: - #156968 (diagnostics: suggest generic_const_args for const ops) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158690 (delegation: support mapping of all arguments with `Self` type) - #158696 (Rename some `body_id` to `body_def_id`) - #158333 (Fix typetree generation for differentiated functions) - #158646 (powerpc64le_unknown_freebsd.rs: link with -lgcc) - #158802 (Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts) - #158905 (delegation: add constraints to new generic args)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jul 7, 2026
…i-obk Fix typetree generation for differentiated functions Further improvements after rust-lang#158278 This fixes a test failure on main (encountered while working on the PR above) in `tests/codegen-llvm/autodiff/autodiffv2.rs`. Further improvements are split out into rust-lang#158440, with high-level docs available in rust-lang/rustc-dev-guide#2911 Also noticed that I can (probably?) remove the llvm_enzyme cfg at this point, rust-lang#158460
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jul 7, 2026
…i-obk Fix typetree generation for differentiated functions Further improvements after rust-lang#158278 This fixes a test failure on main (encountered while working on the PR above) in `tests/codegen-llvm/autodiff/autodiffv2.rs`. Further improvements are split out into rust-lang#158440, with high-level docs available in rust-lang/rustc-dev-guide#2911 Also noticed that I can (probably?) remove the llvm_enzyme cfg at this point, rust-lang#158460
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 7, 2026
…uwer Rollup of 11 pull requests Successful merges: - #158179 (std: unconditionally use `preadv`/`pwritev` on AArch64 macOS) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158621 (disallow `extern "custom"` on wasm and spirv targets) - #158690 (delegation: support mapping of all arguments with `Self` type) - #158696 (Rename some `body_id` to `body_def_id`) - #158333 (Fix typetree generation for differentiated functions) - #158646 (powerpc64le_unknown_freebsd.rs: link with -lgcc) - #158791 (Avoid unused braces lint for macro generated arguments) - #158802 (Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts) - #158889 (tests: catch up with LLVM returning f128 on the stack) - #158905 (delegation: add constraints to new generic args)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jul 7, 2026
…i-obk Fix typetree generation for differentiated functions Further improvements after rust-lang#158278 This fixes a test failure on main (encountered while working on the PR above) in `tests/codegen-llvm/autodiff/autodiffv2.rs`. Further improvements are split out into rust-lang#158440, with high-level docs available in rust-lang/rustc-dev-guide#2911 Also noticed that I can (probably?) remove the llvm_enzyme cfg at this point, rust-lang#158460
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 7, 2026
…uwer Rollup of 18 pull requests Successful merges: - #157385 (Enable Enzyme on x86_64-apple) - #157561 (rustdoc: do not include extra stuff in span) - #158179 (std: unconditionally use `preadv`/`pwritev` on AArch64 macOS) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158621 (disallow `extern "custom"` on wasm and spirv targets) - #158690 (delegation: support mapping of all arguments with `Self` type) - #158696 (Rename some `body_id` to `body_def_id`) - #158697 (Fixes for QNX SDP 8) - #158760 (Clarify that `LocalKey::try_with` may return `AccessError`) - #157801 (Rewrite safety requirements for `Allocator` impls) - #158333 (Fix typetree generation for differentiated functions) - #158646 (powerpc64le_unknown_freebsd.rs: link with -lgcc) - #158701 ( diagnostics: suggest type annotation for closure params on HRTB FnOnce mismatch) - #158791 (Avoid unused braces lint for macro generated arguments) - #158802 (Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts) - #158841 (Avoid final override ICE for RPITIT associated types) - #158889 (tests: catch up with LLVM returning f128 on the stack) - #158905 (delegation: add constraints to new generic args)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 7, 2026
…uwer Rollup of 19 pull requests Successful merges: - #156016 (view-types: store view types in the AST) - #157385 (Enable Enzyme on x86_64-apple) - #158179 (std: unconditionally use `preadv`/`pwritev` on AArch64 macOS) - #158621 (disallow `extern "custom"` on wasm and spirv targets) - #158690 (delegation: support mapping of all arguments with `Self` type) - #158696 (Rename some `body_id` to `body_def_id`) - #158697 (Fixes for QNX SDP 8) - #158760 (Clarify that `LocalKey::try_with` may return `AccessError`) - #157801 (Rewrite safety requirements for `Allocator` impls) - #158085 (rustdoc: Fix sidebar heading order) - #158333 (Fix typetree generation for differentiated functions) - #158646 (powerpc64le_unknown_freebsd.rs: link with -lgcc) - #158701 ( diagnostics: suggest type annotation for closure params on HRTB FnOnce mismatch) - #158791 (Avoid unused braces lint for macro generated arguments) - #158802 (Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts) - #158841 (Avoid final override ICE for RPITIT associated types) - #158889 (tests: catch up with LLVM returning f128 on the stack) - #158905 (delegation: add constraints to new generic args) - #158922 (tests: clean up over-constraint on LLVM feature count) Failed merges: - #158617 (allow mGCA const arguments to fall back to anon consts)
rust-timer
added a commit
that referenced
this pull request
Jul 8, 2026
Rollup merge of #158333 - ZuseZ4:typetrees-for-enzyme3, r=oli-obk Fix typetree generation for differentiated functions Further improvements after #158278 This fixes a test failure on main (encountered while working on the PR above) in `tests/codegen-llvm/autodiff/autodiffv2.rs`. Further improvements are split out into #158440, with high-level docs available in rust-lang/rustc-dev-guide#2911 Also noticed that I can (probably?) remove the llvm_enzyme cfg at this point, #158460
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.
Further improvements after #158278
This fixes a test failure on main (encountered while working on the PR above) in
tests/codegen-llvm/autodiff/autodiffv2.rs.Further improvements are split out into #158440, with high-level docs available in rust-lang/rustc-dev-guide#2911
Also noticed that I can (probably?) remove the llvm_enzyme cfg at this point, #158460