From c069ca5d056e1fb1e8cde6688cce24312f84cf75 Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Tue, 6 Apr 2004 04:17:51 +0000 Subject: [PATCH] Incorporated Chris' comments. llvm-svn: 12690 --- llvm/docs/ExtendingLLVM.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/llvm/docs/ExtendingLLVM.html b/llvm/docs/ExtendingLLVM.html index 8c880e5ba7c6..7dc8d15dfea8 100644 --- a/llvm/docs/ExtendingLLVM.html +++ b/llvm/docs/ExtendingLLVM.html @@ -50,6 +50,12 @@ different passes that you intend to use with your extension, and there are many LLVM analyses and transformations, so it may be quite a bit of work.

+

Adding an intrinsic function is easier than adding +an instruction, and is transparent to optimization passes which treat it as an +unanalyzable function. If your added functionality can be expressed as a +function call, an intrinsic function is the method of choice for LLVM +extension.

+

Before you invest a significant amount of effort into a non-trivial extension, ask on the list if what you are looking to do can be done with already-existing infrastructure, or if maybe @@ -72,11 +78,12 @@ href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM-dev.

WARNING: adding instructions changes the bytecode -format, and will break compatibility with currently-existing LLVM -installations. Only add an instruction if it is absolutely +format, and it will take some effort to maintain compatibility with +the previous version. Only add an instruction if it is absolutely necessary.

    +
  1. llvm/include/llvm/Instruction.def: add a number for your instruction and an enum name
  2. @@ -117,11 +124,6 @@ to understand this new instruction.

    -

    Adding an intrinsic function is easier than adding an instruction, and is -transparent to optimization passes which treat it as an unanalyzable function. -If your added functionality can be expressed as a function call, an intrinsic -function is the method of choice for LLVM extension.

    -
    1. llvm/include/llvm/Intrinsics.h: