@@ -388,11 +388,9 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
388
388
_ => unreachable ! ( "{:?}" , targets) ,
389
389
} ;
390
390
391
- let discr = crate :: optimize:: peephole:: maybe_unwrap_bint ( & mut fx. bcx , discr) ;
392
391
let ( discr, is_inverted) =
393
392
crate :: optimize:: peephole:: maybe_unwrap_bool_not ( & mut fx. bcx , discr) ;
394
393
let test_zero = if is_inverted { !test_zero } else { test_zero } ;
395
- let discr = crate :: optimize:: peephole:: maybe_unwrap_bint ( & mut fx. bcx , discr) ;
396
394
if let Some ( taken) = crate :: optimize:: peephole:: maybe_known_branch_taken (
397
395
& fx. bcx , discr, test_zero,
398
396
) {
@@ -569,20 +567,14 @@ fn codegen_stmt<'tcx>(
569
567
UnOp :: Not => match layout. ty . kind ( ) {
570
568
ty:: Bool => {
571
569
let res = fx. bcx . ins ( ) . icmp_imm ( IntCC :: Equal , val, 0 ) ;
572
- CValue :: by_val ( fx . bcx . ins ( ) . bint ( types :: I8 , res) , layout)
570
+ CValue :: by_val ( res, layout)
573
571
}
574
572
ty:: Uint ( _) | ty:: Int ( _) => {
575
573
CValue :: by_val ( fx. bcx . ins ( ) . bnot ( val) , layout)
576
574
}
577
575
_ => unreachable ! ( "un op Not for {:?}" , layout. ty) ,
578
576
} ,
579
577
UnOp :: Neg => match layout. ty . kind ( ) {
580
- ty:: Int ( IntTy :: I128 ) => {
581
- // FIXME remove this case once ineg.i128 works
582
- let zero =
583
- CValue :: const_val ( fx, layout, ty:: ScalarInt :: null ( layout. size ) ) ;
584
- crate :: num:: codegen_int_binop ( fx, BinOp :: Sub , zero, operand)
585
- }
586
578
ty:: Int ( _) => CValue :: by_val ( fx. bcx . ins ( ) . ineg ( val) , layout) ,
587
579
ty:: Float ( _) => CValue :: by_val ( fx. bcx . ins ( ) . fneg ( val) , layout) ,
588
580
_ => unreachable ! ( "un op Neg for {:?}" , layout. ty) ,
0 commit comments