Skip to content

Commit 4064b25

Browse files
authored
Rollup merge of #155136 - saethlin:intrinsic-cci-comment, r=wesleywiser
Tweak comment about intrinsics in cross-crate-inlinable @RalfJung pointed out that the previous comment is technically wrong: #145910 (comment)
2 parents 5756977 + 270ebfc commit 4064b25

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

compiler/rustc_mir_transform/src/cross_crate_inline.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> {
146146
TerminatorKind::Call { func, unwind, .. } => {
147147
// We track calls because they make our function not a leaf (and in theory, the
148148
// number of calls indicates how likely this function is to perturb other CGUs).
149-
// But intrinsics don't have a body that gets assigned to a CGU, so they are
150-
// ignored.
149+
// But there are a handful of intrinsics such as raw_eq that should not block
150+
// cross-crate-inlining. Adding a broad exception for all intrinsics benchmarks well
151+
// and seems more sustainable than an ever-growing list of intrinsics to ignore.
151152
if let Some((fn_def_id, _)) = func.const_fn_def()
152153
&& find_attr!(tcx, fn_def_id, RustcIntrinsic)
153154
{

0 commit comments

Comments
 (0)