X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FLangRef.html;h=9a093577025e1381da9c160d9bc9c87b3e743a88;hb=dc896a41182bec1b8f9a59ca5d81770c16bdacf1;hp=be2b93b5a033e2f0b85ae0dc3f1f1eb903fddae8;hpb=938443807150a1259283412bf8b89bd4141f9111;p=oota-llvm.git diff --git a/docs/LangRef.html b/docs/LangRef.html index be2b93b5a03..9a093577025 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -5,7 +5,7 @@ LLVM Assembly Language Reference Manual - @@ -43,18 +43,20 @@
  • Global Variables
  • Functions
  • Aliases
  • +
  • Named Metadata
  • Parameter Attributes
  • Function Attributes
  • Garbage Collector Names
  • Module-Level Inline Assembly
  • Data Layout
  • Pointer Aliasing Rules
  • +
  • Volatile Memory Accesses
  • Type System
    1. Type Classifications
    2. -
    3. Primitive Types +
    4. Primitive Types
      1. Integer Type
      2. Floating Point Types
      3. @@ -65,12 +67,17 @@
      4. Derived Types
          -
        1. Array Type
        2. +
        3. Aggregate Types +
            +
          1. Array Type
          2. +
          3. Structure Type
          4. +
          5. Packed Structure Type
          6. +
          7. Union Type
          8. +
          9. Vector Type
          10. +
          +
        4. Function Type
        5. Pointer Type
        6. -
        7. Structure Type
        8. -
        9. Packed Structure Type
        10. -
        11. Vector Type
        12. Opaque Type
      5. @@ -83,14 +90,15 @@
      6. Complex Constants
      7. Global Variable and Function Addresses
      8. Undefined Values
      9. +
      10. Trap Values
      11. Addresses of Basic Blocks
      12. Constant Expressions
      13. -
      14. Embedded Metadata
    5. Other Values
      1. Inline Assembler Expressions
      2. +
      3. Metadata Nodes and Metadata Strings
    6. Intrinsic Global Variables @@ -249,6 +257,12 @@
    7. 'llvm.umul.with.overflow.* Intrinsics
  • +
  • Half Precision Floating Point Intrinsics +
      +
    1. 'llvm.convert.to.fp16' Intrinsic
    2. +
    3. 'llvm.convert.from.fp16' Intrinsic
    4. +
    +
  • Debugger intrinsics
  • Exception Handling intrinsics
  • Trampoline Intrinsic @@ -291,6 +305,8 @@ 'llvm.trap' Intrinsic
  • 'llvm.stackprotector' Intrinsic
  • +
  • + 'llvm.objectsize' Intrinsic
  • @@ -496,14 +512,19 @@ define i32 @main() { ; i32()* ; Call puts function to write out the string to stdout. call i32 @puts(i8 * %cast210) ; i32 - ret i32 0
    }
    + ret i32 0
    } + +; Named metadata +!1 = metadata !{i32 41} +!foo = !{!1, null}

    This example is made up of a global variable named - ".LC0", an external declaration of the "puts" function, and + ".LC0", an external declaration of the "puts" function, a function definition for - "main".

    + "main" and named metadata + "foo".

    In general, a module is made up of a list of global values, where both functions and global variables are global values. Global values are @@ -556,10 +577,17 @@ define i32 @main() { ; i32()*

    linkonce
    Globals with "linkonce" linkage are merged with other globals of - the same name when linkage occurs. This is typically used to implement - inline functions, templates, or other code which must be generated in each - translation unit that uses it. Unreferenced linkonce globals are - allowed to be discarded.
    + the same name when linkage occurs. This can be used to implement + some forms of inline functions, templates, or other code which must be + generated in each translation unit that uses it, but where the body may + be overridden with a more definitive definition later. Unreferenced + linkonce globals are allowed to be discarded. Note that + linkonce linkage does not actually allow the optimizer to + inline the body of this function into callers because it doesn't know if + this definition of the function is the definitive definition within the + program or whether it will be overridden by a stronger definition. + To enable inlining and other optimizations, use "linkonce_odr" + linkage.
    weak
    "weak" linkage has the same merging semantics as @@ -574,7 +602,7 @@ define i32 @main() { ; i32()* Symbols with "common" linkage are merged in the same way as weak symbols, and they may not be deleted if unreferenced. common symbols may not have an explicit section, - must have a zero initializer, and may not be marked 'constant'. Functions and aliases may not have common linkage.
    @@ -669,11 +697,11 @@ define i32 @main() { ; i32()* (e.g. by passing things in registers). This calling convention allows the target to use whatever tricks it wants to produce fast code for the target, without having to conform to an externally specified ABI - (Application Binary Interface). Implementations of this convention should - allow arbitrary tail call - optimization to be supported. This calling convention does not - support varargs and requires the prototype of all callees to exactly match - the prototype of the function definition. + (Application Binary Interface). + Tail calls can only be optimized + when this or the GHC convention is used. This calling convention + does not support varargs and requires the prototype of all callees to + exactly match the prototype of the function definition.
    "coldcc" - The cold calling convention:
    This calling convention attempts to make code in the caller as efficient @@ -683,6 +711,26 @@ define i32 @main() { ; i32()* does not support varargs and requires the prototype of all callees to exactly match the prototype of the function definition.
    +
    "cc 10" - GHC convention:
    +
    This calling convention has been implemented specifically for use by the + Glasgow Haskell Compiler (GHC). + It passes everything in registers, going to extremes to achieve this by + disabling callee save registers. This calling convention should not be + used lightly but only for specific situations such as an alternative to + the register pinning performance technique often used when + implementing functional programming languages.At the moment only X86 + supports this convention and it has the following limitations: + + This calling convention supports + tail call optimization but + requires both the caller and callee are using it. +
    +
    "cc <n>" - Numbered convention:
    Any calling convention may be specified by number, allowing target-specific calling conventions to be used. Target specific calling @@ -803,11 +851,15 @@ define i32 @main() { ; i32()*

    LLVM allows an explicit section to be specified for globals. If the target supports it, it will emit globals to the section specified.

    -

    An explicit alignment may be specified for a global. If not present, or if - the alignment is set to zero, the alignment of the global is set by the - target to whatever it feels convenient. If an explicit alignment is - specified, the global is forced to have at least that much alignment. All - alignments must be a power of 2.

    +

    An explicit alignment may be specified for a global, which must be a power + of 2. If not present, or if the alignment is set to zero, the alignment of + the global is set by the target to whatever it feels convenient. If an + explicit alignment is specified, the global is forced to have exactly that + alignment. Targets and optimizers are not allowed to over-align the global + if the global has an assigned section. In this case, the extra alignment + could be observable: for example, code could assume that the globals are + densely packed in their section and try to iterate over them as an array, + alignment padding would break this iteration.

    For example, the following defines a global in a numbered address space with an initializer, section, and alignment:

    @@ -828,7 +880,7 @@ define i32 @main() { ; i32()*
    -

    LLVM function definitions consist of the "define" keyord, an +

    LLVM function definitions consist of the "define" keyword, an optional linkage type, an optional visibility style, an optional calling convention, a return type, an optional @@ -841,7 +893,7 @@ define i32 @main() { ; i32()*

    LLVM function declarations consist of the "declare" keyword, an optional linkage type, an optional - visibility style, an optional + visibility style, an optional calling convention, a return type, an optional parameter attribute for the return type, a function name, a possibly empty list of arguments, an optional alignment, and an @@ -902,6 +954,27 @@ define [linkage] [visibility]

    + +
    + Named Metadata +
    + +
    + +

    Named metadata is a collection of metadata. Metadata + nodes (but not metadata strings) and null are the only valid operands for + a named metadata.

    + +
    Syntax:
    +
    +
    +!1 = metadata !{metadata !"one"}
    +!name = !{null, !1}
    +
    +
    + +
    +
    Parameter Attributes
    @@ -1042,6 +1115,11 @@ define void @f() optsize { ... }
    +
    alignstack(<n>)
    +
    This attribute indicates that, when emitting the prologue and epilogue, + the backend should forcibly align the stack pointer. Specify the + desired alignment, which must be a power of two, in parentheses. +
    alwaysinline
    This attribute indicates that the inliner should attempt to inline this function into callers whenever possible, ignoring any active inlining size @@ -1190,7 +1268,7 @@ target datalayout = "layout specification" location.
    p:size:abi:pref
    -
    This specifies the size of a pointer and its abi and +
    This specifies the size of a pointer and its abi and preferred alignments. All sizes are in bits. Specifying the pref alignment is optional. If omitted, the preceding : should be omitted too.
    @@ -1200,11 +1278,11 @@ target datalayout = "layout specification" size. The value of size must be in the range [1,2^23).
    vsize:abi:pref
    -
    This specifies the alignment for a vector type of a given bit +
    This specifies the alignment for a vector type of a given bit size.
    fsize:abi:pref
    -
    This specifies the alignment for a floating point type of a given bit +
    This specifies the alignment for a floating point type of a given bit size. The value of size must be either 32 (float) or 64 (double).
    @@ -1220,18 +1298,18 @@ target datalayout = "layout specification"
    This specifies a set of native integer widths for the target CPU in bits. For example, it might contain "n32" for 32-bit PowerPC, "n32:64" for PowerPC 64, or "n8:16:32:64" for X86-64. Elements of - this set are considered to support most general arithmetic + this set are considered to support most general arithmetic operations efficiently.

    When constructing the data layout for a given target, LLVM starts with a - default set of specifications which are then (possibly) overriden by the + default set of specifications which are then (possibly) overridden by the specifications in the datalayout keyword. The default specifications are given in this list: