File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1122,6 +1122,7 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
1122
1122
}
1123
1123
1124
1124
let size = fx. layout_of( T ) . layout. size;
1125
+ // FIXME add and use emit_small_memcmp
1125
1126
let is_eq_value =
1126
1127
if size == Size :: ZERO {
1127
1128
// No bytes means they're trivially equal
@@ -1137,10 +1138,9 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
1137
1138
} else {
1138
1139
// Just call `memcmp` (like slices do in core) when the
1139
1140
// size is too large or it's not a power-of-two.
1140
- let ptr_ty = pointer_ty( fx. tcx) ;
1141
1141
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 ] ;
1144
1144
let returns = vec![ AbiParam :: new( types:: I32 ) ] ;
1145
1145
let args = & [ lhs_ref, rhs_ref, bytes_val] ;
1146
1146
let cmp = fx. lib_call( "memcmp" , params, returns, args) [ 0 ] ;
You can’t perform that action at this time.
0 commit comments