Avoid computing function type for intrinsic instances

This commit is contained in:
bjorn3
2025-05-30 09:39:43 +00:00
parent 38a6daeb23
commit 0fcea3db28
3 changed files with 13 additions and 22 deletions

View File

@@ -169,13 +169,9 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
span: Span,
) -> Result<(), ty::Instance<'tcx>> {
let tcx = self.tcx;
let callee_ty = instance.ty(tcx, self.typing_env());
let ty::FnDef(def_id, fn_args) = *callee_ty.kind() else {
bug!("expected fn item type, found {}", callee_ty);
};
let name = tcx.item_name(def_id);
let name = tcx.item_name(instance.def_id());
let fn_args = instance.args;
let simple = get_simple_intrinsic(self, name);
let llval = match name {