Skip to content

Commit 0f272e5

Browse files
Auto merge of #145910 - saethlin:ignore-intrinsic-calls, r=<try>
Ignore intrinsic calls in cross-crate-inlining cost model
2 parents 3c91be7 + 2fbad6d commit 0f272e5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/rustc_mir_transform/src/cross_crate_inline.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,12 @@ impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> {
135135
}
136136
}
137137
}
138-
TerminatorKind::Call { unwind, .. } => {
138+
TerminatorKind::Call { ref func, unwind, .. } => {
139+
if let Some((fn_def_id, _)) = func.const_fn_def() {
140+
if self.tcx.has_attr(fn_def_id, sym::rustc_intrinsic) {
141+
return;
142+
}
143+
}
139144
self.calls += 1;
140145
if let UnwindAction::Cleanup(_) = unwind {
141146
self.landing_pads += 1;

0 commit comments

Comments
 (0)