From a5769193d1661238b4792c26daef350da1df5cf6 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sat, 11 Feb 2023 21:01:11 +0000 Subject: [PATCH] Remove special case in rvalue codegen. --- compiler/rustc_codegen_ssa/src/mir/rvalue.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs index 95bc0b30bea..41cd1c09a4e 100644 --- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs +++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs @@ -652,18 +652,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { rhs: Bx::Value, input_ty: Ty<'tcx>, ) -> OperandValue { - // This case can currently arise only from functions marked - // with #[rustc_inherit_overflow_checks] and inlined from - // another crate (mostly core::num generic/#[inline] fns), - // while the current crate doesn't use overflow checks. - // - // As an optimization, we emit an unchecked binop when overflow checks are disabled, - // as the overflow flag would be ignored anyway. - if !bx.cx().check_overflow() { - let val = self.codegen_scalar_binop(bx, op, lhs, rhs, input_ty); - return OperandValue::Pair(val, bx.cx().const_bool(false)); - } - let (val, of) = match op { // These are checked using intrinsics mir::BinOp::Add | mir::BinOp::Sub | mir::BinOp::Mul => {