@@ -212,15 +212,9 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
212
212
_ => bug ! ( "expected fn item type, found {}" , callee_ty) ,
213
213
} ;
214
214
215
- let sig = callee_ty. fn_sig ( tcx) ;
216
- let sig = tcx. normalize_erasing_late_bound_regions ( self . typing_env ( ) , sig) ;
217
- let arg_tys = sig. inputs ( ) ;
218
- let ret_ty = sig. output ( ) ;
219
215
let name = tcx. item_name ( def_id) ;
220
216
let name_str = name. as_str ( ) ;
221
217
222
- let llret_ty = self . layout_of ( ret_ty) . gcc_type ( self ) ;
223
-
224
218
let simple = get_simple_intrinsic ( self , name) ;
225
219
let simple_func = get_simple_function ( self , name) ;
226
220
@@ -320,8 +314,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
320
314
| sym:: rotate_right
321
315
| sym:: saturating_add
322
316
| sym:: saturating_sub => {
323
- let ty = arg_tys[ 0 ] ;
324
- match int_type_width_signed ( ty, self ) {
317
+ match int_type_width_signed ( args[ 0 ] . layout . ty , self ) {
325
318
Some ( ( width, signed) ) => match name {
326
319
sym:: ctlz | sym:: cttz => {
327
320
let func = self . current_func . borrow ( ) . expect ( "func" ) ;
@@ -400,7 +393,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
400
393
tcx. dcx ( ) . emit_err ( InvalidMonomorphization :: BasicIntegerType {
401
394
span,
402
395
name,
403
- ty,
396
+ ty : args [ 0 ] . layout . ty ,
404
397
} ) ;
405
398
return Ok ( ( ) ) ;
406
399
}
@@ -492,7 +485,15 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
492
485
}
493
486
494
487
_ if name_str. starts_with ( "simd_" ) => {
495
- match generic_simd_intrinsic ( self , name, callee_ty, args, ret_ty, llret_ty, span) {
488
+ match generic_simd_intrinsic (
489
+ self ,
490
+ name,
491
+ callee_ty,
492
+ args,
493
+ result. layout . ty ,
494
+ result. layout . gcc_type ( self ) ,
495
+ span,
496
+ ) {
496
497
Ok ( value) => value,
497
498
Err ( ( ) ) => return Ok ( ( ) ) ,
498
499
}
0 commit comments