Adjust autodiff actitivies for ScalarPair
This commit is contained in:
parent
11107679ee
commit
466bec9029
1 changed files with 17 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue