Hello,
As an experiment, I'm simply trying to add a trivial intrinsic to LLVM, but
I'm having trouble, which suggests that I'm overlooking the obvious 
Platform is GCC-4.2.4/LLVM from SVN/x86.
First, I've read the page here about 10 times, so I'll speculate that my
reading comprehension is lacking:
http://www.llvm.org/docs/ExtendingLLVM.html
Code I've added to the bottom of the llvm/include/llvm/Intrinsics.td file:
Hi,
After invoking:
llvm-gcc -g test.c -o test.native
-----------------
The compiler returns:
cc1: Function.cpp:323: unsigned int llvm::Function::getIntrinsicID(bool)
const: Assertion `noAssert && "Invalid LLVM intrinsic name"' failed.
test.c:24: internal compiler error: Aborted
did you rebuild llvm-gcc after building llvm with your new intrinsic
defined?
Ciao,
Duncan.
Thank you for your reply--I've now done that. Unfortunately, there's a new
error now:
Hi Matt,
Thank you for your reply--I've now done that. Unfortunately, there's a new
error now:
------------
Cannot yet select: intrinsic %llvm.test_intrinsic
test.c:25: internal compiler error: Aborted
that's because you didn't tell the code generators what
they should do with your intrinsic.
Ciao,
Duncan.
Thank you again for your help. Assuming my experimental "noop" intrinsic is
intended to be target independent, what file should I modify to provide the
code generator with the necessary information? I've already modified:
./lib/CodeGen/IntrinsicLowering.cpp
./lib/Target/CBackend/CBackend.cpp
./include/llvm/Intrinsics.td
Presumably it's not one of those? Or, if it is, I imagine I've simply
screwed something up?
Thanks again,
Matt