Skip to content

Fix LLVM IR expectations for the autodiff abi_handling tests#156777

Open
sgasho wants to merge 1 commit into
rust-lang:mainfrom
sgasho:test-fix-codegen-llvm-autodiff-2
Open

Fix LLVM IR expectations for the autodiff abi_handling tests#156777
sgasho wants to merge 1 commit into
rust-lang:mainfrom
sgasho:test-fix-codegen-llvm-autodiff-2

Conversation

@sgasho

@sgasho sgasho commented May 20, 2026

Copy link
Copy Markdown
Contributor

We had two stale expectations in the LLVM IR checks.

  • L61: noundef is no longer emitted
  • L80: return type has changed

Also, I made all noundef checks optional for test robustness. I thought noundef is less important than types and args for this test.

r? @ZuseZ4

@rustbot rustbot added 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 May 20, 2026
@rust-cloud-vms rust-cloud-vms Bot force-pushed the test-fix-codegen-llvm-autodiff-2 branch from 64371d7 to 0da69f6 Compare June 12, 2026 14:47
@sgasho

sgasho commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

I tested this PR still works after enzyme submodule update: #157716

@ZuseZ4

ZuseZ4 commented Jun 15, 2026

Copy link
Copy Markdown
Member

I think I've seen some of these changes before, so my concern is that either we continue to make the tests increasingly weaker, or we'll keep swapping back and forth between different outputs.
In the past, I added the noPostOpt flag, which made it a little better, but since the output still changed, we should find a more robust solution before putting it in CI.
Can you have a look at the -C passes=val -- a list of extra LLVM passes to run (space separated) flag, as well as some of the enzyme tests which run extra opts after enzyme?
https://github.com/EnzymeAD/Enzyme/blob/c96508349d9f121957292308c646b4a1fd53c507/enzyme/test/Enzyme/ReverseMode/add.ll#L2

We probably want to remove -Zautodiff=NoPostopt and replace it with -Zautodiff=Passes=... or something like that.
There is a -Zoffload=Host=path flag, which is also nested as an example.
The idea is that not setting the flag would result in the current behavior (full O3 after Enzyme), setting it to "" would be equal to the current NoPostOpt flag (which can then be removed) and by setting anything else we can specify the actual passes to run, similar to Enzyme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants