<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_codegen_llvm/src/builder, branch 1.89.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.89.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.89.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-06-16T21:23:06+00:00</updated>
<entry>
<title>add and use generic get_const_int function</title>
<updated>2025-06-16T21:23:06+00:00</updated>
<author>
<name>Manuel Drehwald</name>
<email>git@manuel.drehwald.info</email>
</author>
<published>2025-06-16T21:23:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6359123d25e8ff38c6fbf280559d5f829bec691f'/>
<id>urn:sha1:6359123d25e8ff38c6fbf280559d5f829bec691f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>add custom enzyme markers to target methods</title>
<updated>2025-04-25T05:39:52+00:00</updated>
<author>
<name>bit-aloo</name>
<email>sshourya17@gmail.com</email>
</author>
<published>2025-04-20T10:18:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9bc04016e6dffd6398ea62f05b9320e0198ab0be'/>
<id>urn:sha1:9bc04016e6dffd6398ea62f05b9320e0198ab0be</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #139700 - EnzymeAD:autodiff-flags, r=oli-obk</title>
<updated>2025-04-24T15:19:44+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-04-24T15:19:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c3f811f02ff3fe52d7ceaa7aa15f44059221a48d'/>
<id>urn:sha1:c3f811f02ff3fe52d7ceaa7aa15f44059221a48d</id>
<content type='text'>
Autodiff flags

Interestingly, it seems that some other projects have conflicts with exactly the same LLVM optimization passes as autodiff.
At least `LLVMRustOptimize` has exactly the flags that we need to disable problematic opt passes.

This PR enables us to compile code where users differentiate two identical functions in the same module. This has been especially common in test cases, but it's not impossible to encounter in the wild.

It also enables two new flags for testing/debugging. I consider writing an MCP to upgrade PrintPasses to be a standalone -Z flag, since it is *not* the same as `-Z print-llvm-passes`, which IMHO gives less useful output. A discussion can be found here: [#t-compiler/llvm &gt; Print llvm passes. @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/187780-t-compiler.2Fllvm/topic/Print.20llvm.20passes.2E/near/511533038)

Finally, it improves `PrintModBefore` and `PrintModAfter`. They used to work reliable, but now we just schedule enzyme as part of an existing ModulePassManager (MPM). Since Enzyme is last in the MPM scheduling, PrintModBefore became very inaccurate. It used to print the input module, which we gave to the Enzyme and was great to create llvm-ir reproducer. However, lately the MPM would run the whole `default&lt;O3&gt;` pipeline, which heavily modifies the llvm module, before we pass it to Enzyme. That made it impossible to use the flag to create llvm-ir reproducers for Enzyme bugs. We now schedule a PrintModule pass just before Enzyme, solving this problem.

Based on the PrintPass output, it also _seems_ like changing `registerEnzymeAndPassPipeline(PB, true);` to `registerEnzymeAndPassPipeline(PB, false);` has no effect. In theory, the bool should tell Enzyme to schedule some helpful passes in the PassBuilder. However, since it doesn't do anything and I'm not 100% sure anymore on whether we really need it, I'll just disable it for now and postpone investigations.

r? ``@oli-obk``

closes #139471

Tracking:

- https://github.com/rust-lang/rust/issues/124509
</content>
</entry>
<entry>
<title>working dupv and dupvonly for fwd mode</title>
<updated>2025-04-16T21:13:31+00:00</updated>
<author>
<name>Manuel Drehwald</name>
<email>git@manuel.drehwald.info</email>
</author>
<published>2025-04-05T07:10:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a68ae0cbc1d923b69ef690f32b651ecf583ff27f'/>
<id>urn:sha1:a68ae0cbc1d923b69ef690f32b651ecf583ff27f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>update documentation</title>
<updated>2025-04-12T05:36:47+00:00</updated>
<author>
<name>Manuel Drehwald</name>
<email>git@manuel.drehwald.info</email>
</author>
<published>2025-04-12T05:09:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5ea9125f378a14fac8c60fe2f0e0993e7af2284b'/>
<id>urn:sha1:5ea9125f378a14fac8c60fe2f0e0993e7af2284b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>handle sret for scalar autodiff</title>
<updated>2025-04-07T11:07:16+00:00</updated>
<author>
<name>Manuel Drehwald</name>
<email>git@manuel.drehwald.info</email>
</author>
<published>2025-04-07T11:07:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d6467d34ae4057f493e2706a5625e0784f2a68bf'/>
<id>urn:sha1:d6467d34ae4057f493e2706a5625e0784f2a68bf</id>
<content type='text'>
</content>
</entry>
<entry>
<title>add autodiff batching backend</title>
<updated>2025-04-04T18:24:23+00:00</updated>
<author>
<name>Manuel Drehwald</name>
<email>git@manuel.drehwald.info</email>
</author>
<published>2025-04-04T18:24:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b7c63a973fdfa317a01b9d676803c59edc31abdc'/>
<id>urn:sha1:b7c63a973fdfa317a01b9d676803c59edc31abdc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[NFC] simplify matching</title>
<updated>2025-03-17T23:13:09+00:00</updated>
<author>
<name>Manuel Drehwald</name>
<email>git@manuel.drehwald.info</email>
</author>
<published>2025-03-17T23:13:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=47c07ed9637bb59bb37d7b541ff3ed11d158a9ee'/>
<id>urn:sha1:47c07ed9637bb59bb37d7b541ff3ed11d158a9ee</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[NFC] extract autodiff call lowering in cg_llvm into own function</title>
<updated>2025-03-17T22:58:51+00:00</updated>
<author>
<name>Manuel Drehwald</name>
<email>git@manuel.drehwald.info</email>
</author>
<published>2025-03-17T22:58:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f4c297802ff34cd6a36d077c1271041fc0501cb7'/>
<id>urn:sha1:f4c297802ff34cd6a36d077c1271041fc0501cb7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove inherent function that has a trait method duplicate of a commonly imported trait</title>
<updated>2025-02-24T15:11:29+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>github333195615777966@oli-obk.de</email>
</author>
<published>2025-02-24T14:33:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f16f64b15a51789984d9014e92e86fb3a2fe8ce0'/>
<id>urn:sha1:f16f64b15a51789984d9014e92e86fb3a2fe8ce0</id>
<content type='text'>
</content>
</entry>
</feed>
