Skip to content

Fix typetree generation for differentiated functions#158333

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
ZuseZ4:typetrees-for-enzyme3
Jul 8, 2026
Merged

Fix typetree generation for differentiated functions#158333
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
ZuseZ4:typetrees-for-enzyme3

Conversation

@ZuseZ4

@ZuseZ4 ZuseZ4 commented Jun 23, 2026

Copy link
Copy Markdown
Member

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

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. F-autodiff `#![feature(autodiff)]` 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 Jun 23, 2026
@rustbot

rustbot commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

r? @mu001999

rustbot has assigned @mu001999.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler, types
  • compiler, types expanded to 73 candidates
  • Random selection from 20 candidates

@ZuseZ4

ZuseZ4 commented Jun 23, 2026

Copy link
Copy Markdown
Member Author

r? oli-obk

@rustbot rustbot assigned oli-obk and unassigned mu001999 Jun 23, 2026
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@ZuseZ4

ZuseZ4 commented Jun 25, 2026

Copy link
Copy Markdown
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.

@ZuseZ4 ZuseZ4 marked this pull request as draft June 25, 2026 00:15
@rustbot rustbot 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 Jun 25, 2026
@rust-bors

This comment has been minimized.

@ZuseZ4 ZuseZ4 force-pushed the typetrees-for-enzyme3 branch 2 times, most recently from 3227538 to 64d9d50 Compare June 26, 2026 10:59
@rust-log-analyzer

This comment has been minimized.

@ZuseZ4 ZuseZ4 force-pushed the typetrees-for-enzyme3 branch from 64d9d50 to 75c0091 Compare June 30, 2026 02:32
@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Jun 30, 2026
@ZuseZ4 ZuseZ4 marked this pull request as ready for review June 30, 2026 02:36
@rustbot rustbot 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 Jun 30, 2026
Comment thread compiler/rustc_codegen_llvm/src/builder/autodiff.rs Outdated
Comment thread compiler/rustc_codegen_llvm/src/builder/autodiff.rs Outdated
bug!("incorrect autodiff typetree handling for slice: {}", ty);
}

if ty.is_ref() || ty.is_raw_ptr() || ty.is_box() {

@oli-obk oli-obk Jul 6, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you should really turn all those if ty.thing()s into one big match on the ty.kind().

View changes since the review

@rustbot rustbot 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 Jul 6, 2026
@ZuseZ4 ZuseZ4 force-pushed the typetrees-for-enzyme3 branch from 75c0091 to b079a9d Compare July 6, 2026 18:34
ZuseZ4 added 2 commits July 6, 2026 23:10
…r generation for memcpy.

This moves a TA failure in the testcase from memcpy to a later location.
@ZuseZ4 ZuseZ4 force-pushed the typetrees-for-enzyme3 branch from b079a9d to 6bb1c07 Compare July 6, 2026 22:36
@rustbot

rustbot commented Jul 6, 2026

Copy link
Copy Markdown
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.

@ZuseZ4 ZuseZ4 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 Jul 6, 2026

@oli-obk oli-obk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@rust-bors

rust-bors Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 6bb1c07 has been approved by oli-obk

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Jul 7, 2026
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-bors rust-bors Bot merged commit 820771b into rust-lang:main Jul 8, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 8, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs F-autodiff `#![feature(autodiff)]` 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.

5 participants