[LLVMdev] About implementing new intrinsic

Reid Spencer rspencer at reidspencer.com
Sat Mar 31 12:59:06 PDT 2007


On Sat, 2007-03-31 at 12:38 -0800, Chris Lattner wrote:
> >> 3. Can I introduce an intrinsic that is actually a call to my function
> >> that implements the logic? I suppose it is possible but unfortunately
> >> I couldn't figure it out. For example, in GCC we can write an
> >> intrinsic that translates to a C code.
> >
> > As part of PR1297 (http://llvm.org/PR1297) I am about to make this
> > happen. There are certain kinds of intrinsics that want to have a
> > function body generated for them if a target or code generator cannot
> > handle the intrinsic natively. For example, the company I work for has
> 
> IntrinsicLowering already does this.  It lets you lower intrinsics to 
> arbitrary LLVM calls, including calls to external functions.

I think that when Ferad said "in GCC we can write an intrinsic that
translates to a C code" meant that the intrinsic would be expanded to
have a body much as I'm planning on doing in the this PR1297. To my
understanding, IntrinsicLowering doesn't support expansion to a function
with a body.  Or, am I just missing something on that?

Perhaps Ferad could explain in a little more detail what he meant?

> 
> -Chris
> 




More information about the llvm-dev mailing list