Make is_intrinsic
query return the intrinsic name
This commit is contained in:
parent
de4d615e6b
commit
0eee945680
22 changed files with 38 additions and 43 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue