Skip to content

Commit 5628e24

Browse files
committed
[NFC] simplify matching
1 parent f4c2978 commit 5628e24

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

compiler/rustc_codegen_llvm/src/builder/autodiff.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,8 @@ fn generate_enzyme_call<'ll>(
240240
args.push(fn_to_diff);
241241

242242
let enzyme_primal_ret = cx.create_metadata("enzyme_primal_return".to_string()).unwrap();
243-
match output {
244-
DiffActivity::Dual => {
245-
args.push(cx.get_metadata_value(enzyme_primal_ret));
246-
}
247-
DiffActivity::Active => {
248-
args.push(cx.get_metadata_value(enzyme_primal_ret));
249-
}
250-
_ => {}
243+
if matches!(attrs.ret_activity, DiffActivity::Dual | DiffActivity::Active) {
244+
args.push(cx.get_metadata_value(enzyme_primal_ret));
251245
}
252246

253247
let outer_args: Vec<&llvm::Value> = get_params(outer_fn);

0 commit comments

Comments
 (0)