X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FLangRef.html;h=96d4fa1086869383e65b85e926b1bec74120b1e2;hb=9030d384c404ef2d28e2464cddcfbea268a12109;hp=54b01eae87464f16d66c1dbdb38ced1eb2dbd651;hpb=a80e1181b78183dc36ec6568559d38faa86981f0;p=oota-llvm.git diff --git a/docs/LangRef.html b/docs/LangRef.html index 54b01eae874..96d4fa10868 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -24,7 +24,7 @@
  • Calling Conventions
  • Global Variables
  • Functions
  • -
  • Aliases +
  • Aliases
  • Parameter Attributes
  • Module-Level Inline Assembly
  • Data Layout
  • @@ -191,6 +191,12 @@
  • Debugger intrinsics
  • Exception Handling intrinsics
  • +
  • General intrinsics
  • +
      +
    1. 'llvm.var.annotation' + Intrinsic
    2. +
    + @@ -252,9 +258,11 @@ LLVM assembly language. There is a difference between what the parser accepts and what is considered 'well formed'. For example, the following instruction is syntactically okay, but not well formed:

    +
    -  %x = add i32 1, %x
    +%x = add i32 1, %x
     
    +

    ...because the definition of %x does not dominate all of its uses. The LLVM infrastructure provides a verification pass that may @@ -263,6 +271,7 @@ automatically run by the parser after parsing input assembly and by the optimizer before it outputs bytecode. The violations pointed out by the verifier pass indicate bugs in transformation passes or input to the parser.

    + @@ -310,23 +319,29 @@ none of them start with a '%' character.

    The easy way:

    +
    -  %result = mul i32 %X, 8
    +%result = mul i32 %X, 8
     
    +

    After strength reduction:

    +
    -  %result = shl i32 %X, i8 3
    +%result = shl i32 %X, i8 3
     
    +

    And the hard way:

    +
    -  add i32 %X, %X           ; yields {i32}:%0
    -  add i32 %0, %0           ; yields {i32}:%1
    -  %result = add i32 %1, %1
    +add i32 %X, %X           ; yields {i32}:%0
    +add i32 %0, %0           ; yields {i32}:%1
    +%result = add i32 %1, %1
     
    +

    This last way of multiplying %X by 8 illustrates several important lexical features of LLVM:

    @@ -367,24 +382,27 @@ combined together with the LLVM linker, which merges function (and global variable) definitions, resolves forward declarations, and merges symbol table entries. Here is an example of the "hello world" module:

    +
    ; Declare the string constant as a global constant...
    -%.LC0 = internal constant [13 x i8 ] c"hello world\0A\00"          ; [13 x i8 ]*
    +@.LC0 = internal constant [13 x i8] c"hello world\0A\00"          ; [13 x i8]*
     
     ; External declaration of the puts function
    -declare i32 %puts(i8 *)                                            ; i32(i8 *)* 
    +declare i32 @puts(i8 *)                                            ; i32(i8 *)* 
     
     ; Definition of main function
    -define i32 %main() {                                                 ; i32()* 
    +define i32 @main() {                                                 ; i32()* 
             ; Convert [13x i8 ]* to i8  *...
             %cast210 = getelementptr [13 x i8 ]* %.LC0, i64 0, i64 0 ; i8 *
    + href="#i_getelementptr">getelementptr [13 x i8 ]* @.LC0, i64 0, i64 0 ; i8 *
     
             ; Call puts function to write out the string to stdout...
             call i32 %puts(i8 * %cast210)                              ; i32
    + href="#i_call">call i32 @puts(i8 * %cast210)                              ; i32
             ret i32 0
    }
    + href="#i_ret">ret i32 0
    }
    + +

    This example is made up of a global variable named ".LC0", an external declaration of the "puts" @@ -591,6 +609,13 @@ All Global Variables and Functions have one of the following visibility styles: directly. +

    "protected" - Protected style:
    + +
    On ELF, protected visibility indicates that the symbol will be placed in + the dynamic symbol table, but that references within the defining module will + bind to the local symbol. That is, the symbol cannot be overridden by another + module. +
    @@ -640,9 +665,11 @@ a power of 2.

    For example, the following defines a global with an initializer, section, and alignment:

    +
    -  %G = constant float 1.0, section "foo", align 4
    +%G = constant float 1.0, section "foo", align 4
     
    +
    @@ -677,7 +704,7 @@ basic block a symbol table entry), contains a list of instructions, and ends with a terminator instruction (such as a branch or function return).

    -

    The first basic block in a program is special in two ways: it is immediately +

    The first basic block in a function is special in two ways: it is immediately executed on entrance to the function, and it is not allowed to have predecessor basic blocks (i.e. there can not be any branches to the entry block of a function). Because the block can have no predecessors, it also cannot have any @@ -712,9 +739,11 @@ a power of 2.

    Syntax:
    -
    -    @<Name> = [Linkage] [Visibility] alias <AliaseeTy> @<Aliasee>
    -  
    +
    +
    +@<Name> = [Linkage] [Visibility] alias <AliaseeTy> @<Aliasee>
    +
    +
    @@ -732,9 +761,15 @@ a power of 2.

    Parameter attributes are simple keywords that follow the type specified. If multiple parameter attributes are needed, they are space separated. For - example:

    -    %someFunc = i16 (i8 sext %someParam) zext
    -    %someFunc = i16 (i8 zext %someParam) zext
    + example:

    + +
    +
    +%someFunc = i16 (i8 sext %someParam) zext
    +%someFunc = i16 (i8 zext %someParam) zext
    +
    +
    +

    Note that the two function types above are unique because the parameter has a different attribute (sext in the first one, zext in the second). Also note that the attribute for the function result (zext) comes immediately after the @@ -755,6 +790,9 @@ a power of 2.

    sret
    This indicates that the parameter specifies the address of a structure that is the return value of the function in the source program.
    +
    noalias
    +
    This indicates that the parameter not alias any other object or any + other "noalias" objects during the function call.
    noreturn
    This function attribute indicates that the function never returns. This indicates to LLVM that every call to this function should be treated as if @@ -780,10 +818,12 @@ LLVM and treated as a single unit, but may be separated in the .ll file if desired. The syntax is very simple:

    -
    -  module asm "inline asm code goes here"
    -  module asm "more can go here"
    -
    +
    +
    +module asm "inline asm code goes here"
    +module asm "more can go here"
    +
    +

    The strings can contain any character by escaping non-printable characters. The escape sequence used is simply "\xx" where "xx" is the two digit hex code @@ -901,9 +941,6 @@ system. The current set of primitive types is as follows:

    TypeDescription voidNo value - i88-bit value - i3232-bit value - float32-bit floating point value labelBranch destination @@ -912,9 +949,7 @@ system. The current set of primitive types is as follows:

    - - - +
    TypeDescription
    i1True or False value
    i1616-bit value
    i6464-bit value
    float32-bit floating point value
    double64-bit floating point value
    @@ -935,7 +970,7 @@ classifications:

    ClassificationTypes integer - i1, i8, i16, i32, i64 + i1, i2, i3, ... i8, ... i16, ... i32, ... i64, ... floating point @@ -943,7 +978,7 @@ classifications:

    first class - i1, i8, i16, i32, i64, float, double,
    + i1, ..., float, double,
    pointer,vector
    @@ -969,6 +1004,52 @@ recursive: For example, it is possible to have a two dimensional array.

    + + + +
    + +
    Overview:
    +

    The integer type is a very simple derived type that simply specifies an +arbitrary bit width for the integer type desired. Any bit width from 1 bit to +2^23-1 (about 8 million) can be specified.

    + +
    Syntax:
    + +
    +  iN
    +
    + +

    The number of bits the integer will occupy is specified by the N +value.

    + +
    Examples:
    + + + + + +
    + i1
    + i4
    + i8
    + i16
    + i32
    + i42
    + i64
    + i1942652
    +
    + A boolean integer of 1 bit
    + A nibble sized integer of 4 bits.
    + A byte sized integer of 8 bits.
    + A half word sized integer of 16 bits.
    + A word sized integer of 32 bits.
    + An integer whose bit width is the answer.
    + A double word sized integer of 64 bits.
    + A really big integer of over 1 million bits.
    +
    +
    + @@ -1351,11 +1432,13 @@ href="#identifiers">identifier for the global is used and always have pointer type. For example, the following is a legal LLVM file:

    +
    -  %X = global i32 17
    -  %Y = global i32 42
    -  %Z = global [2 x i32*] [ i32* %X, i32* %Y ]
    +@X = global i32 17
    +@Y = global i32 42
    +@Z = global [2 x i32*] [ i32* @X, i32* @Y ]
     
    +
    @@ -1509,18 +1592,22 @@ indicates whether or not the inline asm expression has side effects. An example inline assembler expression is:

    +
    -  i32 (i32) asm "bswap $0", "=r,r"
    +i32 (i32) asm "bswap $0", "=r,r"
     
    +

    Inline assembler expressions may only be used as the callee operand of a call instruction. Thus, typically we have:

    +
    -  %X = call i32 asm "bswap $0", "=r,r"(i32 %Y)
    +%X = call i32 asm "bswap $0", "=r,r"(i32 %Y)
     
    +

    Inline asms with side effects not visible in the constraint list must be marked @@ -1528,9 +1615,11 @@ as having side effects. This is done through the use of the 'sideeffect' keyword, like so:

    +
    -  call void asm sideeffect "eieio", ""()
    +call void asm sideeffect "eieio", ""()
     
    +

    TODO: The format of the asm and constraints string still need to be documented here. Constraints on what can be done (e.g. duplication, moving, etc @@ -1881,7 +1970,8 @@ Both arguments must have identical types.

    The value produced is the integer or floating point difference of the two operands.

    Example:
    -
      <result> = sub i32 4, %var          ; yields {i32}:result = 4 - %var
    +
    +  <result> = sub i32 4, %var          ; yields {i32}:result = 4 - %var
       <result> = sub i32 0, %val          ; yields {i32}:result = -%var
     
    @@ -2527,11 +2617,11 @@ a pointer is returned.

       %array  = malloc [4 x i8 ]                    ; yields {[%4 x i8]*}:array
     
    -  %size   = add i32 2, 2                          ; yields {i32}:size = i32 4
    -  %array1 = malloc i8, i32 4                   ; yields {i8*}:array1
    -  %array2 = malloc [12 x i8], i32 %size        ; yields {[12 x i8]*}:array2
    -  %array3 = malloc i32, i32 4, align 1024         ; yields {i32*}:array3
    -  %array4 = malloc i32, align 1024                 ; yields {i32*}:array4
    +  %size   = add i32 2, 2                        ; yields {i32}:size = i32 4
    +  %array1 = malloc i8, i32 4                    ; yields {i8*}:array1
    +  %array2 = malloc [12 x i8], i32 %size         ; yields {[12 x i8]*}:array2
    +  %array3 = malloc i32, i32 4, align 1024       ; yields {i32*}:array3
    +  %array4 = malloc i32, align 1024              ; yields {i32*}:array4
     
    @@ -2616,8 +2706,8 @@ instructions), the memory is reclaimed.

       %ptr = alloca i32                              ; yields {i32*}:ptr
    -  %ptr = alloca i32, i32 4                      ; yields {i32*}:ptr
    -  %ptr = alloca i32, i32 4, align 1024          ; yields {i32*}:ptr
    +  %ptr = alloca i32, i32 4                       ; yields {i32*}:ptr
    +  %ptr = alloca i32, i32 4, align 1024           ; yields {i32*}:ptr
       %ptr = alloca i32, align 1024                  ; yields {i32*}:ptr
     
    @@ -2707,35 +2797,39 @@ be sign extended to 64-bit values.

    For example, let's consider a C code fragment and how it gets compiled to LLVM:

    +
    -  struct RT {
    -    char A;
    -    i32 B[10][20];
    -    char C;
    -  };
    -  struct ST {
    -    i32 X;
    -    double Y;
    -    struct RT Z;
    -  };
    -
    -  define i32 *foo(struct ST *s) {
    -    return &s[1].Z.B[5][13];
    -  }
    +struct RT {
    +  char A;
    +  int B[10][20];
    +  char C;
    +};
    +struct ST {
    +  int X;
    +  double Y;
    +  struct RT Z;
    +};
    +
    +int *foo(struct ST *s) {
    +  return &s[1].Z.B[5][13];
    +}
     
    +

    The LLVM code generated by the GCC frontend is:

    +
    -  %RT = type { i8 , [10 x [20 x i32]], i8  }
    -  %ST = type { i32, double, %RT }
    +%RT = type { i8 , [10 x [20 x i32]], i8  }
    +%ST = type { i32, double, %RT }
     
    -  define i32* %foo(%ST* %s) {
    -  entry:
    -    %reg = getelementptr %ST* %s, i32 1, i32 2, i32 1, i32 5, i32 13
    -    ret i32* %reg
    -  }
    +define i32* %foo(%ST* %s) {
    +entry:
    +  %reg = getelementptr %ST* %s, i32 1, i32 2, i32 1, i32 5, i32 13
    +  ret i32* %reg
    +}
     
    +
    Semantics:
    @@ -2862,10 +2956,7 @@ also be of integer type. The bit size of the
    Semantics:

    The zext fills the high order bits of the value with zero -bits until it reaches the size of the destination type, ty2. When the -the operand and the type are the same size, no bit filling is done and the -cast is considered a no-op cast because no bits change (only the type -changes).

    +bits until it reaches the size of the destination type, ty2.

    When zero extending from i1, the result will always be either 0 or 1.

    @@ -2902,9 +2993,7 @@ also be of integer type. The bit size of the

    The 'sext' instruction performs a sign extension by copying the sign bit (highest order bit) of the value until it reaches the bit size of -the type ty2. When the the operand and the type are the same size, -no bit filling is done and the cast is considered a no-op cast because -no bits change (only the type changes).

    +the type ty2.

    When sign extending from i1, the extension always results in -1 or 0.

    @@ -3097,7 +3186,7 @@ the value cannot fit in the floating point value, the results are undefined.

    Example:
       %X = uitofp i32 257 to float         ; yields float:257.0
    -  %Y = uitofp i8  -1 to double       ; yields double:255.0
    +  %Y = uitofp i8  -1 to double         ; yields double:255.0
     
    @@ -3129,7 +3218,7 @@ the value cannot fit in the floating point value, the results are undefined.

    Example:
       %X = sitofp i32 257 to float         ; yields float:257.0
    -  %Y = sitofp i8  -1 to double       ; yields double:-1.0
    +  %Y = sitofp i8  -1 to double         ; yields double:-1.0
     
    @@ -3159,12 +3248,13 @@ must be a pointer value, and a type to cast it to truncating or zero extending that value to the size of the integer type. If value is smaller than ty2 then a zero extension is done. If value is larger than ty2 then a truncation is done. If they -are the same size, then nothing is done (no-op cast).

    +are the same size, then nothing is done (no-op cast) other than a type +change.

    Example:
    -  %X = ptrtoint i32* %X to i8           ; yields truncation on 32-bit
    -  %Y = ptrtoint i32* %x to i64          ; yields zero extend on 32-bit
    +  %X = ptrtoint i32* %X to i8           ; yields truncation on 32-bit architecture
    +  %Y = ptrtoint i32* %x to i64          ; yields zero extension on 32-bit architecture
     
    @@ -3198,9 +3288,9 @@ nothing is done (no-op cast).

    Example:
    -  %X = inttoptr i32 255 to i32*            ; yields zero extend on 64-bit
    -  %X = inttoptr i32 255 to i32*            ; yields no-op on 32-bit 
    -  %Y = inttoptr i16 0 to i32*            ; yields zero extend on 32-bit
    +  %X = inttoptr i32 255 to i32*          ; yields zero extension on 64-bit architecture
    +  %X = inttoptr i32 255 to i32*          ; yields no-op on 32-bit architecture
    +  %Y = inttoptr i64 0 to i32*            ; yields truncation on 32-bit architecture
     
    @@ -3237,7 +3327,7 @@ other types, use the inttoptr or
    Example:
    -  %X = bitcast i8 255 to i8          ; yields i8 :-1
    +  %X = bitcast i8 255 to i8              ; yields i8 :-1
       %Y = bitcast i32* %x to sint*          ; yields sint*:%x
       %Z = bitcast <2xint> %V to i64;        ; yields i64: %V   
     
    @@ -3255,16 +3345,15 @@ instructions, which defy better classification.

    Syntax:
    -
      <result> = icmp <cond> <ty> <var1>, <var2>
    -; yields {i1}:result
    +
      <result> = icmp <cond> <ty> <var1>, <var2>   ; yields {i1}:result
     
    Overview:

    The 'icmp' instruction returns a boolean value based on comparison of its two integer operands.

    Arguments:

    The 'icmp' instruction takes three operands. The first operand is -the condition code which indicates the kind of comparison to perform. It is not -a value, just a keyword. The possibilities for the condition code are: +the condition code indicating the kind of comparison to perform. It is not +a value, just a keyword. The possible condition code are:

    1. eq: equal
    2. ne: not equal
    3. @@ -3307,7 +3396,7 @@ yields a i1 result, as follows: true if var1 is less than or equal to var2.

    If the operands are pointer typed, the pointer -values are treated as integers and then compared.

    +values are compared as if they were integers.

    Example:
      <result> = icmp eq i32 4, 5          ; yields: result=false
    @@ -3324,16 +3413,15 @@ values are treated as integers and then compared.

    Syntax:
    -
      <result> = fcmp <cond> <ty> <var1>, <var2>
    -; yields {i1}:result
    +
      <result> = fcmp <cond> <ty> <var1>, <var2>     ; yields {i1}:result
     
    Overview:

    The 'fcmp' instruction returns a boolean value based on comparison of its floating point operands.

    Arguments:

    The 'fcmp' instruction takes three operands. The first operand is -the condition code which indicates the kind of comparison to perform. It is not -a value, just a keyword. The possibilities for the condition code are: +the condition code indicating the kind of comparison to perform. It is not +a value, just a keyword. The possible condition code are:

    1. false: no comparison, always returns false
    2. oeq: ordered and equal
    3. @@ -3352,13 +3440,11 @@ a value, just a keyword. The possibilities for the condition code are:
    4. uno: unordered (either nans)
    5. true: no comparison, always returns true
    -

    In the preceding, ordered means that neither operand is a QNAN while +

    Ordered means that neither operand is a QNAN while unordered means that either operand may be a QNAN.

    The val1 and val2 arguments must be floating point typed. They must have identical types.

    -

    In the foregoing, ordered means that neither operand is a QNAN and -unordered means that either operand is a QNAN.

    Semantics:

    The 'fcmp' compares var1 and var2 according to the condition code given as cond. The comparison performed always @@ -3412,7 +3498,7 @@ Instruction

    The 'phi' instruction is used to implement the φ node in the SSA graph representing the function.

    Arguments:
    -

    The type of the incoming values are specified with the first type +

    The type of the incoming values is specified with the first type field. After this, the 'phi' instruction takes a list of pairs as arguments, with one pair for each predecessor basic block of the current block. Only values of first class @@ -3422,9 +3508,9 @@ may be used as the label arguments.

    block and the PHI instructions: i.e. PHI instructions must be first in a basic block.

    Semantics:
    -

    At runtime, the 'phi' instruction logically takes on the -value specified by the parameter, depending on which basic block we -came from in the last terminator instruction.

    +

    At runtime, the 'phi' instruction logically takes on the value +specified by the pair corresponding to the predecessor basic block that executed +just prior to the current block.

    Example:
    Loop:       ; Infinite loop that counts from 0 on up...
    %indvar = phi i32 [ 0, %LoopHeader ], [ %nextindvar, %Loop ]
    %nextindvar = add i32 %indvar, 1
    br label %Loop
    @@ -3539,7 +3625,7 @@ the invoke instruction.

       %retval = call i32 %test(i32 %argc)
    -  call i32(i8 *, ...) *%printf(i8 * %msg, i32 12, i8  42);
    +  call i32(i8 *, ...) *%printf(i8 * %msg, i32 12, i8 42);
       %X = tail call i32 %foo()
       %Y = tail call fastcc i32 %foo()
     
    @@ -3569,7 +3655,7 @@ the "variable argument" area of a function call. It is used to implement the

    This instruction takes a va_list* value and the type of the argument. It returns a value of the specified argument type and -increments the va_list to point to the next argument. Again, the +increments the va_list to point to the next argument. The actual type of va_list is target specific.

    Semantics:
    @@ -3603,24 +3689,24 @@ argument.

    LLVM supports the notion of an "intrinsic function". These functions have well known names and semantics and are required to follow certain restrictions. Overall, these intrinsics represent an extension mechanism for the LLVM -language that does not require changing all of the transformations in LLVM to -add to the language (or the bytecode reader/writer, the parser, -etc...).

    +language that does not require changing all of the transformations in LLVM when +adding to the language (or the bytecode reader/writer, the parser, etc...).

    Intrinsic function names must all start with an "llvm." prefix. This -prefix is reserved in LLVM for intrinsic names; thus, functions may not be named -this. Intrinsic functions must always be external functions: you cannot define -the body of intrinsic functions. Intrinsic functions may only be used in call -or invoke instructions: it is illegal to take the address of an intrinsic -function. Additionally, because intrinsic functions are part of the LLVM -language, it is required that they all be documented here if any are added.

    - -

    Some intrinsic functions can be overloaded. That is, the intrinsic represents +prefix is reserved in LLVM for intrinsic names; thus, function names may not +begin with this prefix. Intrinsic functions must always be external functions: +you cannot define the body of intrinsic functions. Intrinsic functions may +only be used in call or invoke instructions: it is illegal to take the address +of an intrinsic function. Additionally, because intrinsic functions are part +of the LLVM language, it is required if any are added that they be documented +here.

    + +

    Some intrinsic functions can be overloaded, i.e., the intrinsic represents a family of functions that perform the same operation but on different data types. This is most frequent with the integer types. Since LLVM can represent over 8 million different integer types, there is a way to declare an intrinsic -that can be overloaded based on its arguments. Such intrinsics will have the -names of the arbitrary types encoded into the intrinsic function name, each +that can be overloaded based on its arguments. Such an intrinsic will have the +names of its argument types encoded into its function name, each preceded by a period. For example, the llvm.ctpop function can take an integer of any width. This leads to a family of functions such as i32 @llvm.ctpop.i8(i8 %val) and i32 @llvm.ctpop.i29(i29 %val). @@ -3648,27 +3734,28 @@ named macros defined in the <stdarg.h> header file.

    All of these functions operate on arguments that use a target-specific value type "va_list". The LLVM assembly language reference manual does not define what this type is, so all -transformations should be prepared to handle intrinsics with any type -used.

    +transformations should be prepared to handle these functions regardless of +the type used.

    This example shows how the va_arg instruction and the variable argument handling intrinsic functions are used.

    +
     define i32 @test(i32 %X, ...) {
       ; Initialize variable argument processing
    -  %ap = alloca i8 *
    +  %ap = alloca i8*
       %ap2 = bitcast i8** %ap to i8*
       call void @llvm.va_start(i8* %ap2)
     
       ; Read a single integer argument
    -  %tmp = va_arg i8 ** %ap, i32
    +  %tmp = va_arg i8** %ap, i32
     
       ; Demonstrate usage of llvm.va_copy and llvm.va_end
    -  %aq = alloca i8 *
    +  %aq = alloca i8*
       %aq2 = bitcast i8** %aq to i8*
    -  call void @llvm.va_copy(i8 *%aq2, i8* %ap2)
    +  call void @llvm.va_copy(i8* %aq2, i8* %ap2)
       call void @llvm.va_end(i8* %aq2)
     
       ; Stop processing of arguments.
    @@ -3682,6 +3769,8 @@ declare void @llvm.va_end(i8*)
     
    + +
    'llvm.va_start' Intrinsic @@ -3704,10 +3793,10 @@ href="#i_va_arg">va_arg.

    The 'llvm.va_start' intrinsic works just like the va_start macro available in C. In a target-dependent way, it initializes the -va_list element the argument points to, so that the next call to +va_list element to which the argument points, so that the next call to va_arg will produce the first variable argument passed to the function. Unlike the C va_start macro, this intrinsic does not need to know the -last argument of the function, the compiler can figure that out.

    +last argument of the function as the compiler can figure that out.

    @@ -3721,21 +3810,22 @@ last argument of the function, the compiler can figure that out.

      declare void @llvm.va_end(i8* <arglist>)
    Overview:
    -

    The 'llvm.va_end' intrinsic destroys <arglist> +

    The 'llvm.va_end' intrinsic destroys *<arglist>, which has been initialized previously with llvm.va_start or llvm.va_copy.

    Arguments:
    -

    The argument is a va_list to destroy.

    +

    The argument is a pointer to a va_list to destroy.

    Semantics:

    The 'llvm.va_end' intrinsic works just like the va_end -macro available in C. In a target-dependent way, it destroys the va_list. -Calls to llvm.va_start and llvm.va_copy must be matched exactly -with calls to llvm.va_end.

    +macro available in C. In a target-dependent way, it destroys the +va_list element to which the argument points. Calls to llvm.va_start and +llvm.va_copy must be matched exactly with calls to +llvm.va_end.

    @@ -3754,8 +3844,8 @@ with calls to llvm.va_end.

    Overview:
    -

    The 'llvm.va_copy' intrinsic copies the current argument position from -the source argument list to the destination argument list.

    +

    The 'llvm.va_copy' intrinsic copies the current argument position +from the source argument list to the destination argument list.

    Arguments:
    @@ -3765,11 +3855,12 @@ The second argument is a pointer to a va_list element to copy from.

    Semantics:
    -

    The 'llvm.va_copy' intrinsic works just like the va_copy macro -available in C. In a target-dependent way, it copies the source -va_list element into the destination list. This intrinsic is necessary -because the llvm.va_start intrinsic may be -arbitrarily complex and require memory allocation, for example.

    +

    The 'llvm.va_copy' intrinsic works just like the va_copy +macro available in C. In a target-dependent way, it copies the source +va_list element into the destination va_list element. This +intrinsic is necessary because the +llvm.va_start intrinsic may be arbitrarily complex and require, for +example, memory allocation.

    @@ -4649,16 +4740,11 @@ only the %hiBit - %loBit bits set, as follows:

  • A mask of the retained bits is created by shifting a -1 value.
  • The mask is ANDed with %val to produce the result. -

    In reverse mode, a similar computation is made except that:

    -
      -
    1. The bits selected wrap around to include both the highest and lowest bits. - For example, part.select(i16 X, 4, 7) selects bits from X with a mask of - 0x00F0 (forwards case) while part.select(i16 X, 8, 3) selects bits from X - with a mask of 0xFF0F.
    2. -
    3. The bits returned in the reverse case are reversed. So, if X has the value - 0x6ACF and we apply part.select(i16 X, 8, 3) to it, we get back the value - 0x0A6F.
    4. -
    +

    In reverse mode, a similar computation is made except that the bits are +returned in the reverse order. So, for example, if X has the value +i16 0x0ACF (101011001111) and we apply +part.select(i16 X, 8, 3) to it, we get back the value +i16 0x0026 (000000100110).

    @@ -4699,15 +4785,15 @@ up to that size.

    are replaced with corresponding bits from %repl. That is the 0th bit in %repl replaces the %loth bit in %val and etc. up to the %hith bit. -

    In reverse mode, a similar computation is made except that the bits replaced -wrap around to include both the highest and lowest bits. For example, if a -16 bit value is being replaced then %lo=8 and %hi=4 would -cause these bits to be set: 0xFF1F.

    +

    In reverse mode, a similar computation is made except that the bits are +reversed. That is, the 0th bit in %repl replaces the +%hi bit in %val and etc. down to the %loth bit.

    Examples:
       llvm.part.set(0xFFFF, 0, 4, 7) -> 0xFF0F
    -  llvm.part.set(0xFFFF, 0, 7, 4) -> 0x0060
    -  llvm.part.set(0xFFFF, 0, 8, 3) -> 0x00F0
    +  llvm.part.set(0xFFFF, 0, 7, 4) -> 0xFF0F
    +  llvm.part.set(0xFFFF, 1, 7, 4) -> 0xFF8F
    +  llvm.part.set(0xFFFF, F, 8, 3) -> 0xFFE7
       llvm.part.set(0xFFFF, 0, 3, 8) -> 0xFE07
     
    @@ -4739,6 +4825,51 @@ href="ExceptionHandling.html#format_common_intrinsics">LLVM Exception Handling document.

    + + + +
    +

    This class of intrinsics is designed to be generic and has +no specific purpose.

    +
    + + + + +
    + +
    Syntax:
    +
    +  declare void @llvm.var.annotation(i8* <val>, i8* <str>, i8* <str>, i32  <int> )
    +
    + +
    Overview:
    + +

    +The 'llvm.var.annotation' intrinsic +

    + +
    Arguments:
    + +

    +The first argument is a pointer to a value, the second is a pointer to a +global string, the third is a pointer to a global string which is the source +file name, and the last argument is the line number. +

    + +
    Semantics:
    + +

    +This intrinsic allows annotation of local variables with arbitrary strings. +This can be useful for special purpose optimizations that want to look for these + annotations. These have no other defined use, they are ignored by code + generation and optimization. +

    +