From b2f21fb044b6b5c52cff6227f9f79ca4ed42b18f Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Mon, 22 Jun 2009 08:08:12 +0000 Subject: Update LLVM sources to r73879. --- docs/CodeGenerator.html | 4 +- docs/CommandLine.html | 19 +++--- docs/CompilerDriver.html | 121 +++++++++++++++++++++------------- docs/CompilerDriverTutorial.html | 21 +++--- docs/DeveloperPolicy.html | 4 +- docs/LangRef.html | 24 +++---- docs/MakefileGuide.html | 20 ++---- docs/ProgrammersManual.html | 138 +++++++++++++++++++++++++++++++++++++-- docs/WritingAnLLVMPass.html | 4 +- 9 files changed, 253 insertions(+), 102 deletions(-) (limited to 'docs') diff --git a/docs/CodeGenerator.html b/docs/CodeGenerator.html index 7fada98278d4..25101fc31bf6 100644 --- a/docs/CodeGenerator.html +++ b/docs/CodeGenerator.html @@ -1773,6 +1773,8 @@ define fastcc i32 @tailcaller(i32 %in1, i32 %in2) {
  • i386-pc-mingw32msvc — MingW crosscompiler on Linux
  • i686-apple-darwin* — Apple Darwin on X86
  • + +
  • x86_64-unknown-linux-gnu — Linux
  • @@ -2116,7 +2118,7 @@ MOVSX32rm16 -> movsx, 32-bit register, 16-bit memory Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2009-05-13 23:33:08 +0200 (Wed, 13 May 2009) $ + Last modified: $Date: 2009-06-15 12:17:44 +0000 (Mon, 15 Jun 2009) $ diff --git a/docs/CommandLine.html b/docs/CommandLine.html index c4e567b43020..d6cf48ce5111 100644 --- a/docs/CommandLine.html +++ b/docs/CommandLine.html @@ -1116,9 +1116,9 @@ command-line parser sees cl::init, it knows where to put the initial value. (You will get an error at runtime if you don't put them in the right order.) -
  • The cl::location attribute where to -store the value for a parsed command line option if using external storage. See -the section on Internal vs External Storage for more +
  • The cl::location attribute where +to store the value for a parsed command line option if using external storage. +See the section on Internal vs External Storage for more information.
  • The cl::aliasopt attribute @@ -1146,6 +1146,11 @@ specify macro options where the option name doesn't equal the enum name. For this macro, the first argument is the enum value, the second is the flag name, and the second is the description.
  • + + +You will get a compile time error if you try to use cl::values with a parser +that does not support it. +
  • The cl::multi_val attribute specifies that this option takes has multiple values (example: -sectalign segname sectname sectvalue). This @@ -1156,12 +1161,6 @@ types). It is allowed to use all of the usual modifiers on multi-valued options (besides cl::ValueDisallowed, obviously).
  • - - - -You will get a compile time error if you try to use cl::values with a parser -that does not support it. - @@ -1973,7 +1972,7 @@ tutorial.

    Chris Lattner
    LLVM Compiler Infrastructure
    - Last modified: $Date: 2009-04-08 05:43:51 +0200 (Wed, 08 Apr 2009) $ + Last modified: $Date: 2009-06-17 03:09:39 +0000 (Wed, 17 Jun 2009) $ diff --git a/docs/CompilerDriver.html b/docs/CompilerDriver.html index ab436974b531..5b42148bdb3b 100644 --- a/docs/CompilerDriver.html +++ b/docs/CompilerDriver.html @@ -21,21 +21,22 @@ The ReST source lives in the directory 'tools/llvmc/doc'. -->
  • Compiling with LLVMC
  • Predefined options
  • Compiling LLVMC plugins
  • -
  • Customizing LLVMC: the compilation graph
  • -
  • Describing options
    -

    Actions

    +

    Actions

    A tool often needs to react to command-line options, and this is precisely what the actions property is for. The next example illustrates this feature:

    @@ -515,7 +542,7 @@ Example: (unpack_values
    -

    Language map

    +

    Language map

    If you are adding support for a new language to LLVMC, you'll need to modify the language map, which defines mappings from file extensions to language names. It is used to choose the proper toolchain(s) for a @@ -538,9 +565,9 @@ multiple output languages, for nodes "inside" the graph the input and output languages should match. This is enforced at compile-time.

    -

    More advanced topics

    +

    More advanced topics

    -

    Hooks and environment variables

    +

    Hooks and environment variables

    Normally, LLVMC executes programs from the system PATH. Sometimes, this is not sufficient: for example, we may want to specify tool paths or names in the configuration file. This can be easily achieved via @@ -573,7 +600,7 @@ the case expression (

    -

    How plugins are loaded

    +

    How plugins are loaded

    It is possible for LLVMC plugins to depend on each other. For example, one can create edges between nodes defined in some other plugin. To make this work, however, that plugin should be loaded first. To @@ -589,7 +616,7 @@ with 0. Therefore, the plugin with the highest priority value will be loaded last.

    -

    Debugging

    +

    Debugging

    When writing LLVMC plugins, it can be useful to get a visual view of the resulting compilation graph. This can be achieved via the command line option --view-graph. This command assumes that Graphviz and @@ -615,7 +642,7 @@ errors as its status code.

    Mikhail Glushenkov
    LLVM Compiler Infrastructure
    -Last modified: $Date: 2009-05-06 03:41:47 +0200 (Wed, 06 May 2009) $ +Last modified: $Date: 2009-06-17 02:56:48 +0000 (Wed, 17 Jun 2009) $
    diff --git a/docs/CompilerDriverTutorial.html b/docs/CompilerDriverTutorial.html index a57801737957..317b1d127127 100644 --- a/docs/CompilerDriverTutorial.html +++ b/docs/CompilerDriverTutorial.html @@ -48,23 +48,28 @@ command-line LLVMC usage, refer to the

    Using LLVMC to generate toolchain drivers

    -

    LLVMC plugins are written mostly using TableGen, so you need to +

    LLVMC plugins are written mostly using TableGen, so you need to be familiar with it to get anything done.

    -

    Start by compiling plugins/Simple/Simple.td, which is a primitive -wrapper for gcc:

    +

    Start by compiling example/Simple, which is a primitive wrapper for +gcc:

     $ cd $LLVM_DIR/tools/llvmc
    -$ make DRIVER_NAME=mygcc BUILTIN_PLUGINS=Simple
    +$ cp -r example/Simple plugins/Simple
    +
    +  # NB: A less verbose way to compile standalone LLVMC-based drivers is
    +  # described in the reference manual.
    +
    +$ make LLVMC_BASED_DRIVER_NAME=mygcc LLVMC_BUILTIN_PLUGINS=Simple
     $ cat > hello.c
     [...]
     $ mygcc hello.c
     $ ./hello.out
     Hello
     
    -

    Here we link our plugin with the LLVMC core statically to form an -executable file called mygcc. It is also possible to build our -plugin as a standalone dynamic library; this is described in the -reference manual.

    +

    Here we link our plugin with the LLVMC core statically to form an executable +file called mygcc. It is also possible to build our plugin as a dynamic +library to be loaded by the llvmc executable (or any other LLVMC-based +standalone driver); this is described in the reference manual.

    Contents of the file Simple.td look like this:

     // Include common definitions
    diff --git a/docs/DeveloperPolicy.html b/docs/DeveloperPolicy.html
    index 34d201810d00..13a908e5a9d3 100644
    --- a/docs/DeveloperPolicy.html
    +++ b/docs/DeveloperPolicy.html
    @@ -108,7 +108,7 @@
       
  • Patches should be made with this command:
    -svn diff -x -u
    +svn diff
     
    or with the utility utils/mkpatch, which makes it easy to read @@ -592,7 +592,7 @@ Changes
  • Written by the LLVM Oversight Group
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2009-04-05 14:38:44 +0200 (Sun, 05 Apr 2009) $ + Last modified: $Date: 2009-06-15 04:18:54 +0000 (Mon, 15 Jun 2009) $ diff --git a/docs/LangRef.html b/docs/LangRef.html index 897654df9569..f229150ea300 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -1106,8 +1106,9 @@ an ssp attribute, then the resulting function will have an sspreq attribute.
    noredzone
    -
    This attribute indicates that the code generator should not enforce red zone -mandated by target specific ABI.
    +
    This attribute indicates that the code generator should not use a +red zone, even if the target-specific ABI normally permits it. +
    noimplicitfloat
    This attributes disables implicit floating point instructions.
    @@ -3531,9 +3532,10 @@ address space (address space zero).

    bytes of memory from the operating system and returns a pointer of the appropriate type to the program. If "NumElements" is specified, it is the number of elements allocated, otherwise "NumElements" is defaulted to be one. -If a constant alignment is specified, the value result of the allocation is guaranteed to -be aligned to at least that boundary. If not specified, or if zero, the target can -choose to align the allocation on any convenient boundary.

    +If a constant alignment is specified, the value result of the allocation is +guaranteed to be aligned to at least that boundary. If not specified, or if +zero, the target can choose to align the allocation on any convenient boundary +compatible with the type.

    'type' must be a sized type.

    @@ -3624,9 +3626,10 @@ space (address space zero).

    bytes of memory on the runtime stack, returning a pointer of the appropriate type to the program. If "NumElements" is specified, it is the number of elements allocated, otherwise "NumElements" is defaulted to be one. -If a constant alignment is specified, the value result of the allocation is guaranteed -to be aligned to at least that boundary. If not specified, or if zero, the target -can choose to align the allocation on any convenient boundary.

    +If a constant alignment is specified, the value result of the allocation is +guaranteed to be aligned to at least that boundary. If not specified, or if +zero, the target can choose to align the allocation on any convenient boundary +compatible with the type.

    'type' may be any sized type.

    @@ -6428,9 +6431,6 @@ on any integer bit width.

    Overview:
    -

    Warning: 'llvm.umul.with.overflow' is badly broken. It is -actively being fixed, but it should not currently be used!

    -

    The 'llvm.umul.with.overflow' family of intrinsic functions perform a unsigned multiplication of the two arguments, and indicate whether an overflow occurred during the unsigned multiplication.

    @@ -7221,7 +7221,7 @@ declare void @llvm.stackprotector( i8* <guard>, i8** <slot> ) Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2009-06-12 21:45:19 +0200 (Fri, 12 Jun 2009) $ + Last modified: $Date: 2009-06-20 13:26:06 +0000 (Sat, 20 Jun 2009) $ diff --git a/docs/MakefileGuide.html b/docs/MakefileGuide.html index a5e78efac807..39a04f7c84d1 100644 --- a/docs/MakefileGuide.html +++ b/docs/MakefileGuide.html @@ -232,17 +232,16 @@ Normally, the makefile system will build all the software into a single libname.o (pre-linked) object. This means the library is not searchable and that the distinction between compilation units has been - dissolved. Optionally, you can ask for a shared library (.so), archive library - (.a) or to not have the default (relinked) library built. For example:

    + dissolved. Optionally, you can ask for a shared library (.so) or archive + library (.a) built. Archive libraries are the default. For example:

    
           LIBRARYNAME = mylib
           SHARED_LIBRARY = 1
           ARCHIVE_LIBRARY = 1
    -      DONT_BUILD_RELINKED = 1
       

    says to build a library named "mylib" with both a shared library - (mylib.so) and an archive library (mylib.a) version but - not to build the relinked object (mylib.o). The contents of all the + (mylib.so) and an archive library (mylib.a) version. The + contents of all the libraries produced will be the same, they are just constructed differently. Note that you normally do not need to specify the sources involved. The LLVM Makefile system will infer the source files from the contents of the source @@ -307,8 +306,6 @@ on.

  • The LINK_LIBS_IN_SHARED variable is turned on.
  • -
  • The DONT_BUILD_RELINKED variable - is turned on.
  • A loadable module is loaded by LLVM via the facilities of libtool's libltdl library which is part of lib/System implementation.

    @@ -637,11 +634,6 @@
    If set to any value, causes the makefiles to not automatically generate dependencies when running the compiler. Use of this feature is discouraged and it may be removed at a later date.
    -
    DONT_BUILD_RELINKED
    -
    If set to any value, causes a relinked library (.o) not to be built. By - default, libraries are built as re-linked since most LLVM libraries are - needed in their entirety and re-linked libraries will be linked more quickly - than equivalent archive libraries.
    ENABLE_OPTIMIZED
    If set to any value, causes the build to generate optimized objects, libraries and executables. This alters the flags specified to the compilers @@ -960,7 +952,6 @@ DestArchiveLib DestBitcodeLib DestModule - DestRelinkedLib DestSharedLib DestTool DistAlways @@ -1004,7 +995,6 @@ ProjUsedLibs Ranlib RecursiveTargets - Relink SrcMakefiles Strip StripWarnMsg @@ -1026,7 +1016,7 @@ Reid Spencer
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2009-04-26 00:08:52 +0200 (Sun, 26 Apr 2009) $ + Last modified: $Date: 2009-06-16 23:00:42 +0000 (Tue, 16 Jun 2009) $ diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html index e7b2ad0b80fd..b45a60b7611d 100644 --- a/docs/ProgrammersManual.html +++ b/docs/ProgrammersManual.html @@ -2,6 +2,7 @@ "http://www.w3.org/TR/html4/strict.dtd"> + LLVM Programmer's Manual @@ -129,6 +130,15 @@ with another Value +
  • Threads and LLVM + +
  • +
  • Advanced Topics
    • LLVM Type Resolution @@ -176,8 +186,9 @@ with another Value
    • Written by Chris Lattner, Dinakar Dhurjati, Gabor Greif, - Joel Stanley and - Reid Spencer

      + Joel Stanley, + Reid Spencer and + Owen Anderson

      @@ -2118,7 +2129,7 @@ FunctionType *ft = TypeBuilder<types::i<8>(types::i<32>*), true&g
      -std::vector params;
      +std::vector<const Type*> params;
       params.push_back(PointerType::getUnqual(Type::Int32Ty));
       FunctionType *ft = FunctionType::get(Type::Int8Ty, params, false);
       
      @@ -2129,6 +2140,123 @@ comment for more details.

      + + + + +
      +

      +This section describes the interaction of the LLVM APIs with multithreading, +both on the part of client applications, and in the JIT, in the hosted +application. +

      + +

      +Note that LLVM's support for multithreading is still relatively young. Up +through version 2.5, the execution of threaded hosted applications was +supported, but not threaded client access to the APIs. While this use case is +now supported, clients must adhere to the guidelines specified below to +ensure proper operation in multithreaded mode. +

      + +

      +Note that, on Unix-like platforms, LLVM requires the presence of GCC's atomic +intrinsics in order to support threaded operation. If you need a +multhreading-capable LLVM on a platform without a suitably modern system +compiler, consider compiling LLVM and LLVM-GCC in single-threaded mode, and +using the resultant compiler to build a copy of LLVM with multithreading +support. +

      +
      + + + + +
      + +

      +In order to properly protect its internal data structures while avoiding +excessive locking overhead in the single-threaded case, the LLVM must intialize +certain data structures necessary to provide guards around its internals. To do +so, the client program must invoke llvm_start_multithreaded() before +making any concurrent LLVM API calls. To subsequently tear down these +structures, use the llvm_stop_multithreaded() call. You can also use +the llvm_is_multithreaded() call to check the status of multithreaded +mode. +

      + +

      +Note that both of these calls must be made in isolation. That is to +say that no other LLVM API calls may be executing at any time during the +execution of llvm_start_multithreaded() or llvm_stop_multithreaded +. It's is the client's responsibility to enforce this isolation. +

      + +

      +The return value of llvm_start_multithreaded() indicates the success or +failure of the initialization. Failure typically indicates that your copy of +LLVM was built without multithreading support, typically because GCC atomic +intrinsics were not found in your system compiler. In this case, the LLVM API +will not be safe for concurrent calls. However, it will be safe for +hosting threaded applications in the JIT, though care must be taken to ensure +that side exits and the like do not accidentally result in concurrent LLVM API +calls. +

      +
      + + + + +
      +

      +When you are done using the LLVM APIs, you should call llvm_shutdown() +to deallocate memory used for internal structures. This will also invoke +llvm_stop_multithreaded() if LLVM is operating in multithreaded mode. +As such, llvm_shutdown() requires the same isolation guarantees as +llvm_stop_multithreaded(). +

      + +

      +Note that, if you use scope-based shutdown, you can use the +llvm_shutdown_obj class, which calls llvm_shutdown() in its +destructor. +

      + + + + +
      +

      +ManagedStatic is a utility class in LLVM used to implement static +initialization of static resources, such as the global type tables. Before the +invocation of llvm_shutdown(), it implements a simple lazy +initialization scheme. Once llvm_start_multithreaded() returns, +however, it uses double-checked locking to implement thread-safe lazy +initialization. +

      + +

      +Note that, because no other threads are allowed to issue LLVM API calls before +llvm_start_multithreaded() returns, it is possible to have +ManagedStatics of llvm::sys::Mutexs. +

      + +

      +The llvm_acquire_global_lock() and llvm_release_global_lock +APIs provide access to the global lock used to implement the double-checked +locking for lazy initialization. These should only be used internally to LLVM, +and only if you know what you're doing! +

      +
      +
      Advanced Topics @@ -3430,7 +3558,7 @@ never change at runtime).

      #include "llvm/BasicBlock.h"
      -doxygen info: BasicBlock +doxygen info: BasicBlock Class
      Superclass: Value

      @@ -3536,7 +3664,7 @@ arguments. An argument has a pointer to the parent Function.

      Dinakar Dhurjati and Chris Lattner
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2009-05-01 22:40:51 +0200 (Fri, 01 May 2009) $ + Last modified: $Date: 2009-06-17 21:12:26 +0000 (Wed, 17 Jun 2009) $ diff --git a/docs/WritingAnLLVMPass.html b/docs/WritingAnLLVMPass.html index a039f619c9da..b1b2c7874ed2 100644 --- a/docs/WritingAnLLVMPass.html +++ b/docs/WritingAnLLVMPass.html @@ -1537,7 +1537,7 @@ need some way to free analysis results when they are no longer useful. The

      If you are writing an analysis or any other pass that retains a significant amount of state (for use by another pass which "requires" your pass and uses the getAnalysis method) you should implement -releaseMEmory to, well, release the memory allocated to maintain this +releaseMemory to, well, release the memory allocated to maintain this internal state. This method is called after the run* method for the class, before the next call of run* in your pass.

      @@ -1821,7 +1821,7 @@ Despite that, we have kept the LLVM passes SMP ready, and you should too.

      Chris Lattner
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2009-02-18 06:09:16 +0100 (Wed, 18 Feb 2009) $ + Last modified: $Date: 2009-06-15 18:22:49 +0000 (Mon, 15 Jun 2009) $ -- cgit v1.2.3