How to declare intrinsic that takes pointer to routine?

Suppose I want to define an intrinsic that takes a pointer to a routine. E.g., an intrinsic version of qsort, or for argument's sake, an intrinsic form for this hypothetical routine:

       void* foobitize(void thunk(void*,void*));

How do I defined the intrinsic in llvm/IR/Intrinsics.td ? It looks like I need to define a new class, but I'm lost about what I need to do. There doesn't seem to be any prior examples of intrinsics that take pointers to routines.

This not something I'm planning to submit as a commit; it's just part of an experiment.

- Arch D. Robison

Suppose I want to define an intrinsic that takes a pointer to a routine.
E.g., an intrinsic version of qsort, or for argument's sake, an intrinsic
form for this hypothetical routine:

       void* foobitize(void thunk(void*,void*));

How do I defined the intrinsic in llvm/IR/Intrinsics.td ? It looks like I
need to define a new class, but I'm lost about what I need to do. There
doesn't seem to be any prior examples of intrinsics that take pointers to
routines.

This not something I'm planning to submit as a commit; it's just part of
an experiment.

I think there are some intrinsics which just take llvm_ptr_ty and require
their callers to bitcast to i8*.