about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMarcelo Domínguez <dmmarcelo27@gmail.com>2025-07-15 09:56:51 +0000
committerMarcelo Domínguez <dmmarcelo27@gmail.com>2025-09-17 12:01:22 +0000
commit8dbd1b014ac43cc9c950e3b7e112b62d0963ec17 (patch)
treea85703dc58bba07ef5667bae6f94d29168d1c617 /compiler
parent466bec90292a1b04a50a5889ab13fddd53c925ce (diff)
downloadrust-8dbd1b014ac43cc9c950e3b7e112b62d0963ec17.tar.gz
rust-8dbd1b014ac43cc9c950e3b7e112b62d0963ec17.zip
doc and move single branch match to an if let
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_codegen_llvm/src/builder/autodiff.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder/autodiff.rs b/compiler/rustc_codegen_llvm/src/builder/autodiff.rs
index a1cc4fdbdf6..a19a0d867ac 100644
--- a/compiler/rustc_codegen_llvm/src/builder/autodiff.rs
+++ b/compiler/rustc_codegen_llvm/src/builder/autodiff.rs
@@ -90,12 +90,12 @@ pub(crate) fn adjust_activity_to_abi<'tcx>(
             }
         };
 
-        match layout.backend_repr() {
-            rustc_abi::BackendRepr::ScalarPair(_, _) => {
-                new_activities.push(da[i].clone());
-                new_positions.push(i + 1);
-            }
-            _ => {}
+        // If the argument is lowered as a `ScalarPair`, we need to duplicate its activity.
+        // Otherwise, the number of activities won't match the number of LLVM arguments and
+        // this will lead to errors when verifying the Enzyme call.
+        if let rustc_abi::BackendRepr::ScalarPair(_, _) = layout.backend_repr() {
+            new_activities.push(da[i].clone());
+            new_positions.push(i + 1);
         }
     }
     // now add the extra activities coming from slices