about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-02-11 21:01:11 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-02-18 21:35:02 +0000
commita5769193d1661238b4792c26daef350da1df5cf6 (patch)
tree3307080d6c59a0c48e745738cd9e176bbcdac30d /compiler/rustc_codegen_ssa/src
parente9c73ea502d789fc103e012c052e25cf55f653e3 (diff)
downloadrust-a5769193d1661238b4792c26daef350da1df5cf6.tar.gz
rust-a5769193d1661238b4792c26daef350da1df5cf6.zip
Remove special case in rvalue codegen.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/rvalue.rs12
1 files changed, 0 insertions, 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<Bx::Value> {
-        // 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 => {