Skip to content

Commit

Permalink
Address review comments.
Browse files Browse the repository at this point in the history
Remove bitcasts in OperandRef::extract_field; only pointercasts should
be needed.
  • Loading branch information
luqmana committed May 5, 2023
1 parent 7b1eeda commit c7c042a
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions compiler/rustc_codegen_ssa/src/mir/operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
let ty = bx.cx().immediate_backend_type(field);
if bx.type_kind(ty) == TypeKind::Pointer {
*llval = bx.pointercast(*llval, ty);
} else {
*llval = bx.bitcast(*llval, ty);
}
}
(OperandValue::Pair(a, b), Abi::ScalarPair(a_abi, b_abi)) => {
Expand All @@ -260,13 +258,9 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
let b_ty = bx.cx().scalar_pair_element_backend_type(field, 1, true);
if bx.type_kind(a_ty) == TypeKind::Pointer {
*a = bx.pointercast(*a, a_ty);
} else {
*a = bx.bitcast(*a, a_ty);
}
if bx.type_kind(b_ty) == TypeKind::Pointer {
*b = bx.pointercast(*b, b_ty);
} else {
*b = bx.bitcast(*b, b_ty);
}
}
// Newtype vector of array, e.g. #[repr(simd)] struct S([i32; 4]);
Expand Down

0 comments on commit c7c042a

Please sign in to comment.