From c04b95512dd5509129850d346c9847191d329687 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Wed, 1 May 2024 23:14:13 -0700 Subject: [PATCH] Stop `llvm.expect`ing assert terminators --- compiler/rustc_codegen_ssa/src/mir/block.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs index be5458523d1ca..fe5191722d829 100644 --- a/compiler/rustc_codegen_ssa/src/mir/block.rs +++ b/compiler/rustc_codegen_ssa/src/mir/block.rs @@ -649,8 +649,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { return helper.funclet_br(self, bx, target, mergeable_succ); } - // Pass the condition through llvm.expect for branch hinting. - let cond = bx.expect(cond, expected); + // Because we're branching to a panic block (either a `#[cold]` one + // or an inlined abort), there's no need to `expect` it. // Create the failure block and the conditional branch to it. let lltarget = helper.llbb_with_cleanup(self, target);