Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c58c06a
Return blocks from DropTree::build_mir
bjorn3 Mar 11, 2025
8dc0c0e
Simplify lit_to_mir_constant a bit
bjorn3 Mar 12, 2025
bdaf23b
Forward `stream_position` in `Arc<File>` as well
tbu- Mar 14, 2025
eca391f
Cleanup `LangString::parse`
yotamofek Mar 15, 2025
03ece26
update tests
ZuseZ4 Mar 17, 2025
f5c37c3
[NFC] split up gen_body_helper
ZuseZ4 Mar 17, 2025
f9d0a14
resolve repeated attribute fixme
ZuseZ4 Mar 17, 2025
5f7ff88
[NFC] use outer_normal_attr helper
ZuseZ4 Mar 17, 2025
f4c2978
[NFC] extract autodiff call lowering in cg_llvm into own function
ZuseZ4 Mar 17, 2025
47c07ed
[NFC] simplify matching
ZuseZ4 Mar 17, 2025
69a3ad0
Add `MutMirVisitor`
makai410 Mar 18, 2025
ad315f6
Add test for `MutMirVisitor`
makai410 Mar 18, 2025
81b2d55
addressing feedback, removing unused arg
ZuseZ4 Mar 18, 2025
68267d0
Fix build failure on Trusty
taiki-e Mar 18, 2025
485c14f
Make `crate_hash` not iterate over `hir_crate` owners anymore
oli-obk Mar 19, 2025
a0918b7
jsondocck: Replace `jsonpath_lib` with `jsonpath-rust`
aDotInTheVoid Mar 20, 2025
7ab71c4
tests/rustdoc-json: replace `$.index[*][?` with `$.index[?`
aDotInTheVoid Mar 20, 2025
42631d8
tests/rustdoc-json: replace `$.paths[*][?` with `$.paths[?`
aDotInTheVoid Mar 20, 2025
13335e3
tests/rustdoc-json: change assertions to use RFC 9535 jsonpath
aDotInTheVoid Mar 21, 2025
9a39bef
Rollup merge of #138410 - bjorn3:misc_cleanups, r=compiler-errors
matthiaskrgr Mar 21, 2025
b8e6a48
Rollup merge of #138490 - tbu-:pr_arc_file_pos, r=Noratrieb
matthiaskrgr Mar 21, 2025
02d2623
Rollup merge of #138535 - yotamofek:pr/rustdoc/lang-string-parse-clea…
matthiaskrgr Mar 21, 2025
3f6d0d3
Rollup merge of #138536 - makai410:mut-mir-visitor, r=celinval
matthiaskrgr Mar 21, 2025
89d93f7
Rollup merge of #138627 - EnzymeAD:autodiff-cleanups, r=oli-obk
matthiaskrgr Mar 21, 2025
a184641
Rollup merge of #138673 - taiki-e:trusty-fix, r=Noratrieb
matthiaskrgr Mar 21, 2025
de6f67c
Rollup merge of #138750 - oli-obk:decouple-hir-queries, r=fee1-dead
matthiaskrgr Mar 21, 2025
51ccfa2
Rollup merge of #138763 - aDotInTheVoid:two-years-later, r=GuillaumeG…
matthiaskrgr Mar 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
addressing feedback, removing unused arg
  • Loading branch information
ZuseZ4 committed Mar 18, 2025
commit 81b2d5508eb4e79af7ba4bd32486099eeaabc834
25 changes: 5 additions & 20 deletions compiler/rustc_builtin_macros/src/autodiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,20 +233,8 @@ mod llvm_enzyme {
.filter(|a| **a == DiffActivity::Active || **a == DiffActivity::ActiveOnly)
.count() as u32;
let (d_sig, new_args, idents, errored) = gen_enzyme_decl(ecx, &sig, &x, span);
let new_decl_span = d_sig.span;
let d_body = gen_enzyme_body(
ecx,
&x,
n_active,
&sig,
&d_sig,
primal,
&new_args,
span,
sig_span,
new_decl_span,
idents,
errored,
ecx, &x, n_active, &sig, &d_sig, primal, &new_args, span, sig_span, idents, errored,
);
let d_ident = first_ident(&meta_item_vec[0]);

Expand Down Expand Up @@ -440,12 +428,10 @@ mod llvm_enzyme {

/// We only want this function to type-check, since we will replace the body
/// later on llvm level. Using `loop {}` does not cover all return types anymore,
/// so instead we build something that should pass. We also add a inline_asm
/// line, as one more barrier for rustc to prevent inlining of this function.
/// FIXME(ZuseZ4): We still have cases of incorrect inlining across modules, see
/// <https://github.com/EnzymeAD/rust/issues/173>, so this isn't sufficient.
/// It also triggers an Enzyme crash if we due to a bug ever try to differentiate
/// this function (which should never happen, since it is only a placeholder).
/// so instead we manually build something that should pass the type checker.
/// We also add a inline_asm line, as one more barrier for rustc to prevent inlining
/// or const propagation. inline_asm will also triggers an Enzyme crash if due to another
/// bug would ever try to accidentially differentiate this placeholder function body.
/// Finally, we also add back_box usages of all input arguments, to prevent rustc
/// from optimizing any arguments away.
fn gen_enzyme_body(
Expand All @@ -458,7 +444,6 @@ mod llvm_enzyme {
new_names: &[String],
span: Span,
sig_span: Span,
_new_decl_span: Span,
idents: Vec<Ident>,
errored: bool,
) -> P<ast::Block> {
Expand Down
Loading