[LLVMdev] Unknown LLVM intrinsic

Chris Lattner sabre at nondot.org
Wed Apr 14 19:23:01 PDT 2004


On Wed, 14 Apr 2004, Andrew Birck wrote:

> I'm using the intrinsic llvm.memcpy which I declare at the top of my file:
>
> declare void %llvm.memcpy(sbyte*, sbyte*, uint, uint)
> and then later use as such:
> call void %llvm.memcpy(sbyte* %t12, sbyte* %t13, uint %t9, uint 0)
>
> However when trying to compile the llvm program I get this:
>
> cpp -I/home/class/cs326/mp/mp2/lib cgen_test.ll | sed -e"s/#.*//" >
> cgen_test.bc.exp
> llvm-as -f -o cgen_test.bc cgen_test.bc.exp
> llvm-as: Function.cpp:232: unsigned int llvm::Function::getIntrinsicID()
> const: Assertion `0 && "Unknown LLVM intrinsic function!"' failed.
> make: *** [cgen_test.bc] Aborted (core dumped)

That should work.  Look in lib/VMCore/Function.cpp.  You should see an
entry in Function::getIntrinsicID() for llvm.memcpy.  If you don't have
it, then your copy of LLVM doesn't support that intrinsic, and you can
just emit a call to that standard libc memcpy instead.

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/




More information about the llvm-dev mailing list