1
Fork 0

upstream rustc_codegen_ssa/rustc_middle changes for enzyme/autodiff

This commit is contained in:
Manuel Drehwald 2025-01-29 21:31:13 -05:00
parent ebcf860e73
commit 1f30517d40
27 changed files with 482 additions and 38 deletions

View file

@ -79,6 +79,7 @@ pub struct AutoDiffItem {
pub target: String,
pub attrs: AutoDiffAttrs,
}
#[derive(Clone, Eq, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
pub struct AutoDiffAttrs {
/// Conceptually either forward or reverse mode AD, as described in various autodiff papers and
@ -231,7 +232,7 @@ impl AutoDiffAttrs {
self.ret_activity == DiffActivity::ActiveOnly
}
pub fn error() -> Self {
pub const fn error() -> Self {
AutoDiffAttrs {
mode: DiffMode::Error,
ret_activity: DiffActivity::None,