rust/compiler/rustc_codegen_ssa/src
bors 02f7806ecd Auto merge of #124606 - scottmcm:less-expect, r=cjgillot
Stop `llvm.expect`ing assert terminators

We're putting `llvm.expect` calls before the <https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.TerminatorKind.html#variant.Assert> terminators.

But we don't need them.  One of the arms is always to a panic function that's marked `#[cold]`, which is `cold` <https://llvm.org/docs/LangRef.html#function-attributes> in LLVM, which

> When computing edge weights, basic blocks post-dominated by a cold function call are also considered to be cold; and, thus, given low weight.

So even without us emitting the extra intrinsic call, LLVM knows what to expect for the `br`.  Thus we can save the (small) effort of emitting it and then LLVM optimizing it out.

r? compiler
2024-05-05 01:06:22 +00:00
..
back Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00
debuginfo Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00
mir Auto merge of #124606 - scottmcm:less-expect, r=cjgillot 2024-05-05 01:06:22 +00:00
traits coverage: Eagerly do start-of-function codegen for coverage 2024-05-01 09:06:53 +10:00
assert_module_sources.rs Rename IntoDiagnosticArg as IntoDiagArg. 2024-03-11 09:12:19 +11:00
base.rs Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00
codegen_attrs.rs Rename NestedMetaItem::name_value_literal. 2024-04-24 16:28:34 +10:00
common.rs Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00
errors.rs remove extraneous note on UnableToRunDsymutil diagnostic 2024-04-26 17:24:06 +00:00
lib.rs Step bootstrap cfgs 2024-05-01 22:19:11 -04:00
meth.rs Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00
mono_item.rs Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00
size_of_val.rs Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00
target_features.rs Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00