Unknown LLVM intrinsic

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)

Is there something I missed about using intrinsic functions?


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.