Skip to content

Commit 5a54774

Browse files
committed
doc and move single branch match to an if let
1 parent 58e1906 commit 5a54774

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

compiler/rustc_codegen_llvm/src/builder/autodiff.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ pub(crate) fn adjust_activity_to_abi<'tcx>(
9090
}
9191
};
9292

93-
match layout.backend_repr() {
94-
rustc_abi::BackendRepr::ScalarPair(_, _) => {
95-
new_activities.push(da[i].clone());
96-
new_positions.push(i + 1);
97-
}
98-
_ => {}
93+
// If the argument is lowered as a `ScalarPair`, we need to duplicate its activity.
94+
// Otherwise, the number of activities won't match the number of LLVM arguments and
95+
// this will lead to errors when verifying the Enzyme call.
96+
if let rustc_abi::BackendRepr::ScalarPair(_, _) = layout.backend_repr() {
97+
new_activities.push(da[i].clone());
98+
new_positions.push(i + 1);
9999
}
100100
}
101101
// now add the extra activities coming from slices

0 commit comments

Comments
 (0)