From 36365406352b15fd3747ef5c6efd85ded4e04608 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 9 Apr 2004 19:24:20 +0000 Subject: [PATCH] Expand on adding an intrinsic. Move section to before adding an instruction git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12796 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ExtendingLLVM.html | 66 +++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/docs/ExtendingLLVM.html b/docs/ExtendingLLVM.html index 7dc8d15dfea..b4519cc7bc6 100644 --- a/docs/ExtendingLLVM.html +++ b/docs/ExtendingLLVM.html @@ -14,8 +14,8 @@
  1. Introduction and Warning
  2. -
  3. Adding a new instruction
  4. Adding a new intrinsic function
  5. +
  6. Adding a new instruction
  7. Adding a new type
    1. Adding a new fundamental type
    2. @@ -69,6 +69,45 @@ href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM-dev.

      + + + + +
      + +

      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.

      + +
        +
      1. 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.
      2. + +
      3. llvm/include/llvm/Intrinsics.h: + add an enum in the llvm::Intrinsic namespace
      4. + +
      5. llvm/lib/VMCore/IntrinsicLowering.cpp: + implement the lowering for this intrinsic
      6. + +
      7. llvm/lib/VMCore/Verifier.cpp: + Add code to check the invariants of the intrinsic are respected.
      8. + +
      9. llvm/lib/VMCore/Function.cpp (Function::getIntrinsicID()): + Identify the new intrinsic function, returning the enum for the intrinsic + that you added.
      10. +
      11. Test your intrinsic
      12. +
      13. llvm/test/Regression/*: add your test cases to the test suite.
      14. +
      + +

      If this intrinsic requires code generator support (ie, it cannot be lowered). +You should also add support to the code generator in question.

      + +
      +
      Adding a new instruction @@ -116,31 +155,6 @@ to understand this new instruction.

      - - - - -
      - -
        - -
      1. llvm/include/llvm/Intrinsics.h: - add an enum in the llvm::Intrinsic namespace
      2. - -
      3. llvm/lib/VMCore/IntrinsicLowering.cpp: - implement the lowering for this intrinsic
      4. - -
      5. llvm/lib/VMCore/Verifier.cpp: - handle the new intrinsic
      6. - -
      7. llvm/lib/VMCore/Function.cpp: - handle the new intrinsic
      8. - -
      - -
      -- 2.34.1