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 think.<div>
<br></div><div>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?</div>
<div><br></div><div>Thanks</div><div>Vinod</div><div><br><div><br><div class="gmail_quote">On Mon, Jul 13, 2009 at 8:57 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5"><br>
On Jul 13, 2009, at 8:41 PM, Vinod Grover wrote:<br>
<br>
> I was looking at the LLVM IR documentation and was wondering if it<br>
> is possible to define  LLVM intrinsics which might be a pointer to<br>
> some pre-defined struct or opaque types?<br>
> If that is possible how would one go about doing that ?<br>
<br>
</div></div>You mean something like FILE*?  It's not possible to do that, but you<br>
can just define it as i8* and use a bitcast at the call site.<br>
<br>
-Chris<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div></div>