Skip to content

Commit

Permalink
tweak the comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamesbarford committed Aug 6, 2024
1 parent 664fec0 commit 8618ab8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions compiler/rustc_codegen_ssa/src/mir/operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,11 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {

mir::Operand::Constant(ref constant) => {
let constant_ty = self.monomorphize(constant.ty());
// Make sure this type is actually passed as an immediate vector.
// (In particular, this excludes packed SIMD vectors.)
// Most SIMD vector constants should be passed as immediates.
// (In particular, some intrinsics really rely on this.)
if constant_ty.is_simd() {
// However, some SIMD types do not actually use the vector ABI
// (in particular, packed SIMD types do not). Ensure we exclude those.
let layout = bx.layout_of(constant_ty);
if let Abi::Vector { .. } = layout.abi {
let (llval, ty) = self.immediate_const_vector(bx, constant);
Expand Down

0 comments on commit 8618ab8

Please sign in to comment.