@@ -388,11 +388,9 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
388388 _ => unreachable ! ( "{:?}" , targets) ,
389389 } ;
390390
391- let discr = crate :: optimize:: peephole:: maybe_unwrap_bint ( & mut fx. bcx , discr) ;
392391 let ( discr, is_inverted) =
393392 crate :: optimize:: peephole:: maybe_unwrap_bool_not ( & mut fx. bcx , discr) ;
394393 let test_zero = if is_inverted { !test_zero } else { test_zero } ;
395- let discr = crate :: optimize:: peephole:: maybe_unwrap_bint ( & mut fx. bcx , discr) ;
396394 if let Some ( taken) = crate :: optimize:: peephole:: maybe_known_branch_taken (
397395 & fx. bcx , discr, test_zero,
398396 ) {
@@ -569,20 +567,14 @@ fn codegen_stmt<'tcx>(
569567 UnOp :: Not => match layout. ty . kind ( ) {
570568 ty:: Bool => {
571569 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)
573571 }
574572 ty:: Uint ( _) | ty:: Int ( _) => {
575573 CValue :: by_val ( fx. bcx . ins ( ) . bnot ( val) , layout)
576574 }
577575 _ => unreachable ! ( "un op Not for {:?}" , layout. ty) ,
578576 } ,
579577 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- }
586578 ty:: Int ( _) => CValue :: by_val ( fx. bcx . ins ( ) . ineg ( val) , layout) ,
587579 ty:: Float ( _) => CValue :: by_val ( fx. bcx . ins ( ) . fneg ( val) , layout) ,
588580 _ => unreachable ! ( "un op Neg for {:?}" , layout. ty) ,
0 commit comments