1
Fork 0

Make is_intrinsic query return the intrinsic name

This commit is contained in:
Oli Scherer 2024-01-30 14:20:22 +00:00
parent de4d615e6b
commit 0eee945680
22 changed files with 38 additions and 43 deletions

View file

@ -70,7 +70,7 @@ impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> {
TerminatorKind::Call { func: Operand::Constant(ref f), unwind, .. } => {
let fn_ty = self.instantiate_ty(f.const_.ty());
self.cost += if let ty::FnDef(def_id, _) = *fn_ty.kind()
&& tcx.is_intrinsic(def_id)
&& tcx.intrinsic(def_id).is_some()
{
// Don't give intrinsics the extra penalty for calls
INSTR_COST