Skip to content

Commit e92427f

Browse files
committed
doc and move single branch match to an if let
1 parent d8c09d3 commit e92427f

File tree

1 file changed

+6
-6
lines changed
  • compiler/rustc_monomorphize/src/partitioning

1 file changed

+6
-6
lines changed

compiler/rustc_monomorphize/src/partitioning/autodiff.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ fn adjust_activity_to_abi<'tcx>(tcx: TyCtxt<'tcx>, fn_ty: Ty<'tcx>, da: &mut Vec
8080
}
8181
};
8282

83-
match layout.backend_repr() {
84-
rustc_abi::BackendRepr::ScalarPair(_, _) => {
85-
new_activities.push(da[i].clone());
86-
new_positions.push(i + 1);
87-
}
88-
_ => {}
83+
// If the argument is lowered as a `ScalarPair`, we need to duplicate its activity.
84+
// Otherwise, the number of activities won't match the number of LLVM arguments and
85+
// this will lead to errors when verifying the Enzyme call.
86+
if let rustc_abi::BackendRepr::ScalarPair(_, _) = layout.backend_repr() {
87+
new_activities.push(da[i].clone());
88+
new_positions.push(i + 1);
8989
}
9090
}
9191
// now add the extra activities coming from slices

0 commit comments

Comments
 (0)