[LLVMdev] types allowed for intrinsics?

Vinod Grover vgrover528 at gmail.com
Mon Jul 13 21:12:19 PDT 2009

Unfortunately that does not work, since the bitcast will generate a convert
and the argument of the intrinsic will be a value type i8* and the
intrinsics is intended to map to an instruction that accepts only a
symbolic. The convert gets hoisted, possibly to a different block, and we
would like the symbolic variable to stay as an operand of the intrinsic
making it possible to write the correct instruction selection rule, or so I
An alternative might be to not use intrinsic for this purpose and use the
proper signature for this function whose definition (to the right
instruction) is supplied by custom lowering of a predefined external
function. Can this work?


On Mon, Jul 13, 2009 at 8:57 PM, Chris Lattner <clattner at apple.com> wrote:

> On Jul 13, 2009, at 8:41 PM, Vinod Grover wrote:
> > I was looking at the LLVM IR documentation and was wondering if it
> > is possible to define  LLVM intrinsics which might be a pointer to
> > some pre-defined struct or opaque types?
> > If that is possible how would one go about doing that ?
> You mean something like FILE*?  It's not possible to do that, but you
> can just define it as i8* and use a bitcast at the call site.
> -Chris
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090713/44c0de2c/attachment.html>

More information about the llvm-dev mailing list