Skip to content

Commit cd363c8

Browse files
committed
re-work comment, refactor returning from function
1 parent 4404ca0 commit cd363c8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

compiler/rustc_codegen_ssa/src/mir/operand.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -637,11 +637,11 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
637637

638638
mir::Operand::Constant(ref constant) => {
639639
let constant_ty = constant.ty();
640-
// Make sure that constant SIMD vectors are passed as immediates.
641-
// This is needed for some intrinsics.
642-
return if constant_ty.is_simd() {
640+
// Make sure this type is actually passed as an immediate vector.
641+
// (In particular, this excludes packed SIMD vectors.)
642+
if constant_ty.is_simd() {
643643
let layout = bx.layout_of(constant_ty);
644-
match layout.abi {
644+
return match layout.abi {
645645
Abi::Vector { .. } => {
646646
let (llval, ty) = self.immediate_const_vector(bx, constant);
647647
OperandRef {
@@ -650,10 +650,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
650650
}
651651
}
652652
_ => self.eval_mir_constant_to_operand(bx, constant),
653-
}
654-
} else {
655-
self.eval_mir_constant_to_operand(bx, constant)
656-
};
653+
};
654+
}
655+
656+
self.eval_mir_constant_to_operand(bx, constant)
657657
}
658658
}
659659
}

0 commit comments

Comments
 (0)