about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-09 07:28:47 +0000
committerbors <bors@rust-lang.org>2024-06-09 07:28:47 +0000
commitb3ca6ee18ad96b45ef403938a58f9fb9d250fbc4 (patch)
treeac5657c76595810b9fc6a568084f18aedab17451 /compiler/rustc_codegen_llvm
parent13423befc40fffe23ccc6dd06868142cff9428fe (diff)
parent2f2031d2b22d64d015625db2dd11e44e7ab37091 (diff)
downloadrust-b3ca6ee18ad96b45ef403938a58f9fb9d250fbc4.tar.gz
rust-b3ca6ee18ad96b45ef403938a58f9fb9d250fbc4.zip
Auto merge of #126163 - RalfJung:simd-packed, r=calebzulawski,workingjubilee
simd packed types: remove outdated comment, extend codegen test

It seems like https://github.com/rust-lang/rust/pull/125311 made that check in codegen unnecessary?

r? `@workingjubilee` `@calebzulawski`
Diffstat (limited to 'compiler/rustc_codegen_llvm')
-rw-r--r--compiler/rustc_codegen_llvm/src/intrinsic.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs
index 7b1038d5617..ad4e753fe9d 100644
--- a/compiler/rustc_codegen_llvm/src/intrinsic.rs
+++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs
@@ -1109,10 +1109,12 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
         tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), callee_ty.fn_sig(tcx));
     let arg_tys = sig.inputs();
 
-    // Vectors must be immediates (non-power-of-2 #[repr(packed)] are not)
-    for (ty, arg) in arg_tys.iter().zip(args) {
-        if ty.is_simd() && !matches!(arg.val, OperandValue::Immediate(_)) {
-            return_error!(InvalidMonomorphization::SimdArgument { span, name, ty: *ty });
+    // Sanity-check: all vector arguments must be immediates.
+    if cfg!(debug_assertions) {
+        for (ty, arg) in arg_tys.iter().zip(args) {
+            if ty.is_simd() {
+                assert!(matches!(arg.val, OperandValue::Immediate(_)));
+            }
         }
     }