+
+
Adding a new intrinsic function to LLVM is much easier than adding a new
+instruction. Almost all extensions to LLVM should start as an intrinsic
+function and then be turned into an instruction if warranted.
+
+
+- llvm/docs/LangRef.html:
+ Document the intrinsic. Decide whether it is code generator specific and
+ what the restrictions are. Talk to other people about it so that you are
+ sure it's a good idea.
+
+- llvm/include/llvm/Intrinsics.h:
+ add an enum in the llvm::Intrinsic namespace
+
+- llvm/lib/VMCore/IntrinsicLowering.cpp:
+ implement the lowering for this intrinsic
+
+- llvm/lib/VMCore/Verifier.cpp:
+ Add code to check the invariants of the intrinsic are respected.
+
+- llvm/lib/VMCore/Function.cpp (Function::getIntrinsicID()):
+ Identify the new intrinsic function, returning the enum for the intrinsic
+ that you added.
+- Test your intrinsic
+- llvm/test/Regression/*: add your test cases to the test suite.
+
+
+
If this intrinsic requires code generator support (ie, it cannot be lowered).
+You should also add support to the code generator in question.
+
+
+