Skip to content

Commit c7c042a

Browse files
committed
Address review comments.
Remove bitcasts in OperandRef::extract_field; only pointercasts should be needed.
1 parent 7b1eeda commit c7c042a

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

compiler/rustc_codegen_ssa/src/mir/operand.rs

-6
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,6 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
247247
let ty = bx.cx().immediate_backend_type(field);
248248
if bx.type_kind(ty) == TypeKind::Pointer {
249249
*llval = bx.pointercast(*llval, ty);
250-
} else {
251-
*llval = bx.bitcast(*llval, ty);
252250
}
253251
}
254252
(OperandValue::Pair(a, b), Abi::ScalarPair(a_abi, b_abi)) => {
@@ -260,13 +258,9 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
260258
let b_ty = bx.cx().scalar_pair_element_backend_type(field, 1, true);
261259
if bx.type_kind(a_ty) == TypeKind::Pointer {
262260
*a = bx.pointercast(*a, a_ty);
263-
} else {
264-
*a = bx.bitcast(*a, a_ty);
265261
}
266262
if bx.type_kind(b_ty) == TypeKind::Pointer {
267263
*b = bx.pointercast(*b, b_ty);
268-
} else {
269-
*b = bx.bitcast(*b, b_ty);
270264
}
271265
}
272266
// Newtype vector of array, e.g. #[repr(simd)] struct S([i32; 4]);

0 commit comments

Comments
 (0)