diff options
| author | Marcelo DomÃnguez <dmmarcelo27@gmail.com> | 2025-07-14 17:07:01 +0000 |
|---|---|---|
| committer | Marcelo DomÃnguez <dmmarcelo27@gmail.com> | 2025-09-17 12:01:22 +0000 |
| commit | 466bec90292a1b04a50a5889ab13fddd53c925ce (patch) | |
| tree | b9dceb5cbd40f6bccfc1a01c1ebfeb8fff42e3e3 | |
| parent | 11107679ee19cc54d4f6cf66501fd62f123e9eae (diff) | |
| download | rust-466bec90292a1b04a50a5889ab13fddd53c925ce.tar.gz rust-466bec90292a1b04a50a5889ab13fddd53c925ce.zip | |
Adjust autodiff actitivies for ScalarPair
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/builder/autodiff.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder/autodiff.rs b/compiler/rustc_codegen_llvm/src/builder/autodiff.rs index e2df3265f6f..a1cc4fdbdf6 100644 --- a/compiler/rustc_codegen_llvm/src/builder/autodiff.rs +++ b/compiler/rustc_codegen_llvm/src/builder/autodiff.rs @@ -80,6 +80,23 @@ pub(crate) fn adjust_activity_to_abi<'tcx>( continue; } } + + let pci = PseudoCanonicalInput { typing_env: TypingEnv::fully_monomorphized(), value: *ty }; + + let layout = match tcx.layout_of(pci) { + Ok(layout) => layout.layout, + Err(_) => { + bug!("failed to compute layout for type {:?}", ty); + } + }; + + match layout.backend_repr() { + rustc_abi::BackendRepr::ScalarPair(_, _) => { + new_activities.push(da[i].clone()); + new_positions.push(i + 1); + } + _ => {} + } } // now add the extra activities coming from slices // Reverse order to not invalidate the indices |
