Skip to content

Commit 3563608

Browse files
committed
Avoid call to pointer_ty
1 parent 0ebb483 commit 3563608

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/intrinsics/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,7 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
11221122
}
11231123

11241124
let size = fx.layout_of(T).layout.size;
1125+
// FIXME add and use emit_small_memcmp
11251126
let is_eq_value =
11261127
if size == Size::ZERO {
11271128
// No bytes means they're trivially equal
@@ -1137,10 +1138,9 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
11371138
} else {
11381139
// Just call `memcmp` (like slices do in core) when the
11391140
// size is too large or it's not a power-of-two.
1140-
let ptr_ty = pointer_ty(fx.tcx);
11411141
let signed_bytes = i64::try_from(size.bytes()).unwrap();
1142-
let bytes_val = fx.bcx.ins().iconst(ptr_ty, signed_bytes);
1143-
let params = vec![AbiParam::new(ptr_ty); 3];
1142+
let bytes_val = fx.bcx.ins().iconst(fx.pointer_type, signed_bytes);
1143+
let params = vec![AbiParam::new(fx.pointer_type); 3];
11441144
let returns = vec![AbiParam::new(types::I32)];
11451145
let args = &[lhs_ref, rhs_ref, bytes_val];
11461146
let cmp = fx.lib_call("memcmp", params, returns, args)[0];

0 commit comments

Comments
 (0)