Skip to content

Commit b1efbc0

Browse files
committed
Auto merge of rust-lang#124606 - scottmcm:less-expect, r=<try>
Stop `llvm.expect`ing assert terminators r? ghost
2 parents fcc06c8 + c04b955 commit b1efbc0

File tree

1 file changed

+2
-2
lines changed
  • compiler/rustc_codegen_ssa/src/mir

1 file changed

+2
-2
lines changed

compiler/rustc_codegen_ssa/src/mir/block.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
649649
return helper.funclet_br(self, bx, target, mergeable_succ);
650650
}
651651

652-
// Pass the condition through llvm.expect for branch hinting.
653-
let cond = bx.expect(cond, expected);
652+
// Because we're branching to a panic block (either a `#[cold]` one
653+
// or an inlined abort), there's no need to `expect` it.
654654

655655
// Create the failure block and the conditional branch to it.
656656
let lltarget = helper.llbb_with_cleanup(self, target);

0 commit comments

Comments
 (0)