[LLVMdev] How to produce a "Intrinsic Function" call instruction?

Ralf Karrenberg Chareos at gmx.de
Thu Jul 30 02:23:10 PDT 2009


?? wrote:
> I have also noticed that LLVM provides some classes like
> "/*MemCpyInst"*/ to wrap the "/*llvm.memcpy"*/ Intrinsic. But other
> intrinsic functions such as /*"*//*llvm.sadd.with.overflow"*/ I've
> mentioned above don't have the corresponding classes. How to deal with it?
For special instruction set intrinsics like SSE, you can use
Intrinsic::getDeclaration() which returns an llvm::Function* :
Intrinsic::getDeclaration(module, Intrinsic::sadd_with_overflow);

Have a look at include/llvm/Intrinsics.gen for the exact names.


More information about the llvm-dev mailing list