rust/compiler
Jacob Pratt c19c4b91f5
Rollup merge of #133429 - EnzymeAD:autodiff-middle, r=oli-obk
Autodiff Upstreaming - rustc_codegen_ssa, rustc_middle

This PR should not be merged until the rustc_codegen_llvm part is merged.
I will also alter it a little based on what get's shaved off from the cg_llvm PR,
and address some of the feedback I received in the other PR (including cleanups).

I am putting it already up to
1) Discuss with `@jieyouxu` if there is more work needed to add tests to this and
2) Pray that there is someone reviewing who can tell me why some of my autodiff invocations get lost.

Re 1: My test require fat-lto. I also modify the compilation pipeline. So if there are any other llvm-ir tests in the same compilation unit then I will likely break them. Luckily there are two groups who currently have the same fat-lto requirement for their GPU code which I have for my autodiff code and both groups have some plans to enable support for thin-lto. Once either that work pans out, I'll copy it over for this feature. I will also work on not changing the optimization pipeline for functions not differentiated, but that will require some thoughts and engineering, so I think it would be good to be able to run the autodiff tests isolated from the rest for now. Can you guide me here please?
For context, here are some of my tests in the samples folder: https://github.com/EnzymeAD/rustbook

Re 2: This is a pretty serious issue, since it effectively prevents publishing libraries making use of autodiff: https://github.com/EnzymeAD/rust/issues/173. For some reason my dummy code persists till the end, so the code which calls autodiff, deletes the dummy, and inserts the code to compute the derivative never gets executed. To me it looks like the rustc_autodiff attribute just get's dropped, but I don't know WHY? Any help would be super appreciated, as rustc queries look a bit voodoo to me.

Tracking:

- https://github.com/rust-lang/rust/issues/124509

r? `@jieyouxu`
2025-01-31 00:26:30 -05:00
..
rustc switch jemalloc-sys back to tikv-jemalloc-sys, and update to 0.6.0 2024-12-03 08:56:33 +00:00
rustc_abi Auto merge of #135047 - Flakebi:amdgpu-kernel-cc, r=workingjubilee 2025-01-17 04:36:09 +00:00
rustc_arena Add inherent versions of MaybeUninit methods for slices 2025-01-11 23:57:00 -05:00
rustc_ast Rollup merge of #133429 - EnzymeAD:autodiff-middle, r=oli-obk 2025-01-31 00:26:30 -05:00
rustc_ast_ir Add sugar for &pin (const|mut) types 2024-10-07 11:15:04 -07:00
rustc_ast_lowering Eliminate PatKind::Path 2025-01-29 15:45:13 +00:00
rustc_ast_passes Refactor FnKind variant to hold &Fn 2025-01-28 11:22:25 -08:00
rustc_ast_pretty Refactor FnKind variant to hold &Fn 2025-01-28 11:22:25 -08:00
rustc_attr_data_structures Rename OptimizeAttr::None to Default 2025-01-24 19:34:01 +00:00
rustc_attr_parsing Run clippy --fix for unnecessary_map_or lint 2025-01-19 19:15:00 +00:00
rustc_baked_icu_data Delete the cfg(not(parallel)) serial compiler 2024-11-12 13:38:58 +00:00
rustc_borrowck Auto merge of #136038 - compiler-errors:outlives, r=lcnr 2025-01-30 11:40:32 +00:00
rustc_builtin_macros Rollup merge of #135882 - hkBst:master, r=estebank 2025-01-30 12:45:27 +01:00
rustc_codegen_cranelift introduce ty::Value 2025-01-30 17:47:44 +01:00
rustc_codegen_gcc ABI-required target features: warn when they are missing in base CPU (rather than silently enabling them) 2025-01-28 04:40:42 +01:00
rustc_codegen_llvm Rollup merge of #133429 - EnzymeAD:autodiff-middle, r=oli-obk 2025-01-31 00:26:30 -05:00
rustc_codegen_ssa Rollup merge of #133429 - EnzymeAD:autodiff-middle, r=oli-obk 2025-01-31 00:26:30 -05:00
rustc_const_eval add comments 2025-01-30 18:13:16 +01:00
rustc_data_structures Rollup merge of #136149 - cuviper:rustc-rayon-indexmap, r=compiler-errors 2025-01-28 18:17:29 +01:00
rustc_driver
rustc_driver_impl Make crate AST mutation accessible for driver callback 2025-01-28 19:45:20 +00:00
rustc_error_codes Auto merge of #133154 - estebank:issue-133137, r=wesleywiser 2025-01-25 11:41:21 +00:00
rustc_error_messages Convert some Into impls into From impls 2024-12-31 01:56:33 +00:00
rustc_errors Auto merge of #119286 - jyn514:linker-output, r=bjorn3 2025-01-25 17:16:33 +00:00
rustc_expand Auto merge of #134478 - compiler-errors:attr-span, r=oli-obk 2025-01-22 14:46:41 +00:00
rustc_feature Rollup merge of #134300 - RalfJung:remove-dead-attrs, r=chenyukang 2025-01-25 23:15:22 +01:00
rustc_fluent_macro use tracked_path in rustc_fluent_macro 2024-10-19 22:32:38 +08:00
rustc_fs_util Couple of changes to make it easier to compile rustc for wasm 2024-09-26 19:51:14 +00:00
rustc_graphviz Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
rustc_hir Eliminate PatKind::Path 2025-01-29 15:45:13 +00:00
rustc_hir_analysis review comment: change span argument 2025-01-30 18:38:42 +00:00
rustc_hir_pretty Eliminate PatKind::Path 2025-01-29 15:45:13 +00:00
rustc_hir_typeck Rollup merge of #132156 - estebank:closure-return, r=Nadrieril,compiler-errors 2025-01-31 00:26:29 -05:00
rustc_incremental turn hir::ItemKind::Fn into a named-field variant 2025-01-04 11:35:31 +01:00
rustc_index Run clippy --fix for unnecessary_map_or lint 2025-01-19 19:15:00 +00:00
rustc_index_macros update rustc_index_macros feature handling 2024-12-19 20:32:12 +03:00
rustc_infer introduce ty::Value 2025-01-30 17:47:44 +01:00
rustc_interface Rollup merge of #133429 - EnzymeAD:autodiff-middle, r=oli-obk 2025-01-31 00:26:30 -05:00
rustc_lexer Add test to check unicode identifier version 2024-12-09 06:23:59 -08:00
rustc_lint Auto merge of #136038 - compiler-errors:outlives, r=lcnr 2025-01-30 11:40:32 +00:00
rustc_lint_defs Downgrade linker-warnings to allow-by-default 2025-01-26 22:57:20 -05:00
rustc_llvm upstream rustc_codegen_ssa/rustc_middle changes for enzyme/autodiff 2025-01-29 21:31:13 -05:00
rustc_log Avoid naming variables str 2025-01-07 14:30:02 +02:00
rustc_macros Avoid naming variables str 2025-01-07 14:30:02 +02:00
rustc_metadata Make item self/non-self bound naming less whack 2025-01-28 19:08:50 +00:00
rustc_middle Rollup merge of #133429 - EnzymeAD:autodiff-middle, r=oli-obk 2025-01-31 00:26:30 -05:00
rustc_mir_build add comments 2025-01-30 18:13:16 +01:00
rustc_mir_dataflow Represent the raw pointer for a array length check as a new kind of fake borrow 2025-01-28 00:00:33 +00:00
rustc_mir_transform Rollup merge of #135748 - compiler-errors:len-2, r=RalfJung,oli-obk 2025-01-28 14:23:22 +01:00
rustc_monomorphize Rollup merge of #133429 - EnzymeAD:autodiff-middle, r=oli-obk 2025-01-31 00:26:30 -05:00
rustc_next_trait_solver introduce ty::Value 2025-01-30 17:47:44 +01:00
rustc_parse Rollup merge of #135882 - hkBst:master, r=estebank 2025-01-30 12:45:27 +01:00
rustc_parse_format use impl Into<String> 2025-01-29 09:48:08 +01:00
rustc_passes review comment: change span argument 2025-01-30 18:38:42 +00:00
rustc_pattern_analysis Get rid of mir::Const::from_ty_const 2025-01-20 04:26:44 +00:00
rustc_privacy Split hir TyKind and ConstArgKind in two and update hir::Visitor 2025-01-23 06:01:36 +00:00
rustc_query_impl don't return an Option from try_find_dep_kind 2025-01-07 21:57:00 +01:00
rustc_query_system Properly note when query stack is being cut off 2025-01-16 19:12:22 +00:00
rustc_resolve Refactor FnKind variant to hold &Fn 2025-01-28 11:22:25 -08:00
rustc_sanitizers check the types in ty::Value to value conversion 2025-01-30 18:13:16 +01:00
rustc_serialize Fix explicit_iter_loop in rustc_serialize 2024-10-16 15:44:16 +02:00
rustc_session Rollup merge of #133429 - EnzymeAD:autodiff-middle, r=oli-obk 2025-01-31 00:26:30 -05:00
rustc_smir introduce ty::Value 2025-01-30 17:47:44 +01:00
rustc_span Rollup merge of #133429 - EnzymeAD:autodiff-middle, r=oli-obk 2025-01-31 00:26:30 -05:00
rustc_symbol_mangling introduce ty::Value 2025-01-30 17:47:44 +01:00
rustc_target Auto merge of #135030 - Flakebi:require-cpu, r=workingjubilee 2025-01-30 20:21:50 +00:00
rustc_trait_selection Rollup merge of #132156 - estebank:closure-return, r=Nadrieril,compiler-errors 2025-01-31 00:26:29 -05:00
rustc_traits Auto merge of #136011 - compiler-errors:query-norm-vaniquishes-us, r=jackh726 2025-01-29 02:12:12 +00:00
rustc_transmute introduce ty::Value 2025-01-30 17:47:44 +01:00
rustc_ty_utils introduce ty::Value 2025-01-30 17:47:44 +01:00
rustc_type_ir introduce ty::Value 2025-01-30 17:47:44 +01:00
rustc_type_ir_macros do not relate Abi and Safety 2024-10-22 23:13:04 +02:00
stable_mir Represent the raw pointer for a array length check as a new kind of fake borrow 2025-01-28 00:00:33 +00:00