diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/AliasAnalysis.html | 88 | ||||
-rw-r--r-- | docs/CodeGenerator.html | 28 | ||||
-rw-r--r-- | docs/DebuggingJITedCode.html | 135 | ||||
-rw-r--r-- | docs/ExceptionHandling.html | 6 | ||||
-rw-r--r-- | docs/FAQ.html | 4 | ||||
-rw-r--r-- | docs/GetElementPtr.html | 8 | ||||
-rw-r--r-- | docs/GettingStarted.html | 8 | ||||
-rw-r--r-- | docs/HowToReleaseLLVM.html | 14 | ||||
-rw-r--r-- | docs/LangRef.html | 557 | ||||
-rw-r--r-- | docs/MakefileGuide.html | 4 | ||||
-rw-r--r-- | docs/Passes.html | 708 | ||||
-rw-r--r-- | docs/SourceLevelDebugging.html | 35 | ||||
-rw-r--r-- | docs/TableGenFundamentals.html | 121 | ||||
-rw-r--r-- | docs/WritingAnLLVMBackend.html | 8 | ||||
-rw-r--r-- | docs/WritingAnLLVMPass.html | 27 | ||||
-rw-r--r-- | docs/tutorial/LangImpl3.html | 20 | ||||
-rw-r--r-- | docs/tutorial/LangImpl4.html | 14 | ||||
-rw-r--r-- | docs/tutorial/LangImpl5.html | 10 | ||||
-rw-r--r-- | docs/tutorial/LangImpl6.html | 16 | ||||
-rw-r--r-- | docs/tutorial/LangImpl7.html | 20 | ||||
-rw-r--r-- | docs/tutorial/OCamlLangImpl3.html | 14 | ||||
-rw-r--r-- | docs/tutorial/OCamlLangImpl4.html | 8 | ||||
-rw-r--r-- | docs/tutorial/OCamlLangImpl5.html | 4 | ||||
-rw-r--r-- | docs/tutorial/OCamlLangImpl6.html | 4 | ||||
-rw-r--r-- | docs/tutorial/OCamlLangImpl7.html | 14 |
25 files changed, 1175 insertions, 700 deletions
diff --git a/docs/AliasAnalysis.html b/docs/AliasAnalysis.html index 0413622..a23d908 100644 --- a/docs/AliasAnalysis.html +++ b/docs/AliasAnalysis.html @@ -31,6 +31,7 @@ <li><a href="#chaining"><tt>AliasAnalysis</tt> chaining behavior</a></li> <li><a href="#updating">Updating analysis results for transformations</a></li> <li><a href="#implefficiency">Efficiency Issues</a></li> + <li><a href="#passmanager">Pass Manager Issues</a></li> </ul> </li> @@ -116,6 +117,11 @@ as the actual <tt>call</tt> or <tt>invoke</tt> instructions that performs the call. The <tt>AliasAnalysis</tt> interface also exposes some helper methods which allow you to get mod/ref information for arbitrary instructions.</p> +<p>All <tt>AliasAnalysis</tt> interfaces require that in queries involving +multiple values, values which are not +<a href="LangRef.html#constants">constants</a> are all defined within the +same function.</p> + </div> <!-- ======================================================================= --> @@ -180,9 +186,13 @@ that the accesses alias.</p> </div> <div class="doc_text"> -The <tt>alias</tt> method is the primary interface used to determine whether or -not two memory objects alias each other. It takes two memory objects as input -and returns MustAlias, MayAlias, or NoAlias as appropriate. +<p>The <tt>alias</tt> method is the primary interface used to determine whether +or not two memory objects alias each other. It takes two memory objects as +input and returns MustAlias, MayAlias, or NoAlias as appropriate.</p> + +<p>Like all <tt>AliasAnalysis</tt> interfaces, the <tt>alias</tt> method requires +that either the two pointer values be defined within the same function, or at +least one of the values is a <a href="LangRef.html#constants">constant</a>.</p> </div> <!-- _______________________________________________________________________ --> @@ -191,12 +201,18 @@ and returns MustAlias, MayAlias, or NoAlias as appropriate. </div> <div class="doc_text"> -<p>The NoAlias response is used when the two pointers refer to distinct objects, -regardless of whether the pointers compare equal. For example, freed pointers -don't alias any pointers that were allocated afterwards. As a degenerate case, -pointers returned by malloc(0) have no bytes for an object, and are considered -NoAlias even when malloc returns the same pointer. The same rule applies to -NULL pointers.</p> +<p>The NoAlias response may be used when there is never an immediate dependence +between any memory reference <i>based</i> on one pointer and any memory +reference <i>based</i> the other. The most obvious example is when the two +pointers point to non-overlapping memory ranges. Another is when the two +pointers are only ever used for reading memory. Another is when the memory is +freed and reallocated between accesses through one pointer and accesses through +the other -- in this case, there is a dependence, but it's mediated by the free +and reallocation.</p> + +<p>As an exception to this is with the +<a href="LangRef.html#noalias"><tt>noalias</tt></a> keyword; the "irrelevant" +dependencies are ignored.</p> <p>The MayAlias response is used whenever the two pointers might refer to the same object. If the two memory objects overlap, but do not start at the same @@ -502,6 +518,45 @@ method as possible (within reason).</p> </div> +<!-- ======================================================================= --> +<div class="doc_subsection"> + <a name="passmanager">Pass Manager Issues</a> +</div> + +<div class="doc_text"> + +<p>PassManager support for alternative AliasAnalysis implementation +has some issues.</p> + +<p>There is no way to override the default alias analysis. It would +be very useful to be able to do something like "opt -my-aa -O2" and +have it use -my-aa for all passes which need AliasAnalysis, but there +is currently no support for that, short of changing the source code +and recompiling. Similarly, there is also no way of setting a chain +of analyses as the default.</p> + +<p>There is no way for transform passes to declare that they preserve +<tt>AliasAnalysis</tt> implementations. The <tt>AliasAnalysis</tt> +interface includes <tt>deleteValue</tt> and <tt>copyValue</tt> methods +which are intended to allow a pass to keep an AliasAnalysis consistent, +however there's no way for a pass to declare in its +<tt>getAnalysisUsage</tt> that it does so. Some passes attempt to use +<tt>AU.addPreserved<AliasAnalysis></tt>, however this doesn't +actually have any effect.</tt> + +<p><tt>AliasAnalysisCounter</tt> (<tt>-count-aa</tt>) and <tt>AliasDebugger</tt> +(<tt>-debug-aa</tt>) are implemented as <tt>ModulePass</tt> classes, so if your +alias analysis uses <tt>FunctionPass</tt>, it won't be able to use +these utilities. If you try to use them, the pass manager will +silently route alias analysis queries directly to +<tt>BasicAliasAnalysis</tt> instead.</p> + +<p>Similarly, the <tt>opt -p</tt> option introduces <tt>ModulePass</tt> +passes between each pass, which prevents the use of <tt>FunctionPass</tt> +alias analysis passes.</p> + +</div> + <!-- *********************************************************************** --> <div class="doc_section"> <a name="using">Using alias analysis results</a> @@ -749,6 +804,19 @@ module, it is not part of the LLVM core.</p> </div> +<!-- _______________________________________________________________________ --> +<div class="doc_subsubsection"> + <a name="scev-aa">The <tt>-scev-aa</tt> pass</a> +</div> + +<div class="doc_text"> + +<p>The <tt>-scev-aa</tt> pass implements AliasAnalysis queries by +translating them into ScalarEvolution queries. This gives it a +more complete understanding of <tt>getelementptr</tt> instructions +and loop induction variables than other alias analyses have.</p> + +</div> <!-- ======================================================================= --> <div class="doc_subsection"> @@ -930,7 +998,7 @@ analysis directly.</p> <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-07-07 16:27:09 +0200 (Wed, 07 Jul 2010) $ </address> </body> diff --git a/docs/CodeGenerator.html b/docs/CodeGenerator.html index ec050bf..4071787 100644 --- a/docs/CodeGenerator.html +++ b/docs/CodeGenerator.html @@ -1594,22 +1594,22 @@ bool RegMapping_Fer::compatible_class(MachineFunction &mf, different register allocators:</p> <ul> - <li><i>Simple</i> — This is a very simple implementation that does not - keep values in registers across instructions. This register allocator - immediately spills every value right after it is computed, and reloads all - used operands from memory to temporary registers before each - instruction.</li> - - <li><i>Local</i> — This register allocator is an improvement on the - <i>Simple</i> implementation. It allocates registers on a basic block - level, attempting to keep values in registers and reusing registers as - appropriate.</li> - <li><i>Linear Scan</i> — <i>The default allocator</i>. This is the well-know linear scan register allocator. Whereas the <i>Simple</i> and <i>Local</i> algorithms use a direct mapping implementation technique, the <i>Linear Scan</i> implementation uses a spiller in order to place load and stores.</li> + + <li><i>Fast</i> — This register allocator is the default for debug + builds. It allocates registers on a basic block level, attempting to keep + values in registers and reusing registers as appropriate.</li> + + <li><i>PBQP</i> — A Partitioned Boolean Quadratic Programming (PBQP) + based register allocator. This allocator works by constructing a PBQP + problem representing the register allocation problem under consideration, + solving this using a PBQP solver, and mapping the solution back to a + register assignment.</li> + </ul> <p>The type of register allocator used in <tt>llc</tt> can be chosen with the @@ -1617,9 +1617,9 @@ bool RegMapping_Fer::compatible_class(MachineFunction &mf, <div class="doc_code"> <pre> -$ llc -regalloc=simple file.bc -o sp.s; -$ llc -regalloc=local file.bc -o lc.s; $ llc -regalloc=linearscan file.bc -o ln.s; +$ llc -regalloc=fast file.bc -o fa.s; +$ llc -regalloc=pbqp file.bc -o pbqp.s; </pre> </div> @@ -2162,7 +2162,7 @@ MOVSX32rm16 -> movsx, 32-bit register, 16-bit memory <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-06-15 23:58:33 +0200 (Tue, 15 Jun 2010) $ </address> </body> diff --git a/docs/DebuggingJITedCode.html b/docs/DebuggingJITedCode.html index 92570f4..a9193f2 100644 --- a/docs/DebuggingJITedCode.html +++ b/docs/DebuggingJITedCode.html @@ -9,87 +9,24 @@ <div class="doc_title">Debugging JITed Code With GDB</div> <ol> - <li><a href="#introduction">Introduction</a></li> - <li><a href="#quickstart">Quickstart</a></li> - <li><a href="#example">Example with clang and lli</a></li> + <li><a href="#example">Example usage</a></li> + <li><a href="#background">Background</a></li> </ol> <div class="doc_author">Written by Reid Kleckner</div> <!--=========================================================================--> -<div class="doc_section"><a name="introduction">Introduction</a></div> +<div class="doc_section"><a name="example">Example usage</a></div> <!--=========================================================================--> <div class="doc_text"> -<p>Without special runtime support, debugging dynamically generated code with -GDB (as well as most debuggers) can be quite painful. Debuggers generally read -debug information from the object file of the code, but for JITed code, there is -no such file to look for. -</p> - -<p>Depending on the architecture, this can impact the debugging experience in -different ways. For example, on most 32-bit x86 architectures, you can simply -compile with -fno-omit-framepointer for GCC and -fdisable-fp-elim for LLVM. -When GDB creates a backtrace, it can properly unwind the stack, but the stack -frames owned by JITed code have ??'s instead of the appropriate symbol name. -However, on Linux x86_64 in particular, GDB relies on the DWARF CFA debug -information to unwind the stack, so even if you compile your program to leave -the frame pointer untouched, GDB will usually be unable to unwind the stack past -any JITed code stack frames. -</p> - -<p>In order to communicate the necessary debug info to GDB, an interface for -registering JITed code with debuggers has been designed and implemented for -GDB and LLVM. At a high level, whenever LLVM generates new machine code, it -also generates an object file in memory containing the debug information. LLVM -then adds the object file to the global list of object files and calls a special -function (__jit_debug_register_code) marked noinline that GDB knows about. When -GDB attaches to a process, it puts a breakpoint in this function and loads all -of the object files in the global list. When LLVM calls the registration -function, GDB catches the breakpoint signal, loads the new object file from -LLVM's memory, and resumes the execution. In this way, GDB can get the -necessary debug information. +<p>In order to debug code JITed by LLVM, you need GDB 7.0 or newer, which is +available on most modern distributions of Linux. The version of GDB that Apple +ships with XCode has been frozen at 6.3 for a while. LLDB may be a better +option for debugging JITed code on Mac OS X. </p> -<p>At the time of this writing, LLVM only supports architectures that use ELF -object files and it only generates symbols and DWARF CFA information. However, -it would be easy to add more information to the object file, so we don't need to -coordinate with GDB to get better debug information. -</p> -</div> - -<!--=========================================================================--> -<div class="doc_section"><a name="quickstart">Quickstart</a></div> -<!--=========================================================================--> -<div class="doc_text"> - -<p>In order to debug code JITed by LLVM, you need to install a recent version -of GDB. The interface was added on 2009-08-19, so you need a snapshot of GDB -more recent than that. Either download a snapshot of GDB or checkout CVS as -instructed <a href="http://www.gnu.org/software/gdb/current/">here</a>. Here -are the commands for doing a checkout and building the code: -</p> - -<pre class="doc_code"> -$ cvs -z 3 -d :pserver:anoncvs@sourceware.org:/cvs/src co gdb -$ mv src gdb # You probably don't want this checkout called "src". -$ cd gdb -$ ./configure --prefix="$GDB_INSTALL" -$ make -$ make install -</pre> - -<p>You can then use -jit-emit-debug in the LLVM command line arguments to enable -the interface. -</p> -</div> - -<!--=========================================================================--> -<div class="doc_section"><a name="example">Example with clang and lli</a></div> -<!--=========================================================================--> -<div class="doc_text"> - -<p>For example, consider debugging running lli on the following C code in -foo.c: +<p>Consider debugging the following code compiled with clang and run through +lli: </p> <pre class="doc_code"> @@ -119,7 +56,9 @@ trace at the crash: <pre class="doc_code"> # Compile foo.c to bitcode. You can use either clang or llvm-gcc with this # command line. Both require -fexceptions, or the calls are all marked -# 'nounwind' which disables DWARF CFA info. +# 'nounwind' which disables DWARF exception handling info. Custom frontends +# should avoid adding this attribute to JITed code, since it interferes with +# DWARF CFA generation at the moment. $ clang foo.c -fexceptions -emit-llvm -c -o foo.bc # Run foo.bc under lli with -jit-emit-debug. If you built lli in debug mode, @@ -143,18 +82,60 @@ Program received signal SIGSEGV, Segmentation fault. #3 0x00007ffff7f5502a in main () #4 0x00000000007c0225 in llvm::JIT::runFunction(llvm::Function*, std::vector<llvm::GenericValue, - std::allocator<llvm::GenericValue> > const&) () + std::allocator<llvm::GenericValue> > const&) () #5 0x00000000007d6d98 in llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*, std::vector<std::string, - std::allocator<std::string> > const&, char const* const*) () + std::allocator<std::string> > const&, char const* const*) () #6 0x00000000004dab76 in main () </pre> -</div> <p>As you can see, GDB can correctly unwind the stack and has the appropriate function names. </p> +</div> + +<!--=========================================================================--> +<div class="doc_section"><a name="background">Background</a></div> +<!--=========================================================================--> +<div class="doc_text"> + +<p>Without special runtime support, debugging dynamically generated code with +GDB (as well as most debuggers) can be quite painful. Debuggers generally read +debug information from the object file of the code, but for JITed code, there is +no such file to look for. +</p> + +<p>Depending on the architecture, this can impact the debugging experience in +different ways. For example, on most 32-bit x86 architectures, you can simply +compile with -fno-omit-frame-pointer for GCC and -disable-fp-elim for LLVM. +When GDB creates a backtrace, it can properly unwind the stack, but the stack +frames owned by JITed code have ??'s instead of the appropriate symbol name. +However, on Linux x86_64 in particular, GDB relies on the DWARF call frame +address (CFA) debug information to unwind the stack, so even if you compile +your program to leave the frame pointer untouched, GDB will usually be unable +to unwind the stack past any JITed code stack frames. +</p> + +<p>In order to communicate the necessary debug info to GDB, an interface for +registering JITed code with debuggers has been designed and implemented for +GDB and LLVM. At a high level, whenever LLVM generates new machine code, it +also generates an object file in memory containing the debug information. LLVM +then adds the object file to the global list of object files and calls a special +function (__jit_debug_register_code) marked noinline that GDB knows about. When +GDB attaches to a process, it puts a breakpoint in this function and loads all +of the object files in the global list. When LLVM calls the registration +function, GDB catches the breakpoint signal, loads the new object file from +LLVM's memory, and resumes the execution. In this way, GDB can get the +necessary debug information. +</p> + +<p>At the time of this writing, LLVM only supports architectures that use ELF +object files and it only generates symbols and DWARF CFA information. However, +it would be easy to add more information to the object file, so we don't need to +coordinate with GDB to get better debug information. +</p> +</div> <!-- *********************************************************************** --> <hr> @@ -165,7 +146,7 @@ function names. src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"></a> <a href="mailto:reid.kleckner@gmail.com">Reid Kleckner</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2009-01-01 23:10:51 -0800 (Thu, 01 Jan 2009) $ + Last modified: $Date: 2010-07-07 22:16:45 +0200 (Wed, 07 Jul 2010) $ </address> </body> </html> diff --git a/docs/ExceptionHandling.html b/docs/ExceptionHandling.html index 2c85574..d324c15 100644 --- a/docs/ExceptionHandling.html +++ b/docs/ExceptionHandling.html @@ -404,7 +404,7 @@ <div class="doc_text"> <pre> - i8* %<a href="#llvm_eh_exception">llvm.eh.exception</a>( ) + i8* %<a href="#llvm_eh_exception">llvm.eh.exception</a>() </pre> <p>This intrinsic returns a pointer to the exception structure.</p> @@ -518,7 +518,7 @@ <div class="doc_text"> <pre> - i8* %<a href="#llvm_eh_sjlj_lsda">llvm.eh.sjlj.lsda</a>( ) + i8* %<a href="#llvm_eh_sjlj_lsda">llvm.eh.sjlj.lsda</a>() </pre> <p>Used for SJLJ based exception handling, the <a href="#llvm_eh_sjlj_lsda"> @@ -619,7 +619,7 @@ <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-26 18:21:41 +0200 (Wed, 26 May 2010) $ + Last modified: $Date: 2010-05-28 19:07:41 +0200 (Fri, 28 May 2010) $ </address> </body> diff --git a/docs/FAQ.html b/docs/FAQ.html index 6e560f5..9415a90 100644 --- a/docs/FAQ.html +++ b/docs/FAQ.html @@ -803,7 +803,7 @@ define fastcc void @foo() { ret void } define void @bar() { - call void @foo( ) + call void @foo() ret void } </pre> @@ -931,7 +931,7 @@ F.i: src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"></a> <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-05-28 19:07:41 +0200 (Fri, 28 May 2010) $ </address> </body> diff --git a/docs/GetElementPtr.html b/docs/GetElementPtr.html index 9e1c8b8..aa874ae 100644 --- a/docs/GetElementPtr.html +++ b/docs/GetElementPtr.html @@ -64,7 +64,8 @@ <div class="doc_text"> <p>This document seeks to dispel the mystery and confusion surrounding LLVM's - GetElementPtr (GEP) instruction. Questions about the wily GEP instruction are + <a href="LangRef.html#i_getelementptr">GetElementPtr</a> (GEP) instruction. + Questions about the wily GEP instruction are probably the most frequently occurring questions once a developer gets down to coding with LLVM. Here we lay out the sources of confusion and show that the GEP instruction is really quite simple. @@ -653,7 +654,8 @@ idx3 = (char*) &MyVar + 8 <li>Support C, C-like languages, and languages which can be conceptually lowered into C (this covers a lot).</li> <li>Support optimizations such as those that are common in - C compilers.</li> + C compilers. In particular, GEP is a cornerstone of LLVM's + <a href="LangRef.html#pointeraliasing">pointer aliasing model</a>.</li> <li>Provide a consistent method for computing addresses so that address computations don't need to be a part of load and store instructions in the IR.</li> @@ -728,7 +730,7 @@ idx3 = (char*) &MyVar + 8 <a href="http://validator.w3.org/check/referer"><img src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"></a> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br/> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-07-06 17:26:33 +0200 (Tue, 06 Jul 2010) $ </address> </body> </html> diff --git a/docs/GettingStarted.html b/docs/GettingStarted.html index 7103d13..7c105fe 100644 --- a/docs/GettingStarted.html +++ b/docs/GettingStarted.html @@ -1137,13 +1137,13 @@ platforms or configurations using the same source tree.</p> named after the build type:</p> <dl> - <dt>Debug Builds + <dt>Debug Builds with assertions enabled (the default) <dd> <dl> <dt>Tools - <dd><tt><i>OBJ_ROOT</i>/Debug/bin</tt> + <dd><tt><i>OBJ_ROOT</i>/Debug+Asserts/bin</tt> <dt>Libraries - <dd><tt><i>OBJ_ROOT</i>/Debug/lib</tt> + <dd><tt><i>OBJ_ROOT</i>/Debug+Asserts/lib</tt> </dl> <br><br> @@ -1673,7 +1673,7 @@ out:</p> <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="http://llvm.x10sys.com/rspencer/">Reid Spencer</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-19 09:00:17 +0200 (Wed, 19 May 2010) $ + Last modified: $Date: 2010-07-08 10:27:18 +0200 (Thu, 08 Jul 2010) $ </address> </body> </html> diff --git a/docs/HowToReleaseLLVM.html b/docs/HowToReleaseLLVM.html index b966f45..7663321 100644 --- a/docs/HowToReleaseLLVM.html +++ b/docs/HowToReleaseLLVM.html @@ -213,13 +213,13 @@ Building the Release</a></div> <div class="doc_text"> The build of <tt>llvm</tt>, <tt>llvm-gcc</tt>, and <tt>clang</tt> must be free -of errors and warnings in both debug, release, and release-asserts builds. +of errors and warnings in both debug, release+asserts, and release builds. If all builds are clean, then the release passes build qualification. <ol> <li>debug: ENABLE_OPTIMIZED=0</li> -<li>release: ENABLE_OPTIMIZED=1</li> -<li>release-asserts: ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1</li> +<li>release+asserts: ENABLE_OPTIMIZED=1</li> +<li>release: ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1</li> </ol> </div> @@ -227,7 +227,7 @@ If all builds are clean, then the release passes build qualification. <div class="doc_subsubsection"><a name="build">Build LLVM</a></div> <div class="doc_text"> <p> - Build both debug, release (optimized), and release-asserts versions of + Build both debug, release+asserts (optimized), and release versions of LLVM on all supported platforms. Direction to build llvm are <a href="http://llvm.org/docs/GettingStarted.html#quickstart">here</a>. </p> @@ -264,7 +264,7 @@ If all builds are clean, then the release passes build qualification. Binary Distribution</a></div> <div class="doc_text"> <p> - Creating the Clang binary distribution (debug/release/release-asserts) requires + Creating the Clang binary distribution (debug/release/release) requires performing the following steps for each supported platform: </p> @@ -429,7 +429,7 @@ Qualification Details</a></div> </a></div> <div class="doc_text"> <p> - The final stages of the release process involving taging the release branch, + The final stages of the release process involving tagging the release branch, updating documentation that refers to the release, and updating the demo page.</p> <p>FIXME: Add a note if anything needs to be done to the clang website. @@ -517,7 +517,7 @@ svn copy https://llvm.org/svn/llvm-project/test-suite/branches/release_XX \ src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"></a> <a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a> <br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-07-07 09:48:00 +0200 (Wed, 07 Jul 2010) $ </address> </body> </html> diff --git a/docs/LangRef.html b/docs/LangRef.html index 119436a..ca988b7 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -24,6 +24,7 @@ <ol> <li><a href="#linkage_private">'<tt>private</tt>' Linkage</a></li> <li><a href="#linkage_linker_private">'<tt>linker_private</tt>' Linkage</a></li> + <li><a href="#linkage_linker_private_weak">'<tt>linker_private_weak</tt>' Linkage</a></li> <li><a href="#linkage_internal">'<tt>internal</tt>' Linkage</a></li> <li><a href="#linkage_available_externally">'<tt>available_externally</tt>' Linkage</a></li> <li><a href="#linkage_linkonce">'<tt>linkonce</tt>' Linkage</a></li> @@ -369,11 +370,9 @@ what is considered 'well formed'. For example, the following instruction is syntactically okay, but not well formed:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> %x = <a href="#i_add">add</a> i32 1, %x </pre> -</div> <p>because the definition of <tt>%x</tt> does not dominate all of its uses. The LLVM infrastructure provides a verification pass that may be used to verify @@ -436,29 +435,23 @@ <p>The easy way:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> %result = <a href="#i_mul">mul</a> i32 %X, 8 </pre> -</div> <p>After strength reduction:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> %result = <a href="#i_shl">shl</a> i32 %X, i8 3 </pre> -</div> <p>And the hard way:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> %0 = <a href="#i_add">add</a> i32 %X, %X <i>; yields {i32}:%0</i> %1 = <a href="#i_add">add</a> i32 %0, %0 <i>; yields {i32}:%1</i> %result = <a href="#i_add">add</a> i32 %1, %1 </pre> -</div> <p>This last way of multiplying <tt>%X</tt> by 8 illustrates several important lexical features of LLVM:</p> @@ -497,28 +490,26 @@ forward declarations, and merges symbol table entries. Here is an example of the "hello world" module:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> <i>; Declare the string constant as a global constant.</i> <a href="#identifiers">@.LC0</a> = <a href="#linkage_internal">internal</a> <a href="#globalvars">constant</a> <a href="#t_array">[13 x i8]</a> c"hello world\0A\00" <i>; [13 x i8]*</i> <i>; External declaration of the puts function</i> -<a href="#functionstructure">declare</a> i32 @puts(i8 *) <i>; i32(i8 *)* </i> +<a href="#functionstructure">declare</a> i32 @puts(i8*) <i>; i32 (i8*)* </i> <i>; Definition of main function</i> define i32 @main() { <i>; i32()* </i> <i>; Convert [13 x i8]* to i8 *...</i> - %cast210 = <a href="#i_getelementptr">getelementptr</a> [13 x i8]* @.LC0, i64 0, i64 0 <i>; i8 *</i> + %cast210 = <a href="#i_getelementptr">getelementptr</a> [13 x i8]* @.LC0, i64 0, i64 0 <i>; i8*</i> <i>; Call puts function to write out the string to stdout.</i> - <a href="#i_call">call</a> i32 @puts(i8 * %cast210) <i>; i32</i> + <a href="#i_call">call</a> i32 @puts(i8* %cast210) <i>; i32</i> <a href="#i_ret">ret</a> i32 0<br>} <i>; Named metadata</i> !1 = metadata !{i32 41} !foo = !{!1, null} </pre> -</div> <p>This example is made up of a <a href="#globalvars">global variable</a> named "<tt>.LC0</tt>", an external declaration of the "<tt>puts</tt>" function, @@ -546,20 +537,24 @@ define i32 @main() { <i>; i32()* </i> <dl> <dt><tt><b><a name="linkage_private">private</a></b></tt></dt> - <dd>Global values with private linkage are only directly accessible by objects - in the current module. In particular, linking code into a module with an - private global value may cause the private to be renamed as necessary to - avoid collisions. Because the symbol is private to the module, all - references can be updated. This doesn't show up in any symbol table in the - object file.</dd> + <dd>Global values with "<tt>private</tt>" linkage are only directly accessible + by objects in the current module. In particular, linking code into a + module with an private global value may cause the private to be renamed as + necessary to avoid collisions. Because the symbol is private to the + module, all references can be updated. This doesn't show up in any symbol + table in the object file.</dd> <dt><tt><b><a name="linkage_linker_private">linker_private</a></b></tt></dt> - <dd>Similar to private, but the symbol is passed through the assembler and - removed by the linker after evaluation. Note that (unlike private - symbols) linker_private symbols are subject to coalescing by the linker: - weak symbols get merged and redefinitions are rejected. However, unlike - normal strong symbols, they are removed by the linker from the final - linked image (executable or dynamic library).</dd> + <dd>Similar to <tt>private</tt>, but the symbol is passed through the + assembler and evaluated by the linker. Unlike normal strong symbols, they + are removed by the linker from the final linked image (executable or + dynamic library).</dd> + + <dt><tt><b><a name="linkage_linker_private_weak">linker_private_weak</a></b></tt></dt> + <dd>Similar to "<tt>linker_private</tt>", but the symbol is weak. Note that + <tt>linker_private_weak</tt> symbols are subject to coalescing by the + linker. The symbols are removed by the linker from the final linked image + (executable or dynamic library).</dd> <dt><tt><b><a name="linkage_internal">internal</a></b></tt></dt> <dd>Similar to private, but the value shows as a local symbol @@ -623,8 +618,8 @@ define i32 @main() { <i>; i32()* </i> <dt><tt><b><a name="linkage_weak_odr">weak_odr</a></b></tt></dt> <dd>Some languages allow differing globals to be merged, such as two functions with different semantics. Other languages, such as <tt>C++</tt>, ensure - that only equivalent globals are ever merged (the "one definition rule" - - "ODR"). Such languages can use the <tt>linkonce_odr</tt> + that only equivalent globals are ever merged (the "one definition rule" + — "ODR"). Such languages can use the <tt>linkonce_odr</tt> and <tt>weak_odr</tt> linkage types to indicate that the global will only be merged with equivalent globals. These linkage types are otherwise the same as their non-<tt>odr</tt> versions.</dd> @@ -788,11 +783,9 @@ define i32 @main() { <i>; i32()* </i> it easier to read the IR and make the IR more condensed (particularly when recursive types are involved). An example of a name specification is:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> %mytype = type { %mytype*, i32 } </pre> -</div> <p>You may give a name to any <a href="#typesystem">type</a> except "<a href="t_void">void</a>". Type name aliases may be used anywhere a type @@ -864,11 +857,9 @@ define i32 @main() { <i>; i32()* </i> <p>For example, the following defines a global in a numbered address space with an initializer, section, and alignment:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> @G = addrspace(5) constant float 1.0, section "foo", align 4 </pre> -</div> </div> @@ -921,15 +912,13 @@ define i32 @main() { <i>; i32()* </i> alignments must be a power of 2.</p> <h5>Syntax:</h5> -<div class="doc_code"> -<pre> +<pre class="doc_code"> define [<a href="#linkage">linkage</a>] [<a href="#visibility">visibility</a>] [<a href="#callingconv">cconv</a>] [<a href="#paramattrs">ret attrs</a>] <ResultType> @<FunctionName> ([argument list]) [<a href="#fnattrs">fn Attrs</a>] [section "name"] [align N] [<a href="#gc">gc</a>] { ... } </pre> -</div> </div> @@ -946,11 +935,9 @@ define [<a href="#linkage">linkage</a>] [<a href="#visibility">visibility</a>] optional <a href="#visibility">visibility style</a>.</p> <h5>Syntax:</h5> -<div class="doc_code"> -<pre> +<pre class="doc_code"> @<Name> = alias [Linkage] [Visibility] <AliaseeTy> @<Aliasee> </pre> -</div> </div> @@ -966,12 +953,10 @@ define [<a href="#linkage">linkage</a>] [<a href="#visibility">visibility</a>] a named metadata.</p> <h5>Syntax:</h5> -<div class="doc_code"> -<pre> +<pre class="doc_code"> !1 = metadata !{metadata !"one"} !name = !{null, !1} </pre> -</div> </div> @@ -991,13 +976,11 @@ define [<a href="#linkage">linkage</a>] [<a href="#visibility">visibility</a>] multiple parameter attributes are needed, they are space separated. For example:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> declare i32 @printf(i8* noalias nocapture, ...) declare i32 @atoi(i8 zeroext) declare signext i8 @returns_signed_char() </pre> -</div> <p>Note that any attributes for the function result (<tt>nounwind</tt>, <tt>readonly</tt>) come immediately after the argument list.</p> @@ -1037,7 +1020,7 @@ declare signext i8 @returns_signed_char() generator that usually indicates a desired alignment for the synthesized stack slot.</dd> - <dt><tt><b>sret</b></tt></dt> + <dt><tt><b><a name="sret">sret</a></b></tt></dt> <dd>This indicates that the pointer parameter specifies the address of a structure that is the return value of the function in the source program. This pointer must be guaranteed by the caller to be valid: loads and @@ -1045,22 +1028,34 @@ declare signext i8 @returns_signed_char() may only be applied to the first parameter. This is not a valid attribute for return values. </dd> - <dt><tt><b>noalias</b></tt></dt> - <dd>This indicates that the pointer does not alias any global or any other - parameter. The caller is responsible for ensuring that this is the - case. On a function return value, <tt>noalias</tt> additionally indicates - that the pointer does not alias any other pointers visible to the - caller. For further details, please see the discussion of the NoAlias - response in - <a href="http://llvm.org/docs/AliasAnalysis.html#MustMayNo">alias - analysis</a>.</dd> - - <dt><tt><b>nocapture</b></tt></dt> + <dt><tt><b><a name="noalias">noalias</a></b></tt></dt> + <dd>This indicates that pointer values + <a href="#pointeraliasing"><i>based</i></a> on the argument or return + value do not alias pointer values which are not <i>based</i> on it, + ignoring certain "irrelevant" dependencies. + For a call to the parent function, dependencies between memory + references from before or after the call and from those during the call + are "irrelevant" to the <tt>noalias</tt> keyword for the arguments and + return value used in that call. + The caller shares the responsibility with the callee for ensuring that + these requirements are met. + For further details, please see the discussion of the NoAlias response in + <a href="AliasAnalysis.html#MustMayNo">alias analysis</a>.<br> +<br> + Note that this definition of <tt>noalias</tt> is intentionally + similar to the definition of <tt>restrict</tt> in C99 for function + arguments, though it is slightly weaker. +<br> + For function return values, C99's <tt>restrict</tt> is not meaningful, + while LLVM's <tt>noalias</tt> is. + </dd> + + <dt><tt><b><a name="nocapture">nocapture</a></b></tt></dt> <dd>This indicates that the callee does not make any copies of the pointer that outlive the callee itself. This is not a valid attribute for return values.</dd> - <dt><tt><b>nest</b></tt></dt> + <dt><tt><b><a name="nest">nest</a></b></tt></dt> <dd>This indicates that the pointer parameter can be excised using the <a href="#int_trampoline">trampoline intrinsics</a>. This is not a valid attribute for return values.</dd> @@ -1078,11 +1073,9 @@ declare signext i8 @returns_signed_char() <p>Each function may specify a garbage collector name, which is simply a string:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> define void @f() gc "name" { ... } </pre> -</div> <p>The compiler declares the supported values of <i>name</i>. Specifying a collector which will cause the compiler to alter its output in order to @@ -1105,14 +1098,12 @@ define void @f() gc "name" { ... } <p>Function attributes are simple keywords that follow the type specified. If multiple attributes are needed, they are space separated. For example:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> define void @f() noinline { ... } define void @f() alwaysinline { ... } define void @f() alwaysinline optsize { ... } define void @f() optsize { ... } </pre> -</div> <dl> <dt><tt><b>alignstack(<<em>n</em>>)</b></tt></dt> @@ -1130,15 +1121,21 @@ define void @f() optsize { ... } this function is desirable (such as the "inline" keyword in C/C++). It is just a hint; it imposes no requirements on the inliner.</dd> + <dt><tt><b>naked</b></tt></dt> + <dd>This attribute disables prologue / epilogue emission for the function. + This can have very system-specific consequences.</dd> + + <dt><tt><b>noimplicitfloat</b></tt></dt> + <dd>This attributes disables implicit floating point instructions.</dd> + <dt><tt><b>noinline</b></tt></dt> <dd>This attribute indicates that the inliner should never inline this function in any situation. This attribute may not be used together with the <tt>alwaysinline</tt> attribute.</dd> - <dt><tt><b>optsize</b></tt></dt> - <dd>This attribute suggests that optimization passes and code generator passes - make choices that keep the code size of this function low, and otherwise - do optimizations specifically to reduce code size.</dd> + <dt><tt><b>noredzone</b></tt></dt> + <dd>This attribute indicates that the code generator should not use a red + zone, even if the target-specific ABI normally permits it.</dd> <dt><tt><b>noreturn</b></tt></dt> <dd>This function attribute indicates that the function never returns @@ -1150,6 +1147,11 @@ define void @f() optsize { ... } unwind or exceptional control flow. If the function does unwind, its runtime behavior is undefined.</dd> + <dt><tt><b>optsize</b></tt></dt> + <dd>This attribute suggests that optimization passes and code generator passes + make choices that keep the code size of this function low, and otherwise + do optimizations specifically to reduce code size.</dd> + <dt><tt><b>readnone</b></tt></dt> <dd>This attribute indicates that the function computes its result (or decides to unwind an exception) based strictly on its arguments, without @@ -1192,17 +1194,6 @@ define void @f() optsize { ... } function that doesn't have an <tt>sspreq</tt> attribute or which has an <tt>ssp</tt> attribute, then the resulting function will have an <tt>sspreq</tt> attribute.</dd> - - <dt><tt><b>noredzone</b></tt></dt> - <dd>This attribute indicates that the code generator should not use a red - zone, even if the target-specific ABI normally permits it.</dd> - - <dt><tt><b>noimplicitfloat</b></tt></dt> - <dd>This attributes disables implicit floating point instructions.</dd> - - <dt><tt><b>naked</b></tt></dt> - <dd>This attribute disables prologue / epilogue emission for the function. - This can have very system-specific consequences.</dd> </dl> </div> @@ -1219,12 +1210,10 @@ define void @f() optsize { ... } concatenated by LLVM and treated as a single unit, but may be separated in the <tt>.ll</tt> file if desired. The syntax is very simple:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> module asm "inline asm code goes here" module asm "more can go here" </pre> -</div> <p>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 @@ -1246,11 +1235,9 @@ module asm "more can go here" data is to be laid out in memory. The syntax for the data layout is simply:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> target datalayout = "<i>layout specification</i>" </pre> -</div> <p>The <i>layout specification</i> consists of a list of specifications separated by the minus sign character ('-'). Each specification starts with @@ -1283,8 +1270,10 @@ target datalayout = "<i>layout specification</i>" <dt><tt>f<i>size</i>:<i>abi</i>:<i>pref</i></tt></dt> <dd>This specifies the alignment for a floating point type of a given bit - <i>size</i>. The value of <i>size</i> must be either 32 (float) or 64 - (double).</dd> + <i>size</i>. Only values of <i>size</i> that are supported by the target + will work. 32 (float) and 64 (double) are supported on all targets; + 80 or 128 (different flavors of long double) are also supported on some + targets. <dt><tt>a<i>size</i>:<i>abi</i>:<i>pref</i></tt></dt> <dd>This specifies the alignment for an aggregate type of a given bit @@ -1360,34 +1349,46 @@ is undefined. Pointer values are associated with address ranges according to the following rules:</p> <ul> - <li>A pointer value formed from a - <tt><a href="#i_getelementptr">getelementptr</a></tt> instruction - is associated with the addresses associated with the first operand - of the <tt>getelementptr</tt>.</li> + <li>A pointer value is associated with the addresses associated with + any value it is <i>based</i> on. <li>An address of a global variable is associated with the address range of the variable's storage.</li> <li>The result value of an allocation instruction is associated with the address range of the allocated storage.</li> <li>A null pointer in the default address-space is associated with no address.</li> - <li>A pointer value formed by an - <tt><a href="#i_inttoptr">inttoptr</a></tt> is associated with all - address ranges of all pointer values that contribute (directly or - indirectly) to the computation of the pointer's value.</li> - <li>The result value of a - <tt><a href="#i_bitcast">bitcast</a></tt> is associated with all - addresses associated with the operand of the <tt>bitcast</tt>.</li> <li>An integer constant other than zero or a pointer value returned from a function not defined within LLVM may be associated with address ranges allocated through mechanisms other than those provided by LLVM. Such ranges shall not overlap with any ranges of addresses allocated by mechanisms provided by LLVM.</li> - </ul> +</ul> + +<p>A pointer value is <i>based</i> on another pointer value according + to the following rules:</p> + +<ul> + <li>A pointer value formed from a + <tt><a href="#i_getelementptr">getelementptr</a></tt> operation + is <i>based</i> on the first operand of the <tt>getelementptr</tt>.</li> + <li>The result value of a + <tt><a href="#i_bitcast">bitcast</a></tt> is <i>based</i> on the operand + of the <tt>bitcast</tt>.</li> + <li>A pointer value formed by an + <tt><a href="#i_inttoptr">inttoptr</a></tt> is <i>based</i> on all + pointer values that contribute (directly or indirectly) to the + computation of the pointer's value.</li> + <li>The "<i>based</i> on" relationship is transitive.</li> +</ul> + +<p>Note that this definition of <i>"based"</i> is intentionally + similar to the definition of <i>"based"</i> in C99, though it is + slightly weaker.</p> <p>LLVM IR does not associate types with memory. The result type of a <tt><a href="#i_load">load</a></tt> merely indicates the size and alignment of the memory from which to load, as well as the -interpretation of the value. The first operand of a +interpretation of the value. The first operand type of a <tt><a href="#i_store">store</a></tt> similarly only indicates the size and alignment of the store.</p> @@ -1632,8 +1633,6 @@ Classifications</a> </div> </div> -</div> - <!-- _______________________________________________________________________ --> <div class="doc_subsubsection"> <a name="t_array">Array Type</a> </div> @@ -1900,7 +1899,7 @@ Classifications</a> </div> href="#t_array">array</a> of four <tt>i32</tt> values.</td> </tr> <tr class="layout"> - <td class="left"><tt>i32 (i32 *) *</tt></td> + <td class="left"><tt>i32 (i32*) *</tt></td> <td class="left"> A <a href="#t_pointer">pointer</a> to a <a href="#t_function">function</a> that takes an <tt>i32*</tt>, returning an <tt>i32</tt>.</td> @@ -2167,13 +2166,11 @@ Classifications</a> </div> have <a href="#t_pointer">pointer</a> type. For example, the following is a legal LLVM file:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> @X = global i32 17 @Y = global i32 42 @Z = global [2 x i32*] [ i32* @X, i32* @Y ] </pre> -</div> </div> @@ -2192,8 +2189,7 @@ Classifications</a> </div> surprising) transformations that are valid (in pseudo IR):</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> %A = add %X, undef %B = sub %X, undef %C = xor %X, undef @@ -2202,13 +2198,11 @@ Safe: %B = undef %C = undef </pre> -</div> <p>This is safe because all of the output bits are affected by the undef bits. Any output bit can have a zero or one depending on the input bits.</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> %A = or %X, undef %B = and %X, undef Safe: @@ -2218,7 +2212,6 @@ Unsafe: %A = undef %B = undef </pre> -</div> <p>These logical operations have bits that are not always affected by the input. For example, if "%X" has a zero bit, then the output of the 'and' operation will @@ -2229,8 +2222,7 @@ optimize the and to 0. Likewise, it is safe to assume that all the bits of the undef operand to the or could be set, allowing the or to be folded to -1.</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> %A = select undef, %X, %Y %B = select undef, 42, %Y %C = select %X, %Y, undef @@ -2243,7 +2235,6 @@ Unsafe: %B = undef %C = undef </pre> -</div> <p>This set of examples show that undefined select (and conditional branch) conditions can go "either way" but they have to come from one of the two @@ -2253,8 +2244,7 @@ the optimizer is allowed to assume that the undef operand could be the same as %Y, allowing the whole select to be eliminated.</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> %A = xor undef, undef %B = undef @@ -2272,7 +2262,6 @@ Safe: %E = undef %F = undef </pre> -</div> <p>This example points out that two undef operands are not necessarily the same. This can be surprising to people (and also matches C semantics) where they @@ -2285,15 +2274,13 @@ so the value is not necessarily consistent over time. In fact, %A and %C need to have the same semantics or the core LLVM "replace all uses with" concept would not hold.</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> %A = fdiv undef, %X %B = fdiv %X, undef Safe: %A = undef b: unreachable </pre> -</div> <p>These examples show the crucial difference between an <em>undefined value</em> and <em>undefined behavior</em>. An undefined value (like undef) is @@ -2308,15 +2295,13 @@ it: since the undefined operation "can't happen", the optimizer can assume that it occurs in dead code. </p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> a: store undef -> %X b: store %X -> undef Safe: a: <deleted> b: unreachable </pre> -</div> <p>These examples reiterate the fdiv example: a store "of" an undefined value can be assumed to not have any effect: we can assume that the value is @@ -2342,7 +2327,6 @@ has undefined behavior.</p> <p>Trap value behavior is defined in terms of value <i>dependence</i>:</p> -<p> <ul> <li>Values other than <a href="#i_phi"><tt>phi</tt></a> nodes depend on their operands.</li> @@ -2374,7 +2358,8 @@ has undefined behavior.</p> <li>An instruction with externally visible side effects depends on the most recent preceding instruction with externally visible side effects, following - the order in the IR. (This includes volatile loads and stores.)</li> + the order in the IR. (This includes + <a href="#volatile">volatile operations</a>.)</li> <li>An instruction <i>control-depends</i> on a <a href="#terminators">terminator instruction</a> @@ -2385,7 +2370,6 @@ has undefined behavior.</p> <li>Dependence is transitive.</li> </ul> -</p> <p>Whenever a trap value is generated, all values which depend on it evaluate to trap. If they have side effects, the evoke their side effects as if each @@ -2394,8 +2378,7 @@ has undefined behavior.</p> <p>Here are some examples:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> entry: %trap = sub nuw i32 0, 1 ; Results in a trap value. %still_trap = and i32 %trap, 0 ; Whereas (and i32 undef, 0) would return 0. @@ -2430,7 +2413,6 @@ end: ; so this is defined (ignoring earlier ; undefined behavior in this example). </pre> -</div> </div> @@ -2475,104 +2457,114 @@ end: supported). The following is the syntax for constant expressions:</p> <dl> - <dt><b><tt>trunc ( CST to TYPE )</tt></b></dt> + <dt><b><tt>trunc (CST to TYPE)</tt></b></dt> <dd>Truncate a constant to another type. The bit size of CST must be larger than the bit size of TYPE. Both types must be integers.</dd> - <dt><b><tt>zext ( CST to TYPE )</tt></b></dt> + <dt><b><tt>zext (CST to TYPE)</tt></b></dt> <dd>Zero extend a constant to another type. The bit size of CST must be - smaller or equal to the bit size of TYPE. Both types must be - integers.</dd> + smaller than the bit size of TYPE. Both types must be integers.</dd> - <dt><b><tt>sext ( CST to TYPE )</tt></b></dt> + <dt><b><tt>sext (CST to TYPE)</tt></b></dt> <dd>Sign extend a constant to another type. The bit size of CST must be - smaller or equal to the bit size of TYPE. Both types must be - integers.</dd> + smaller than the bit size of TYPE. Both types must be integers.</dd> - <dt><b><tt>fptrunc ( CST to TYPE )</tt></b></dt> + <dt><b><tt>fptrunc (CST to TYPE)</tt></b></dt> <dd>Truncate a floating point constant to another floating point type. The size of CST must be larger than the size of TYPE. Both types must be floating point.</dd> - <dt><b><tt>fpext ( CST to TYPE )</tt></b></dt> + <dt><b><tt>fpext (CST to TYPE)</tt></b></dt> <dd>Floating point extend a constant to another type. The size of CST must be smaller or equal to the size of TYPE. Both types must be floating point.</dd> - <dt><b><tt>fptoui ( CST to TYPE )</tt></b></dt> + <dt><b><tt>fptoui (CST to TYPE)</tt></b></dt> <dd>Convert a floating point constant to the corresponding unsigned integer constant. TYPE must be a scalar or vector integer type. CST must be of scalar or vector floating point type. Both CST and TYPE must be scalars, or vectors of the same number of elements. If the value won't fit in the integer type, the results are undefined.</dd> - <dt><b><tt>fptosi ( CST to TYPE )</tt></b></dt> + <dt><b><tt>fptosi (CST to TYPE)</tt></b></dt> <dd>Convert a floating point constant to the corresponding signed integer constant. TYPE must be a scalar or vector integer type. CST must be of scalar or vector floating point type. Both CST and TYPE must be scalars, or vectors of the same number of elements. If the value won't fit in the integer type, the results are undefined.</dd> - <dt><b><tt>uitofp ( CST to TYPE )</tt></b></dt> + <dt><b><tt>uitofp (CST to TYPE)</tt></b></dt> <dd>Convert an unsigned integer constant to the corresponding floating point constant. TYPE must be a scalar or vector floating point type. CST must be of scalar or vector integer type. Both CST and TYPE must be scalars, or vectors of the same number of elements. If the value won't fit in the floating point type, the results are undefined.</dd> - <dt><b><tt>sitofp ( CST to TYPE )</tt></b></dt> + <dt><b><tt>sitofp (CST to TYPE)</tt></b></dt> <dd>Convert a signed integer constant to the corresponding floating point constant. TYPE must be a scalar or vector floating point type. CST must be of scalar or vector integer type. Both CST and TYPE must be scalars, or vectors of the same number of elements. If the value won't fit in the floating point type, the results are undefined.</dd> - <dt><b><tt>ptrtoint ( CST to TYPE )</tt></b></dt> + <dt><b><tt>ptrtoint (CST to TYPE)</tt></b></dt> <dd>Convert a pointer typed constant to the corresponding integer constant <tt>TYPE</tt> must be an integer type. <tt>CST</tt> must be of pointer type. The <tt>CST</tt> value is zero extended, truncated, or unchanged to make it fit in <tt>TYPE</tt>.</dd> - <dt><b><tt>inttoptr ( CST to TYPE )</tt></b></dt> + <dt><b><tt>inttoptr (CST to TYPE)</tt></b></dt> <dd>Convert a integer constant to a pointer constant. TYPE must be a pointer type. CST must be of integer type. The CST value is zero extended, truncated, or unchanged to make it fit in a pointer size. This one is <i>really</i> dangerous!</dd> - <dt><b><tt>bitcast ( CST to TYPE )</tt></b></dt> + <dt><b><tt>bitcast (CST to TYPE)</tt></b></dt> <dd>Convert a constant, CST, to another TYPE. The constraints of the operands are the same as those for the <a href="#i_bitcast">bitcast instruction</a>.</dd> - <dt><b><tt>getelementptr ( CSTPTR, IDX0, IDX1, ... )</tt></b></dt> - <dt><b><tt>getelementptr inbounds ( CSTPTR, IDX0, IDX1, ... )</tt></b></dt> + <dt><b><tt>getelementptr (CSTPTR, IDX0, IDX1, ...)</tt></b></dt> + <dt><b><tt>getelementptr inbounds (CSTPTR, IDX0, IDX1, ...)</tt></b></dt> <dd>Perform the <a href="#i_getelementptr">getelementptr operation</a> on constants. As with the <a href="#i_getelementptr">getelementptr</a> instruction, the index list may have zero or more indexes, which are required to make sense for the type of "CSTPTR".</dd> - <dt><b><tt>select ( COND, VAL1, VAL2 )</tt></b></dt> + <dt><b><tt>select (COND, VAL1, VAL2)</tt></b></dt> <dd>Perform the <a href="#i_select">select operation</a> on constants.</dd> - <dt><b><tt>icmp COND ( VAL1, VAL2 )</tt></b></dt> + <dt><b><tt>icmp COND (VAL1, VAL2)</tt></b></dt> <dd>Performs the <a href="#i_icmp">icmp operation</a> on constants.</dd> - <dt><b><tt>fcmp COND ( VAL1, VAL2 )</tt></b></dt> + <dt><b><tt>fcmp COND (VAL1, VAL2)</tt></b></dt> <dd>Performs the <a href="#i_fcmp">fcmp operation</a> on constants.</dd> - <dt><b><tt>extractelement ( VAL, IDX )</tt></b></dt> + <dt><b><tt>extractelement (VAL, IDX)</tt></b></dt> <dd>Perform the <a href="#i_extractelement">extractelement operation</a> on constants.</dd> - <dt><b><tt>insertelement ( VAL, ELT, IDX )</tt></b></dt> + <dt><b><tt>insertelement (VAL, ELT, IDX)</tt></b></dt> <dd>Perform the <a href="#i_insertelement">insertelement operation</a> on constants.</dd> - <dt><b><tt>shufflevector ( VEC1, VEC2, IDXMASK )</tt></b></dt> + <dt><b><tt>shufflevector (VEC1, VEC2, IDXMASK)</tt></b></dt> <dd>Perform the <a href="#i_shufflevector">shufflevector operation</a> on constants.</dd> - <dt><b><tt>OPCODE ( LHS, RHS )</tt></b></dt> + <dt><b><tt>extractvalue (VAL, IDX0, IDX1, ...)</tt></b></dt> + <dd>Perform the <a href="#i_extractvalue">extractvalue operation</a> on + constants. The index list is interpreted in a similar manner as indices in + a '<a href="#i_getelementptr">getelementptr</a>' operation. At least one + index value must be specified.</dd> + + <dt><b><tt>insertvalue (VAL, ELT, IDX0, IDX1, ...)</tt></b></dt> + <dd>Perform the <a href="#i_insertvalue">insertvalue operation</a> on + constants. The index list is interpreted in a similar manner as indices in + a '<a href="#i_getelementptr">getelementptr</a>' operation. At least one + index value must be specified.</dd> + + <dt><b><tt>OPCODE (LHS, RHS)</tt></b></dt> <dd>Perform the specified operation of the LHS and RHS constants. OPCODE may be any of the <a href="#binaryops">binary</a> or <a href="#bitwiseops">bitwise binary</a> operations. The constraints @@ -2602,31 +2594,25 @@ end: containing the asm needs to align its stack conservatively. An example inline assembler expression is:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> i32 (i32) asm "bswap $0", "=r,r" </pre> -</div> <p>Inline assembler expressions may <b>only</b> be used as the callee operand of a <a href="#i_call"><tt>call</tt> instruction</a>. Thus, typically we have:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> %X = call i32 asm "<a href="#int_bswap">bswap</a> $0", "=r,r"(i32 %Y) </pre> -</div> <p>Inline asms with side effects not visible in the constraint list must be marked as having side effects. This is done through the use of the '<tt>sideeffect</tt>' keyword, like so:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> call void asm sideeffect "eieio", ""() </pre> -</div> <p>In some cases inline asms will contain code that will not work unless the stack is aligned in some way, such as calls or SSE instructions on x86, @@ -2635,11 +2621,9 @@ call void asm sideeffect "eieio", ""() contain and should generate its usual stack alignment code in the prologue if the '<tt>alignstack</tt>' keyword is present:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> call void asm alignstack "eieio", ""() </pre> -</div> <p>If both keywords appear the '<tt>sideeffect</tt>' keyword must come first.</p> @@ -2663,13 +2647,11 @@ call void asm alignstack "eieio", ""() front-end to correlate backend errors that occur with inline asm back to the source code that produced it. For example:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> call void asm sideeffect "something bad", ""()<b>, !srcloc !42</b> ... !42 = !{ i32 1234567 } </pre> -</div> <p>It is up to the front-end to make sense of the magic numbers it places in the IR.</p> @@ -2704,22 +2686,18 @@ call void asm sideeffect "something bad", ""()<b>, !srcloc !42</b> example: "<tt>!foo = metadata !{!4, !3}</tt>". <p>Metadata can be used as function arguments. Here <tt>llvm.dbg.value</tt> - function is using two metadata arguments. + function is using two metadata arguments.</p> - <div class="doc_code"> - <pre> + <pre class="doc_code"> call void @llvm.dbg.value(metadata !24, i64 0, metadata !25) </pre> - </div></p> <p>Metadata can be attached with an instruction. Here metadata <tt>!21</tt> is - attached with <tt>add</tt> instruction using <tt>!dbg</tt> identifier. + attached with <tt>add</tt> instruction using <tt>!dbg</tt> identifier.</p> - <div class="doc_code"> - <pre> + <pre class="doc_code"> %indvar.next = add i64 %indvar, 1, !dbg !21 </pre> - </div></p> </div> @@ -3520,7 +3498,7 @@ Instruction</a> </div> <p>If the <tt>exact</tt> keyword is present, the result value of the <tt>sdiv</tt> is a <a href="#trapvalues">trap value</a> if the result would - be rounded or if overflow would occur.</p> + be rounded.</p> <h5>Example:</h5> <pre> @@ -4239,7 +4217,7 @@ Instruction</a> </div> <h5>Syntax:</h5> <pre> - <result> = alloca <type>[, i32 <NumElements>][, align <alignment>] <i>; yields {type*}:result</i> + <result> = alloca <type>[, <ty> <NumElements>][, align <alignment>] <i>; yields {type*}:result</i> </pre> <h5>Overview:</h5> @@ -4347,8 +4325,8 @@ Instruction</a> </div> <h5>Syntax:</h5> <pre> - store <ty> <value>, <ty>* <pointer>[, align <alignment>][, !nontemporal !<index>] <i>; yields {void}</i> - volatile store <ty> <value>, <ty>* <pointer>[, align <alignment>][, !nontemporal !<index>] <i>; yields {void}</i> + store <ty> <value>, <ty>* <pointer>[, align <alignment>][, !nontemporal !<index>] <i>; yields {void}</i> + volatile store <ty> <value>, <ty>* <pointer>[, align <alignment>][, !nontemporal !<index>] <i>; yields {void}</i> </pre> <h5>Overview:</h5> @@ -4373,7 +4351,7 @@ Instruction</a> </div> produce less efficient code. An alignment of 1 is always safe.</p> <p>The optional !nontemporal metadata must reference a single metatadata - name <index> corresponding to a metadata node with one i32 entry of + name <index> corresponding to a metadata node with one i32 entry of value 1. The existence of the !nontemporal metatadata on the instruction tells the optimizer and code generator that this load is not expected to be reused in the cache. The code generator may @@ -4440,8 +4418,7 @@ Instruction</a> </div> <p>For example, let's consider a C code fragment and how it gets compiled to LLVM:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> struct RT { char A; int B[10][20]; @@ -4457,12 +4434,10 @@ int *foo(struct ST *s) { return &s[1].Z.B[5][13]; } </pre> -</div> <p>The LLVM code generated by the GCC frontend is:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> %RT = <a href="#namedtypes">type</a> { i8 , [10 x [20 x i32]], i8 } %ST = <a href="#namedtypes">type</a> { i32, double, %RT } @@ -4472,7 +4447,6 @@ entry: ret i32* %reg } </pre> -</div> <h5>Semantics:</h5> <p>In the example above, the first index is indexing into the '<tt>%ST*</tt>' @@ -5406,7 +5380,7 @@ Loop: ; Infinite loop that counts from 0 on up... <h5>Example:</h5> <pre> %retval = call i32 @test(i32 %argc) - call i32 (i8 *, ...)* @printf(i8 * %msg, i32 12, i8 42) <i>; yields i32</i> + call i32 (i8*, ...)* @printf(i8* %msg, i32 12, i8 42) <i>; yields i32</i> %X = tail call i32 @foo() <i>; yields i32</i> %Y = tail call <a href="#callingconv">fastcc</a> i32 @foo() <i>; yields i32</i> call void %foo(i8 97 signext) @@ -5543,8 +5517,7 @@ freestanding environments and non-C-based languages.</p> instruction and the variable argument handling intrinsic functions are used.</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> define i32 @test(i32 %X, ...) { ; Initialize variable argument processing %ap = alloca i8* @@ -5569,7 +5542,6 @@ declare void @llvm.va_start(i8*) declare void @llvm.va_copy(i8*, i8*) declare void @llvm.va_end(i8*) </pre> -</div> </div> @@ -5839,7 +5811,7 @@ LLVM</a>.</p> <h5>Syntax:</h5> <pre> - declare i8 *@llvm.frameaddress(i32 <level>) + declare i8* @llvm.frameaddress(i32 <level>) </pre> <h5>Overview:</h5> @@ -5873,7 +5845,7 @@ LLVM</a>.</p> <h5>Syntax:</h5> <pre> - declare i8 *@llvm.stacksave() + declare i8* @llvm.stacksave() </pre> <h5>Overview:</h5> @@ -5903,7 +5875,7 @@ LLVM</a>.</p> <h5>Syntax:</h5> <pre> - declare void @llvm.stackrestore(i8 * %ptr) + declare void @llvm.stackrestore(i8* %ptr) </pre> <h5>Overview:</h5> @@ -5992,7 +5964,7 @@ LLVM</a>.</p> <h5>Syntax:</h5> <pre> - declare i64 @llvm.readcyclecounter( ) + declare i64 @llvm.readcyclecounter() </pre> <h5>Overview:</h5> @@ -6037,9 +6009,9 @@ LLVM</a>.</p> all bit widths however.</p> <pre> - declare void @llvm.memcpy.p0i8.p0i8.i32(i8 * <dest>, i8 * <src>, + declare void @llvm.memcpy.p0i8.p0i8.i32(i8* <dest>, i8* <src>, i32 <len>, i32 <align>, i1 <isvolatile>) - declare void @llvm.memcpy.p0i8.p0i8.i64(i8 * <dest>, i8 * <src>, + declare void @llvm.memcpy.p0i8.p0i8.i64(i8* <dest>, i8* <src>, i64 <len>, i32 <align>, i1 <isvolatile>) </pre> @@ -6091,9 +6063,9 @@ LLVM</a>.</p> widths however.</p> <pre> - declare void @llvm.memmove.p0i8.p0i8.i32(i8 * <dest>, i8 * <src>, + declare void @llvm.memmove.p0i8.p0i8.i32(i8* <dest>, i8* <src>, i32 <len>, i32 <align>, i1 <isvolatile>) - declare void @llvm.memmove.p0i8.p0i8.i64(i8 * <dest>, i8 * <src>, + declare void @llvm.memmove.p0i8.p0i8.i64(i8* <dest>, i8* <src>, i64 <len>, i32 <align>, i1 <isvolatile>) </pre> @@ -6147,9 +6119,9 @@ LLVM</a>.</p> widths however.</p> <pre> - declare void @llvm.memset.p0i8.i32(i8 * <dest>, i8 <val>, + declare void @llvm.memset.p0i8.i32(i8* <dest>, i8 <val>, i32 <len>, i32 <align>, i1 <isvolatile>) - declare void @llvm.memset.p0i8.i64(i8 * <dest>, i8 <val>, + declare void @llvm.memset.p0i8.i64(i8* <dest>, i8 <val>, i64 <len>, i32 <align>, i1 <isvolatile>) </pre> @@ -6922,7 +6894,8 @@ LLVM</a>.</p> <div class="doc_text"> <p>This intrinsic makes it possible to excise one parameter, marked with - the <tt>nest</tt> attribute, from a function. The result is a callable + the <a href="#nest"><tt>nest</tt></a> attribute, from a function. + The result is a callable function pointer lacking the nest parameter - the caller does not need to provide a value for it. Instead, the value to use is stored in advance in a "trampoline", a block of memory usually allocated on the stack, which also @@ -6934,17 +6907,15 @@ LLVM</a>.</p> pointer has signature <tt>i32 (i32, i32)*</tt>. It can be created as follows:</p> -<div class="doc_code"> -<pre> +<pre class="doc_code"> %tramp = alloca [10 x i8], align 4 ; size and alignment only correct for X86 %tramp1 = getelementptr [10 x i8]* %tramp, i32 0, i32 0 - %p = call i8* @llvm.init.trampoline( i8* %tramp1, i8* bitcast (i32 (i8* nest , i32, i32)* @f to i8*), i8* %nval ) + %p = call i8* @llvm.init.trampoline(i8* %tramp1, i8* bitcast (i32 (i8* nest , i32, i32)* @f to i8*), i8* %nval) %fp = bitcast i8* %p to i32 (i32, i32)* </pre> -</div> -<p>The call <tt>%val = call i32 %fp( i32 %x, i32 %y )</tt> is then equivalent - to <tt>%val = call i32 %f( i8* %nval, i32 %x, i32 %y )</tt>.</p> +<p>The call <tt>%val = call i32 %fp(i32 %x, i32 %y)</tt> is then equivalent + to <tt>%val = call i32 %f(i8* %nval, i32 %x, i32 %y)</tt>.</p> </div> @@ -7024,7 +6995,7 @@ LLVM</a>.</p> <div class="doc_text"> <h5>Syntax:</h5> <pre> - declare void @llvm.memory.barrier( i1 <ll>, i1 <ls>, i1 <sl>, i1 <ss>, i1 <device> ) + declare void @llvm.memory.barrier(i1 <ll>, i1 <ls>, i1 <sl>, i1 <ss>, i1 <device>) </pre> <h5>Overview:</h5> @@ -7081,7 +7052,7 @@ LLVM</a>.</p> store i32 4, %ptr %result1 = load i32* %ptr <i>; yields {i32}:result1 = 4</i> - call void @llvm.memory.barrier( i1 false, i1 true, i1 false, i1 false ) + call void @llvm.memory.barrier(i1 false, i1 true, i1 false, i1 false) <i>; guarantee the above finishes</i> store i32 8, %ptr <i>; before this begins</i> </pre> @@ -7101,10 +7072,10 @@ LLVM</a>.</p> support all bit widths however.</p> <pre> - declare i8 @llvm.atomic.cmp.swap.i8.p0i8( i8* <ptr>, i8 <cmp>, i8 <val> ) - declare i16 @llvm.atomic.cmp.swap.i16.p0i16( i16* <ptr>, i16 <cmp>, i16 <val> ) - declare i32 @llvm.atomic.cmp.swap.i32.p0i32( i32* <ptr>, i32 <cmp>, i32 <val> ) - declare i64 @llvm.atomic.cmp.swap.i64.p0i64( i64* <ptr>, i64 <cmp>, i64 <val> ) + declare i8 @llvm.atomic.cmp.swap.i8.p0i8(i8* <ptr>, i8 <cmp>, i8 <val>) + declare i16 @llvm.atomic.cmp.swap.i16.p0i16(i16* <ptr>, i16 <cmp>, i16 <val>) + declare i32 @llvm.atomic.cmp.swap.i32.p0i32(i32* <ptr>, i32 <cmp>, i32 <val>) + declare i64 @llvm.atomic.cmp.swap.i64.p0i64(i64* <ptr>, i64 <cmp>, i64 <val>) </pre> <h5>Overview:</h5> @@ -7133,13 +7104,13 @@ LLVM</a>.</p> store i32 4, %ptr %val1 = add i32 4, 4 -%result1 = call i32 @llvm.atomic.cmp.swap.i32.p0i32( i32* %ptr, i32 4, %val1 ) +%result1 = call i32 @llvm.atomic.cmp.swap.i32.p0i32(i32* %ptr, i32 4, %val1) <i>; yields {i32}:result1 = 4</i> %stored1 = icmp eq i32 %result1, 4 <i>; yields {i1}:stored1 = true</i> %memval1 = load i32* %ptr <i>; yields {i32}:memval1 = 8</i> %val2 = add i32 1, 1 -%result2 = call i32 @llvm.atomic.cmp.swap.i32.p0i32( i32* %ptr, i32 5, %val2 ) +%result2 = call i32 @llvm.atomic.cmp.swap.i32.p0i32(i32* %ptr, i32 5, %val2) <i>; yields {i32}:result2 = 8</i> %stored2 = icmp eq i32 %result2, 5 <i>; yields {i1}:stored2 = false</i> @@ -7159,10 +7130,10 @@ LLVM</a>.</p> integer bit width. Not all targets support all bit widths however.</p> <pre> - declare i8 @llvm.atomic.swap.i8.p0i8( i8* <ptr>, i8 <val> ) - declare i16 @llvm.atomic.swap.i16.p0i16( i16* <ptr>, i16 <val> ) - declare i32 @llvm.atomic.swap.i32.p0i32( i32* <ptr>, i32 <val> ) - declare i64 @llvm.atomic.swap.i64.p0i64( i64* <ptr>, i64 <val> ) + declare i8 @llvm.atomic.swap.i8.p0i8(i8* <ptr>, i8 <val>) + declare i16 @llvm.atomic.swap.i16.p0i16(i16* <ptr>, i16 <val>) + declare i32 @llvm.atomic.swap.i32.p0i32(i32* <ptr>, i32 <val>) + declare i64 @llvm.atomic.swap.i64.p0i64(i64* <ptr>, i64 <val>) </pre> <h5>Overview:</h5> @@ -7189,13 +7160,13 @@ LLVM</a>.</p> store i32 4, %ptr %val1 = add i32 4, 4 -%result1 = call i32 @llvm.atomic.swap.i32.p0i32( i32* %ptr, i32 %val1 ) +%result1 = call i32 @llvm.atomic.swap.i32.p0i32(i32* %ptr, i32 %val1) <i>; yields {i32}:result1 = 4</i> %stored1 = icmp eq i32 %result1, 4 <i>; yields {i1}:stored1 = true</i> %memval1 = load i32* %ptr <i>; yields {i32}:memval1 = 8</i> %val2 = add i32 1, 1 -%result2 = call i32 @llvm.atomic.swap.i32.p0i32( i32* %ptr, i32 %val2 ) +%result2 = call i32 @llvm.atomic.swap.i32.p0i32(i32* %ptr, i32 %val2) <i>; yields {i32}:result2 = 8</i> %stored2 = icmp eq i32 %result2, 8 <i>; yields {i1}:stored2 = true</i> @@ -7217,10 +7188,10 @@ LLVM</a>.</p> any integer bit width. Not all targets support all bit widths however.</p> <pre> - declare i8 @llvm.atomic.load.add.i8.p0i8( i8* <ptr>, i8 <delta> ) - declare i16 @llvm.atomic.load.add.i16.p0i16( i16* <ptr>, i16 <delta> ) - declare i32 @llvm.atomic.load.add.i32.p0i32( i32* <ptr>, i32 <delta> ) - declare i64 @llvm.atomic.load.add.i64.p0i64( i64* <ptr>, i64 <delta> ) + declare i8 @llvm.atomic.load.add.i8.p0i8(i8* <ptr>, i8 <delta>) + declare i16 @llvm.atomic.load.add.i16.p0i16(i16* <ptr>, i16 <delta>) + declare i32 @llvm.atomic.load.add.i32.p0i32(i32* <ptr>, i32 <delta>) + declare i64 @llvm.atomic.load.add.i64.p0i64(i64* <ptr>, i64 <delta>) </pre> <h5>Overview:</h5> @@ -7243,11 +7214,11 @@ LLVM</a>.</p> %mallocP = tail call i8* @malloc(i32 ptrtoint (i32* getelementptr (i32* null, i32 1) to i32)) %ptr = bitcast i8* %mallocP to i32* store i32 4, %ptr -%result1 = call i32 @llvm.atomic.load.add.i32.p0i32( i32* %ptr, i32 4 ) +%result1 = call i32 @llvm.atomic.load.add.i32.p0i32(i32* %ptr, i32 4) <i>; yields {i32}:result1 = 4</i> -%result2 = call i32 @llvm.atomic.load.add.i32.p0i32( i32* %ptr, i32 2 ) +%result2 = call i32 @llvm.atomic.load.add.i32.p0i32(i32* %ptr, i32 2) <i>; yields {i32}:result2 = 8</i> -%result3 = call i32 @llvm.atomic.load.add.i32.p0i32( i32* %ptr, i32 5 ) +%result3 = call i32 @llvm.atomic.load.add.i32.p0i32(i32* %ptr, i32 5) <i>; yields {i32}:result3 = 10</i> %memval1 = load i32* %ptr <i>; yields {i32}:memval1 = 15</i> </pre> @@ -7268,10 +7239,10 @@ LLVM</a>.</p> support all bit widths however.</p> <pre> - declare i8 @llvm.atomic.load.sub.i8.p0i32( i8* <ptr>, i8 <delta> ) - declare i16 @llvm.atomic.load.sub.i16.p0i32( i16* <ptr>, i16 <delta> ) - declare i32 @llvm.atomic.load.sub.i32.p0i32( i32* <ptr>, i32 <delta> ) - declare i64 @llvm.atomic.load.sub.i64.p0i32( i64* <ptr>, i64 <delta> ) + declare i8 @llvm.atomic.load.sub.i8.p0i32(i8* <ptr>, i8 <delta>) + declare i16 @llvm.atomic.load.sub.i16.p0i32(i16* <ptr>, i16 <delta>) + declare i32 @llvm.atomic.load.sub.i32.p0i32(i32* <ptr>, i32 <delta>) + declare i64 @llvm.atomic.load.sub.i64.p0i32(i64* <ptr>, i64 <delta>) </pre> <h5>Overview:</h5> @@ -7295,11 +7266,11 @@ LLVM</a>.</p> %mallocP = tail call i8* @malloc(i32 ptrtoint (i32* getelementptr (i32* null, i32 1) to i32)) %ptr = bitcast i8* %mallocP to i32* store i32 8, %ptr -%result1 = call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %ptr, i32 4 ) +%result1 = call i32 @llvm.atomic.load.sub.i32.p0i32(i32* %ptr, i32 4) <i>; yields {i32}:result1 = 8</i> -%result2 = call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %ptr, i32 2 ) +%result2 = call i32 @llvm.atomic.load.sub.i32.p0i32(i32* %ptr, i32 2) <i>; yields {i32}:result2 = 4</i> -%result3 = call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %ptr, i32 5 ) +%result3 = call i32 @llvm.atomic.load.sub.i32.p0i32(i32* %ptr, i32 5) <i>; yields {i32}:result3 = 2</i> %memval1 = load i32* %ptr <i>; yields {i32}:memval1 = -3</i> </pre> @@ -7324,31 +7295,31 @@ LLVM</a>.</p> widths however.</p> <pre> - declare i8 @llvm.atomic.load.and.i8.p0i8( i8* <ptr>, i8 <delta> ) - declare i16 @llvm.atomic.load.and.i16.p0i16( i16* <ptr>, i16 <delta> ) - declare i32 @llvm.atomic.load.and.i32.p0i32( i32* <ptr>, i32 <delta> ) - declare i64 @llvm.atomic.load.and.i64.p0i64( i64* <ptr>, i64 <delta> ) + declare i8 @llvm.atomic.load.and.i8.p0i8(i8* <ptr>, i8 <delta>) + declare i16 @llvm.atomic.load.and.i16.p0i16(i16* <ptr>, i16 <delta>) + declare i32 @llvm.atomic.load.and.i32.p0i32(i32* <ptr>, i32 <delta>) + declare i64 @llvm.atomic.load.and.i64.p0i64(i64* <ptr>, i64 <delta>) </pre> <pre> - declare i8 @llvm.atomic.load.or.i8.p0i8( i8* <ptr>, i8 <delta> ) - declare i16 @llvm.atomic.load.or.i16.p0i16( i16* <ptr>, i16 <delta> ) - declare i32 @llvm.atomic.load.or.i32.p0i32( i32* <ptr>, i32 <delta> ) - declare i64 @llvm.atomic.load.or.i64.p0i64( i64* <ptr>, i64 <delta> ) + declare i8 @llvm.atomic.load.or.i8.p0i8(i8* <ptr>, i8 <delta>) + declare i16 @llvm.atomic.load.or.i16.p0i16(i16* <ptr>, i16 <delta>) + declare i32 @llvm.atomic.load.or.i32.p0i32(i32* <ptr>, i32 <delta>) + declare i64 @llvm.atomic.load.or.i64.p0i64(i64* <ptr>, i64 <delta>) </pre> <pre> - declare i8 @llvm.atomic.load.nand.i8.p0i32( i8* <ptr>, i8 <delta> ) - declare i16 @llvm.atomic.load.nand.i16.p0i32( i16* <ptr>, i16 <delta> ) - declare i32 @llvm.atomic.load.nand.i32.p0i32( i32* <ptr>, i32 <delta> ) - declare i64 @llvm.atomic.load.nand.i64.p0i32( i64* <ptr>, i64 <delta> ) + declare i8 @llvm.atomic.load.nand.i8.p0i32(i8* <ptr>, i8 <delta>) + declare i16 @llvm.atomic.load.nand.i16.p0i32(i16* <ptr>, i16 <delta>) + declare i32 @llvm.atomic.load.nand.i32.p0i32(i32* <ptr>, i32 <delta>) + declare i64 @llvm.atomic.load.nand.i64.p0i32(i64* <ptr>, i64 <delta>) </pre> <pre> - declare i8 @llvm.atomic.load.xor.i8.p0i32( i8* <ptr>, i8 <delta> ) - declare i16 @llvm.atomic.load.xor.i16.p0i32( i16* <ptr>, i16 <delta> ) - declare i32 @llvm.atomic.load.xor.i32.p0i32( i32* <ptr>, i32 <delta> ) - declare i64 @llvm.atomic.load.xor.i64.p0i32( i64* <ptr>, i64 <delta> ) + declare i8 @llvm.atomic.load.xor.i8.p0i32(i8* <ptr>, i8 <delta>) + declare i16 @llvm.atomic.load.xor.i16.p0i32(i16* <ptr>, i16 <delta>) + declare i32 @llvm.atomic.load.xor.i32.p0i32(i32* <ptr>, i32 <delta>) + declare i64 @llvm.atomic.load.xor.i64.p0i32(i64* <ptr>, i64 <delta>) </pre> <h5>Overview:</h5> @@ -7373,13 +7344,13 @@ LLVM</a>.</p> %mallocP = tail call i8* @malloc(i32 ptrtoint (i32* getelementptr (i32* null, i32 1) to i32)) %ptr = bitcast i8* %mallocP to i32* store i32 0x0F0F, %ptr -%result0 = call i32 @llvm.atomic.load.nand.i32.p0i32( i32* %ptr, i32 0xFF ) +%result0 = call i32 @llvm.atomic.load.nand.i32.p0i32(i32* %ptr, i32 0xFF) <i>; yields {i32}:result0 = 0x0F0F</i> -%result1 = call i32 @llvm.atomic.load.and.i32.p0i32( i32* %ptr, i32 0xFF ) +%result1 = call i32 @llvm.atomic.load.and.i32.p0i32(i32* %ptr, i32 0xFF) <i>; yields {i32}:result1 = 0xFFFFFFF0</i> -%result2 = call i32 @llvm.atomic.load.or.i32.p0i32( i32* %ptr, i32 0F ) +%result2 = call i32 @llvm.atomic.load.or.i32.p0i32(i32* %ptr, i32 0F) <i>; yields {i32}:result2 = 0xF0</i> -%result3 = call i32 @llvm.atomic.load.xor.i32.p0i32( i32* %ptr, i32 0F ) +%result3 = call i32 @llvm.atomic.load.xor.i32.p0i32(i32* %ptr, i32 0F) <i>; yields {i32}:result3 = FF</i> %memval1 = load i32* %ptr <i>; yields {i32}:memval1 = F0</i> </pre> @@ -7403,31 +7374,31 @@ LLVM</a>.</p> address spaces. Not all targets support all bit widths however.</p> <pre> - declare i8 @llvm.atomic.load.max.i8.p0i8( i8* <ptr>, i8 <delta> ) - declare i16 @llvm.atomic.load.max.i16.p0i16( i16* <ptr>, i16 <delta> ) - declare i32 @llvm.atomic.load.max.i32.p0i32( i32* <ptr>, i32 <delta> ) - declare i64 @llvm.atomic.load.max.i64.p0i64( i64* <ptr>, i64 <delta> ) + declare i8 @llvm.atomic.load.max.i8.p0i8(i8* <ptr>, i8 <delta>) + declare i16 @llvm.atomic.load.max.i16.p0i16(i16* <ptr>, i16 <delta>) + declare i32 @llvm.atomic.load.max.i32.p0i32(i32* <ptr>, i32 <delta>) + declare i64 @llvm.atomic.load.max.i64.p0i64(i64* <ptr>, i64 <delta>) </pre> <pre> - declare i8 @llvm.atomic.load.min.i8.p0i8( i8* <ptr>, i8 <delta> ) - declare i16 @llvm.atomic.load.min.i16.p0i16( i16* <ptr>, i16 <delta> ) - declare i32 @llvm.atomic.load.min.i32.p0i32( i32* <ptr>, i32 <delta> ) - declare i64 @llvm.atomic.load.min.i64.p0i64( i64* <ptr>, i64 <delta> ) + declare i8 @llvm.atomic.load.min.i8.p0i8(i8* <ptr>, i8 <delta>) + declare i16 @llvm.atomic.load.min.i16.p0i16(i16* <ptr>, i16 <delta>) + declare i32 @llvm.atomic.load.min.i32.p0i32(i32* <ptr>, i32 <delta>) + declare i64 @llvm.atomic.load.min.i64.p0i64(i64* <ptr>, i64 <delta>) </pre> <pre> - declare i8 @llvm.atomic.load.umax.i8.p0i8( i8* <ptr>, i8 <delta> ) - declare i16 @llvm.atomic.load.umax.i16.p0i16( i16* <ptr>, i16 <delta> ) - declare i32 @llvm.atomic.load.umax.i32.p0i32( i32* <ptr>, i32 <delta> ) - declare i64 @llvm.atomic.load.umax.i64.p0i64( i64* <ptr>, i64 <delta> ) + declare i8 @llvm.atomic.load.umax.i8.p0i8(i8* <ptr>, i8 <delta>) + declare i16 @llvm.atomic.load.umax.i16.p0i16(i16* <ptr>, i16 <delta>) + declare i32 @llvm.atomic.load.umax.i32.p0i32(i32* <ptr>, i32 <delta>) + declare i64 @llvm.atomic.load.umax.i64.p0i64(i64* <ptr>, i64 <delta>) </pre> <pre> - declare i8 @llvm.atomic.load.umin.i8.p0i8( i8* <ptr>, i8 <delta> ) - declare i16 @llvm.atomic.load.umin.i16.p0i16( i16* <ptr>, i16 <delta> ) - declare i32 @llvm.atomic.load.umin.i32.p0i32( i32* <ptr>, i32 <delta> ) - declare i64 @llvm.atomic.load.umin.i64.p0i64( i64* <ptr>, i64 <delta> ) + declare i8 @llvm.atomic.load.umin.i8.p0i8(i8* <ptr>, i8 <delta>) + declare i16 @llvm.atomic.load.umin.i16.p0i16(i16* <ptr>, i16 <delta>) + declare i32 @llvm.atomic.load.umin.i32.p0i32(i32* <ptr>, i32 <delta>) + declare i64 @llvm.atomic.load.umin.i64.p0i64(i64* <ptr>, i64 <delta>) </pre> <h5>Overview:</h5> @@ -7452,13 +7423,13 @@ LLVM</a>.</p> %mallocP = tail call i8* @malloc(i32 ptrtoint (i32* getelementptr (i32* null, i32 1) to i32)) %ptr = bitcast i8* %mallocP to i32* store i32 7, %ptr -%result0 = call i32 @llvm.atomic.load.min.i32.p0i32( i32* %ptr, i32 -2 ) +%result0 = call i32 @llvm.atomic.load.min.i32.p0i32(i32* %ptr, i32 -2) <i>; yields {i32}:result0 = 7</i> -%result1 = call i32 @llvm.atomic.load.max.i32.p0i32( i32* %ptr, i32 8 ) +%result1 = call i32 @llvm.atomic.load.max.i32.p0i32(i32* %ptr, i32 8) <i>; yields {i32}:result1 = -2</i> -%result2 = call i32 @llvm.atomic.load.umin.i32.p0i32( i32* %ptr, i32 10 ) +%result2 = call i32 @llvm.atomic.load.umin.i32.p0i32(i32* %ptr, i32 10) <i>; yields {i32}:result2 = 8</i> -%result3 = call i32 @llvm.atomic.load.umax.i32.p0i32( i32* %ptr, i32 30 ) +%result3 = call i32 @llvm.atomic.load.umax.i32.p0i32(i32* %ptr, i32 30) <i>; yields {i32}:result3 = 8</i> %memval1 = load i32* %ptr <i>; yields {i32}:memval1 = 30</i> </pre> @@ -7613,7 +7584,7 @@ LLVM</a>.</p> <h5>Syntax:</h5> <pre> - declare void @llvm.var.annotation(i8* <val>, i8* <str>, i8* <str>, i32 <int> ) + declare void @llvm.var.annotation(i8* <val>, i8* <str>, i8* <str>, i32 <int>) </pre> <h5>Overview:</h5> @@ -7644,11 +7615,11 @@ LLVM</a>.</p> any integer bit width.</p> <pre> - declare i8 @llvm.annotation.i8(i8 <val>, i8* <str>, i8* <str>, i32 <int> ) - declare i16 @llvm.annotation.i16(i16 <val>, i8* <str>, i8* <str>, i32 <int> ) - declare i32 @llvm.annotation.i32(i32 <val>, i8* <str>, i8* <str>, i32 <int> ) - declare i64 @llvm.annotation.i64(i64 <val>, i8* <str>, i8* <str>, i32 <int> ) - declare i256 @llvm.annotation.i256(i256 <val>, i8* <str>, i8* <str>, i32 <int> ) + declare i8 @llvm.annotation.i8(i8 <val>, i8* <str>, i8* <str>, i32 <int>) + declare i16 @llvm.annotation.i16(i16 <val>, i8* <str>, i8* <str>, i32 <int>) + declare i32 @llvm.annotation.i32(i32 <val>, i8* <str>, i8* <str>, i32 <int>) + declare i64 @llvm.annotation.i64(i64 <val>, i8* <str>, i8* <str>, i32 <int>) + declare i256 @llvm.annotation.i256(i256 <val>, i8* <str>, i8* <str>, i32 <int>) </pre> <h5>Overview:</h5> @@ -7702,7 +7673,7 @@ LLVM</a>.</p> <h5>Syntax:</h5> <pre> - declare void @llvm.stackprotector( i8* <guard>, i8** <slot> ) + declare void @llvm.stackprotector(i8* <guard>, i8** <slot>) </pre> <h5>Overview:</h5> @@ -7736,8 +7707,8 @@ LLVM</a>.</p> <h5>Syntax:</h5> <pre> - declare i32 @llvm.objectsize.i32( i8* <object>, i1 <type> ) - declare i64 @llvm.objectsize.i64( i8* <object>, i1 <type> ) + declare i32 @llvm.objectsize.i32(i8* <object>, i1 <type>) + declare i64 @llvm.objectsize.i64(i8* <object>, i1 <type>) </pre> <h5>Overview:</h5> @@ -7773,7 +7744,7 @@ LLVM</a>.</p> <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-26 23:56:15 +0200 (Wed, 26 May 2010) $ + Last modified: $Date: 2010-07-13 14:26:09 +0200 (Tue, 13 Jul 2010) $ </address> </body> diff --git a/docs/MakefileGuide.html b/docs/MakefileGuide.html index 2e2fdc5..dd90478 100644 --- a/docs/MakefileGuide.html +++ b/docs/MakefileGuide.html @@ -652,7 +652,7 @@ the profiled tools (<tt>gmon.out</tt>).</dd> <dt><a name="DISABLE_ASSERTIONS"><tt>DISABLE_ASSERTIONS</tt></a></dt> <dd>If set to any value, causes the build to disable assertions, even if - building a release or profile build. This will exclude all assertion check + building a debug or profile build. This will exclude all assertion check code from the build. LLVM will execute faster, but with little help when things go wrong.</dd> <dt><a name="EXPERIMENTAL_DIRS"><tt>EXPERIMENTAL_DIRS</tt></a></dt> @@ -1025,7 +1025,7 @@ <a href="mailto:rspencer@x10sys.com">Reid Spencer</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-07-07 09:48:00 +0200 (Wed, 07 Jul 2010) $ </address> </body> </html> diff --git a/docs/Passes.html b/docs/Passes.html index c239e44..70d9097 100644 --- a/docs/Passes.html +++ b/docs/Passes.html @@ -27,7 +27,7 @@ while (<HELP>) { my $o = $order{$1}; $o = "000" unless defined $o; push @x, "$o<tr><td><a href=\"#$1\">-$1</a></td><td>$2</td></tr>\n"; - push @y, "$o <a name=\"$1\">$2</a>\n"; + push @y, "$o <a name=\"$1\">-$1: $2</a>\n"; } @x = map { s/^\d\d\d//; $_ } sort @x; @y = map { s/^\d\d\d//; $_ } sort @y; @@ -91,29 +91,46 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <tr><td><a href="#dot-postdom-only">-dot-postdom-only</a></td><td>Print post dominator tree of function to 'dot' file (with no function bodies)</td></tr> <tr><td><a href="#globalsmodref-aa">-globalsmodref-aa</a></td><td>Simple mod/ref analysis for globals</td></tr> <tr><td><a href="#instcount">-instcount</a></td><td>Counts the various types of Instructions</td></tr> +<tr><td><a href="#interprocedural-aa-eval">-interprocedural-aa-eval</a></td><td>Exhaustive Interprocedural Alias Analysis Precision Evaluator</td></tr> +<tr><td><a href="#interprocedural-basic-aa">-interprocedural-basic-aa</a></td><td>Interprocedural Basic Alias Analysis</td></tr> <tr><td><a href="#intervals">-intervals</a></td><td>Interval Partition Construction</td></tr> -<tr><td><a href="#loops">-loops</a></td><td>Natural Loop Construction</td></tr> +<tr><td><a href="#iv-users">-iv-users</a></td><td>Induction Variable Users</td></tr> +<tr><td><a href="#lazy-value-info">-lazy-value-info</a></td><td>Lazy Value Information Analysis</td></tr> +<tr><td><a href="#lda">-lda</a></td><td>Loop Dependence Analysis</td></tr> +<tr><td><a href="#libcall-aa">-libcall-aa</a></td><td>LibCall Alias Analysis</td></tr> +<tr><td><a href="#lint">-lint</a></td><td>Check for common errors in LLVM IR</td></tr> +<tr><td><a href="#live-values">-live-values</a></td><td>Value Liveness Analysis</td></tr> +<tr><td><a href="#loops">-loops</a></td><td>Natural Loop Information</td></tr> <tr><td><a href="#memdep">-memdep</a></td><td>Memory Dependence Analysis</td></tr> +<tr><td><a href="#module-debuginfo">-module-debuginfo</a></td><td>Prints module debug info metadata</td></tr> <tr><td><a href="#no-aa">-no-aa</a></td><td>No Alias Analysis (always returns 'may' alias)</td></tr> <tr><td><a href="#no-profile">-no-profile</a></td><td>No Profile Information</td></tr> +<tr><td><a href="#pointertracking">-pointertracking</a></td><td>Track pointer bounds</td></tr> <tr><td><a href="#postdomfrontier">-postdomfrontier</a></td><td>Post-Dominance Frontier Construction</td></tr> <tr><td><a href="#postdomtree">-postdomtree</a></td><td>Post-Dominator Tree Construction</td></tr> <tr><td><a href="#print-alias-sets">-print-alias-sets</a></td><td>Alias Set Printer</td></tr> <tr><td><a href="#print-callgraph">-print-callgraph</a></td><td>Print a call graph</td></tr> <tr><td><a href="#print-callgraph-sccs">-print-callgraph-sccs</a></td><td>Print SCCs of the Call Graph</td></tr> <tr><td><a href="#print-cfg-sccs">-print-cfg-sccs</a></td><td>Print SCCs of each function CFG</td></tr> +<tr><td><a href="#print-dbginfo">-print-dbginfo</a></td><td>Print debug info in human readable form</td></tr> +<tr><td><a href="#print-dom-info">-print-dom-info</a></td><td>Dominator Info Printer</td></tr> <tr><td><a href="#print-externalfnconstants">-print-externalfnconstants</a></td><td>Print external fn callsites passed constants</td></tr> <tr><td><a href="#print-function">-print-function</a></td><td>Print function to stderr</td></tr> <tr><td><a href="#print-module">-print-module</a></td><td>Print module to stderr</td></tr> <tr><td><a href="#print-used-types">-print-used-types</a></td><td>Find Used Types</td></tr> +<tr><td><a href="#profile-estimator">-profile-estimator</a></td><td>Estimate profiling information</td></tr> <tr><td><a href="#profile-loader">-profile-loader</a></td><td>Load profile information from llvmprof.out</td></tr> +<tr><td><a href="#profile-verifier">-profile-verifier</a></td><td>Verify profiling information</td></tr> <tr><td><a href="#scalar-evolution">-scalar-evolution</a></td><td>Scalar Evolution Analysis</td></tr> +<tr><td><a href="#scev-aa">-scev-aa</a></td><td>ScalarEvolution-based Alias Analysis</td></tr> <tr><td><a href="#targetdata">-targetdata</a></td><td>Target Data Layout</td></tr> <tr><th colspan="2"><b>TRANSFORM PASSES</b></th></tr> <tr><th>Option</th><th>Name</th></tr> +<tr><td><a href="#abcd">-abcd</a></td><td>Remove redundant conditional branches</td></tr> <tr><td><a href="#adce">-adce</a></td><td>Aggressive Dead Code Elimination</td></tr> +<tr><td><a href="#always-inline">-always-inline</a></td><td>Inliner for always_inline functions</td></tr> <tr><td><a href="#argpromotion">-argpromotion</a></td><td>Promote 'by reference' arguments to scalars</td></tr> <tr><td><a href="#block-placement">-block-placement</a></td><td>Profile Guided Basic Block Placement</td></tr> <tr><td><a href="#break-crit-edges">-break-crit-edges</a></td><td>Break critical edges in CFG</td></tr> @@ -125,17 +142,14 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <tr><td><a href="#deadtypeelim">-deadtypeelim</a></td><td>Dead Type Elimination</td></tr> <tr><td><a href="#die">-die</a></td><td>Dead Instruction Elimination</td></tr> <tr><td><a href="#dse">-dse</a></td><td>Dead Store Elimination</td></tr> +<tr><td><a href="#functionattrs">-functionattrs</a></td><td>Deduce function attributes</td></tr> <tr><td><a href="#globaldce">-globaldce</a></td><td>Dead Global Elimination</td></tr> <tr><td><a href="#globalopt">-globalopt</a></td><td>Global Variable Optimizer</td></tr> <tr><td><a href="#gvn">-gvn</a></td><td>Global Value Numbering</td></tr> -<tr><td><a href="#indmemrem">-indmemrem</a></td><td>Indirect Malloc and Free Removal</td></tr> <tr><td><a href="#indvars">-indvars</a></td><td>Canonicalize Induction Variables</td></tr> <tr><td><a href="#inline">-inline</a></td><td>Function Integration/Inlining</td></tr> -<tr><td><a href="#insert-block-profiling">-insert-block-profiling</a></td><td>Insert instrumentation for block profiling</td></tr> <tr><td><a href="#insert-edge-profiling">-insert-edge-profiling</a></td><td>Insert instrumentation for edge profiling</td></tr> -<tr><td><a href="#insert-function-profiling">-insert-function-profiling</a></td><td>Insert instrumentation for function profiling</td></tr> -<tr><td><a href="#insert-null-profiling-rs">-insert-null-profiling-rs</a></td><td>Measure profiling framework overhead</td></tr> -<tr><td><a href="#insert-rs-profiling-framework">-insert-rs-profiling-framework</a></td><td>Insert random sampling instrumentation framework</td></tr> +<tr><td><a href="#insert-optimal-edge-profiling">-insert-optimal-edge-profiling</a></td><td>Insert optimal instrumentation for edge profiling</td></tr> <tr><td><a href="#instcombine">-instcombine</a></td><td>Combine redundant instructions</td></tr> <tr><td><a href="#internalize">-internalize</a></td><td>Internalize Global Symbols</td></tr> <tr><td><a href="#ipconstprop">-ipconstprop</a></td><td>Interprocedural constant propagation</td></tr> @@ -152,22 +166,32 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <tr><td><a href="#loop-unroll">-loop-unroll</a></td><td>Unroll loops</td></tr> <tr><td><a href="#loop-unswitch">-loop-unswitch</a></td><td>Unswitch loops</td></tr> <tr><td><a href="#loopsimplify">-loopsimplify</a></td><td>Canonicalize natural loops</td></tr> -<tr><td><a href="#lowerallocs">-lowerallocs</a></td><td>Lower allocations from instructions to calls</td></tr> <tr><td><a href="#lowerinvoke">-lowerinvoke</a></td><td>Lower invoke and unwind, for unwindless code generators</td></tr> <tr><td><a href="#lowersetjmp">-lowersetjmp</a></td><td>Lower Set Jump</td></tr> <tr><td><a href="#lowerswitch">-lowerswitch</a></td><td>Lower SwitchInst's to branches</td></tr> <tr><td><a href="#mem2reg">-mem2reg</a></td><td>Promote Memory to Register</td></tr> <tr><td><a href="#memcpyopt">-memcpyopt</a></td><td>Optimize use of memcpy and friends</td></tr> +<tr><td><a href="#mergefunc">-mergefunc</a></td><td>Merge Functions</td></tr> <tr><td><a href="#mergereturn">-mergereturn</a></td><td>Unify function exit nodes</td></tr> +<tr><td><a href="#partial-inliner">-partial-inliner</a></td><td>Partial Inliner</td></tr> +<tr><td><a href="#partialspecialization">-partialspecialization</a></td><td>Partial Specialization</td></tr> <tr><td><a href="#prune-eh">-prune-eh</a></td><td>Remove unused exception handling info</td></tr> <tr><td><a href="#reassociate">-reassociate</a></td><td>Reassociate expressions</td></tr> <tr><td><a href="#reg2mem">-reg2mem</a></td><td>Demote all values to stack slots</td></tr> <tr><td><a href="#scalarrepl">-scalarrepl</a></td><td>Scalar Replacement of Aggregates</td></tr> <tr><td><a href="#sccp">-sccp</a></td><td>Sparse Conditional Constant Propagation</td></tr> +<tr><td><a href="#sink">-sink</a></td><td>Code Sinking</td></tr> <tr><td><a href="#simplify-libcalls">-simplify-libcalls</a></td><td>Simplify well-known library calls</td></tr> +<tr><td><a href="#simplify-libcalls-halfpowr">-simplify-libcalls-halfpowr</a></td><td>Simplify half_powr library calls</td></tr> <tr><td><a href="#simplifycfg">-simplifycfg</a></td><td>Simplify the CFG</td></tr> +<tr><td><a href="#split-geps">-split-geps</a></td><td>Split complex GEPs into simple GEPs</td></tr> +<tr><td><a href="#ssi">-ssi</a></td><td>Static Single Information Construction</td></tr> +<tr><td><a href="#ssi-everything">-ssi-everything</a></td><td>Static Single Information Construction (everything, intended for debugging)</td></tr> <tr><td><a href="#strip">-strip</a></td><td>Strip all symbols from a module</td></tr> +<tr><td><a href="#strip-dead-debug-info">-strip-dead-debug-info</a></td><td>Strip debug info for unused symbols</td></tr> <tr><td><a href="#strip-dead-prototypes">-strip-dead-prototypes</a></td><td>Remove unused function declarations</td></tr> +<tr><td><a href="#strip-debug-declare">-strip-debug-declare</a></td><td>Strip all llvm.dbg.declare intrinsics</td></tr> +<tr><td><a href="#strip-nondebug">-strip-nondebug</a></td><td>Strip all symbols, except dbg symbols, from a module</td></tr> <tr><td><a href="#sretpromotion">-sretpromotion</a></td><td>Promote sret arguments</td></tr> <tr><td><a href="#tailcallelim">-tailcallelim</a></td><td>Tail Call Elimination</td></tr> <tr><td><a href="#tailduplicate">-tailduplicate</a></td><td>Tail Duplication</td></tr> @@ -177,6 +201,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <tr><th>Option</th><th>Name</th></tr> <tr><td><a href="#deadarghaX0r">-deadarghaX0r</a></td><td>Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)</td></tr> <tr><td><a href="#extract-blocks">-extract-blocks</a></td><td>Extract Basic Blocks From Module (for bugpoint use)</td></tr> +<tr><td><a href="#instnamer">-instnamer</a></td><td>Assign names to anonymous instructions</td></tr> <tr><td><a href="#preverify">-preverify</a></td><td>Preliminary module verification</td></tr> <tr><td><a href="#verify">-verify</a></td><td>Module Verifier</td></tr> <tr><td><a href="#view-cfg">-view-cfg</a></td><td>View CFG of function</td></tr> @@ -196,7 +221,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="aa-eval">Exhaustive Alias Analysis Precision Evaluator</a> + <a name="aa-eval">-aa-eval: Exhaustive Alias Analysis Precision Evaluator</a> </div> <div class="doc_text"> <p>This is a simple N^2 alias analysis accuracy evaluator. @@ -210,7 +235,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="basicaa">Basic Alias Analysis (default AA impl)</a> + <a name="basicaa">-basicaa: Basic Alias Analysis (default AA impl)</a> </div> <div class="doc_text"> <p> @@ -222,7 +247,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="basiccg">Basic CallGraph Construction</a> + <a name="basiccg">-basiccg: Basic CallGraph Construction</a> </div> <div class="doc_text"> <p>Yet to be written.</p> @@ -230,7 +255,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="codegenprepare">Optimize for code generation</a> + <a name="codegenprepare">-codegenprepare: Optimize for code generation</a> </div> <div class="doc_text"> <p> @@ -242,7 +267,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="count-aa">Count Alias Analysis Query Responses</a> + <a name="count-aa">-count-aa: Count Alias Analysis Query Responses</a> </div> <div class="doc_text"> <p> @@ -253,7 +278,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="debug-aa">AA use debugger</a> + <a name="debug-aa">-debug-aa: AA use debugger</a> </div> <div class="doc_text"> <p> @@ -270,7 +295,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="domfrontier">Dominance Frontier Construction</a> + <a name="domfrontier">-domfrontier: Dominance Frontier Construction</a> </div> <div class="doc_text"> <p> @@ -281,7 +306,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="domtree">Dominator Tree Construction</a> + <a name="domtree">-domtree: Dominator Tree Construction</a> </div> <div class="doc_text"> <p> @@ -292,7 +317,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="dot-callgraph">Print Call Graph to 'dot' file</a> + <a name="dot-callgraph">-dot-callgraph: Print Call Graph to 'dot' file</a> </div> <div class="doc_text"> <p> @@ -304,7 +329,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="dot-cfg">Print CFG of function to 'dot' file</a> + <a name="dot-cfg">-dot-cfg: Print CFG of function to 'dot' file</a> </div> <div class="doc_text"> <p> @@ -316,7 +341,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="dot-cfg-only">Print CFG of function to 'dot' file (with no function bodies)</a> + <a name="dot-cfg-only">-dot-cfg-only: Print CFG of function to 'dot' file (with no function bodies)</a> </div> <div class="doc_text"> <p> @@ -329,7 +354,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="dot-dom">Print dominator tree of function to 'dot' file</a> + <a name="dot-dom">-dot-dom: Print dominator tree of function to 'dot' file</a> </div> <div class="doc_text"> <p> @@ -341,7 +366,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="dot-dom-only">Print dominator tree of function to 'dot' file (with no + <a name="dot-dom-only">-dot-dom-only: Print dominator tree of function to 'dot' file (with no function bodies)</a> </div> <div class="doc_text"> @@ -355,7 +380,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="dot-postdom">Print post dominator tree of function to 'dot' file</a> + <a name="dot-postdom">dot-postdom: Print post dominator tree of function to 'dot' file</a> </div> <div class="doc_text"> <p> @@ -367,7 +392,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="dot-postdom-only">Print post dominator tree of function to 'dot' file + <a name="dot-postdom-only">dot-postdom-only: Print post dominator tree of function to 'dot' file (with no function bodies)</a> </div> <div class="doc_text"> @@ -381,7 +406,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="globalsmodref-aa">Simple mod/ref analysis for globals</a> + <a name="globalsmodref-aa">-globalsmodref-aa: Simple mod/ref analysis for globals</a> </div> <div class="doc_text"> <p> @@ -394,7 +419,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="instcount">Counts the various types of Instructions</a> + <a name="instcount">-instcount: Counts the various types of Instructions</a> </div> <div class="doc_text"> <p> @@ -404,7 +429,30 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="intervals">Interval Partition Construction</a> + <a name="interprocedural-aa-eval">-interprocedural-aa-eval: Exhaustive Interprocedural Alias Analysis Precision Evaluator</a> +</div> +<div class="doc_text"> + <p>This pass implements a simple N^2 alias analysis accuracy evaluator. + Basically, for each function in the program, it simply queries to see how the + alias analysis implementation answers alias queries between each pair of + pointers in the function. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="interprocedural-basic-aa">-interprocedural-basic-aa: Interprocedural Basic Alias Analysis</a> +</div> +<div class="doc_text"> + <p>This pass defines the default implementation of the Alias Analysis interface + that simply implements a few identities (two different globals cannot alias, + etc), but otherwise does no analysis. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="intervals">-intervals: Interval Partition Construction</a> </div> <div class="doc_text"> <p> @@ -420,7 +468,80 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="loops">Natural Loop Construction</a> + <a name="iv-users">-iv-users: Induction Variable Users</a> +</div> +<div class="doc_text"> + <p>Bookkeeping for "interesting" users of expressions computed from + induction variables.</p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="lazy-value-info">-lazy-value-info: Lazy Value Information Analysis</a> +</div> +<div class="doc_text"> + <p>Interface for lazy computation of value constraint information.</p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="lda">-lda: Loop Dependence Analysis</a> +</div> +<div class="doc_text"> + <p>Loop dependence analysis framework, which is used to detect dependences in + memory accesses in loops.</p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="libcall-aa">-libcall-aa: LibCall Alias Analysis</a> +</div> +<div class="doc_text"> + <p>LibCall Alias Analysis.</p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="lint">-lint: Check for common errors in LLVM IR</a> +</div> +<div class="doc_text"> + <p>This pass statically checks for common and easily-identified constructs + which produce undefined or likely unintended behavior in LLVM IR.</p> + + <p>It is not a guarantee of correctness, in two ways. First, it isn't + comprehensive. There are checks which could be done statically which are + not yet implemented. Some of these are indicated by TODO comments, but + those aren't comprehensive either. Second, many conditions cannot be + checked statically. This pass does no dynamic instrumentation, so it + can't check for all possible problems.</p> + + <p>Another limitation is that it assumes all code will be executed. A store + through a null pointer in a basic block which is never reached is harmless, + but this pass will warn about it anyway.</p> + + <p>Optimization passes may make conditions that this pass checks for more or + less obvious. If an optimization pass appears to be introducing a warning, + it may be that the optimization pass is merely exposing an existing + condition in the code.</p> + + <p>This code may be run before instcombine. In many cases, instcombine checks + for the same kinds of things and turns instructions with undefined behavior + into unreachable (or equivalent). Because of this, this pass makes some + effort to look through bitcasts and so on. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="live-values">-live-values: Values Liveness Analysis</a> +</div> +<div class="doc_text"> + <p>LLVM IR Value liveness analysis pass.</p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="loops">-loops: Natural Loop Construction</a> </div> <div class="doc_text"> <p> @@ -433,7 +554,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="memdep">Memory Dependence Analysis</a> + <a name="memdep">-memdep: Memory Dependence Analysis</a> </div> <div class="doc_text"> <p> @@ -446,7 +567,20 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="no-aa">No Alias Analysis (always returns 'may' alias)</a> + <a name="module-debuginfo">-module-debuginfo: Prints module debug info metadata</a> +</div> +<div class="doc_text"> + <p>This pass decodes the debug info metadata in a module and prints in a + (sufficiently-prepared-) human-readable form. + + For example, run this pass from opt along with the -analyze option, and + it'll print to standard output. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="no-aa">-no-aa: No Alias Analysis (always returns 'may' alias)</a> </div> <div class="doc_text"> <p> @@ -458,7 +592,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="no-profile">No Profile Information</a> + <a name="no-profile">-no-profile: No Profile Information</a> </div> <div class="doc_text"> <p> @@ -469,7 +603,16 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="postdomfrontier">Post-Dominance Frontier Construction</a> + <a name="pointertracking">-pointertracking: Track pointer bounds.</a> +</div> +<div class="doc_text"> + <p>Tracking of pointer bounds. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="postdomfrontier">-postdomfrontier: Post-Dominance Frontier Construction</a> </div> <div class="doc_text"> <p> @@ -480,7 +623,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="postdomtree">Post-Dominator Tree Construction</a> + <a name="postdomtree">-postdomtree: Post-Dominator Tree Construction</a> </div> <div class="doc_text"> <p> @@ -491,7 +634,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="print-alias-sets">Alias Set Printer</a> + <a name="print-alias-sets">-print-alias-sets: Alias Set Printer</a> </div> <div class="doc_text"> <p>Yet to be written.</p> @@ -499,7 +642,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="print-callgraph">Print a call graph</a> + <a name="print-callgraph">-print-callgraph: Print a call graph</a> </div> <div class="doc_text"> <p> @@ -510,7 +653,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="print-callgraph-sccs">Print SCCs of the Call Graph</a> + <a name="print-callgraph-sccs">-print-callgraph-sccs: Print SCCs of the Call Graph</a> </div> <div class="doc_text"> <p> @@ -521,7 +664,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="print-cfg-sccs">Print SCCs of each function CFG</a> + <a name="print-cfg-sccs">-print-cfg-sccs: Print SCCs of each function CFG</a> </div> <div class="doc_text"> <p> @@ -532,7 +675,31 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="print-externalfnconstants">Print external fn callsites passed constants</a> + <a name="print-dbginfo">-print-dbginfo: Print debug info in human readable form</a> +</div> +<div class="doc_text"> + <p>Pass that prints instructions, and associated debug info: + <ul> + + <li>source/line/col information</li> + <li>original variable name</li> + <li>original type name</li> + </ul> + + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="print-dom-info">-print-dom-info: Dominator Info Printer</a> +</div> +<div class="doc_text"> + <p>Dominator Info Printer.</p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="print-externalfnconstants">-print-externalfnconstants: Print external fn callsites passed constants</a> </div> <div class="doc_text"> <p> @@ -545,7 +712,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="print-function">Print function to stderr</a> + <a name="print-function">-print-function: Print function to stderr</a> </div> <div class="doc_text"> <p> @@ -557,7 +724,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="print-module">Print module to stderr</a> + <a name="print-module">-print-module: Print module to stderr</a> </div> <div class="doc_text"> <p> @@ -567,7 +734,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="print-used-types">Find Used Types</a> + <a name="print-used-types">-print-used-types: Find Used Types</a> </div> <div class="doc_text"> <p> @@ -578,7 +745,17 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="profile-loader">Load profile information from llvmprof.out</a> + <a name="profile-estimator">-profile-estimator: Estimate profiling information</a> +</div> +<div class="doc_text"> + <p>Profiling information that estimates the profiling information + in a very crude and unimaginative way. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="profile-loader">-profile-loader: Load profile information from llvmprof.out</a> </div> <div class="doc_text"> <p> @@ -589,7 +766,15 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="scalar-evolution">Scalar Evolution Analysis</a> + <a name="profile-verifier">-profile-verifier: Verify profiling information</a> +</div> +<div class="doc_text"> + <p>Pass that checks profiling information for plausibility.</p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="scalar-evolution">-scalar-evolution: Scalar Evolution Analysis</a> </div> <div class="doc_text"> <p> @@ -608,7 +793,45 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="targetdata">Target Data Layout</a> + <a name="scev-aa">-scev-aa: </a> +</div> +<div class="doc_text"> + <p>Simple alias analysis implemented in terms of ScalarEvolution queries. + + This differs from traditional loop dependence analysis in that it tests + for dependencies within a single iteration of a loop, rather than + dependencies between different iterations. + + ScalarEvolution has a more complete understanding of pointer arithmetic + than BasicAliasAnalysis' collection of ad-hoc analyses. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="strip-dead-debug-info">-strip-dead-debug-info: Strip debug info for unused symbols</a> +</div> +<div class="doc_text"> + <p> + performs code stripping. this transformation can delete: + </p> + + <ol> + <li>names for virtual registers</li> + <li>symbols for internal globals and functions</li> + <li>debug information</li> + </ol> + + <p> + note that this transformation makes code much less readable, so it should + only be used in situations where the <tt>strip</tt> utility would be used, + such as reducing code size or making it harder to reverse engineer code. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="targetdata">-targetdata: Target Data Layout</a> </div> <div class="doc_text"> <p>Provides other passes access to information on how the size and alignment @@ -623,7 +846,22 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="adce">Aggressive Dead Code Elimination</a> + <a name="abcd">-abcd: Remove redundant conditional branches</a> +</div> +<div class="doc_text"> + <p>ABCD removes conditional branch instructions that can be proved redundant. + With the SSI representation, each variable has a constraint. By analyzing these + constraints we can prove that a branch is redundant. When a branch is proved + redundant it means that one direction will always be taken; thus, we can change + this branch into an unconditional jump.</p> + <p>It is advisable to run <a href="#simplifycfg">SimplifyCFG</a> and + <a href="#adce">Aggressive Dead Code Elimination</a> after ABCD + to clean up the code.</p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="adce">-adce: Aggressive Dead Code Elimination</a> </div> <div class="doc_text"> <p>ADCE aggressively tries to eliminate code. This pass is similar to @@ -634,7 +872,16 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="argpromotion">Promote 'by reference' arguments to scalars</a> + <a name="always-inline">-always-inline: Inliner for always_inline functions</a> +</div> +<div class="doc_text"> + <p>A custom inliner that handles only functions that are marked as + "always inline".</p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="argpromotion">-argpromotion: Promote 'by reference' arguments to scalars</a> </div> <div class="doc_text"> <p> @@ -665,7 +912,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="block-placement">Profile Guided Basic Block Placement</a> + <a name="block-placement">-block-placement: Profile Guided Basic Block Placement</a> </div> <div class="doc_text"> <p>This pass is a very simple profile guided basic block placement algorithm. @@ -677,7 +924,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="break-crit-edges">Break critical edges in CFG</a> + <a name="break-crit-edges">-break-crit-edges: Break critical edges in CFG</a> </div> <div class="doc_text"> <p> @@ -690,7 +937,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="codegenprepare">Prepare a function for code generation</a> + <a name="codegenprepare">-codegenprepare: Prepare a function for code generation</a> </div> <div class="doc_text"> This pass munges the code in the input function to better prepare it for @@ -700,7 +947,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="constmerge">Merge Duplicate Global Constants</a> + <a name="constmerge">-constmerge: Merge Duplicate Global Constants</a> </div> <div class="doc_text"> <p> @@ -713,7 +960,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="constprop">Simple constant propagation</a> + <a name="constprop">-constprop: Simple constant propagation</a> </div> <div class="doc_text"> <p>This file implements constant propagation and merging. It looks for @@ -729,7 +976,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="dce">Dead Code Elimination</a> + <a name="dce">-dce: Dead Code Elimination</a> </div> <div class="doc_text"> <p> @@ -741,7 +988,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="deadargelim">Dead Argument Elimination</a> + <a name="deadargelim">-deadargelim: Dead Argument Elimination</a> </div> <div class="doc_text"> <p> @@ -759,7 +1006,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="deadtypeelim">Dead Type Elimination</a> + <a name="deadtypeelim">-deadtypeelim: Dead Type Elimination</a> </div> <div class="doc_text"> <p> @@ -771,7 +1018,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="die">Dead Instruction Elimination</a> + <a name="die">-die: Dead Instruction Elimination</a> </div> <div class="doc_text"> <p> @@ -782,7 +1029,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="dse">Dead Store Elimination</a> + <a name="dse">-dse: Dead Store Elimination</a> </div> <div class="doc_text"> <p> @@ -793,7 +1040,22 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="globaldce">Dead Global Elimination</a> + <a name="functionattrs">-functionattrs: Deduce function attributes</a> +</div> +<div class="doc_text"> + <p>A simple interprocedural pass which walks the call-graph, looking for + functions which do not access or only read non-local memory, and marking them + readnone/readonly. In addition, it marks function arguments (of pointer type) + 'nocapture' if a call to the function does not create any copies of the pointer + value that outlive the call. This more or less means that the pointer is only + dereferenced, and not returned from the function or stored in a global. + This pass is implemented as a bottom-up traversal of the call-graph. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="globaldce">-globaldce: Dead Global Elimination</a> </div> <div class="doc_text"> <p> @@ -807,7 +1069,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="globalopt">Global Variable Optimizer</a> + <a name="globalopt">-globalopt: Global Variable Optimizer</a> </div> <div class="doc_text"> <p> @@ -819,7 +1081,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="gvn">Global Value Numbering</a> + <a name="gvn">-gvn: Global Value Numbering</a> </div> <div class="doc_text"> <p> @@ -828,27 +1090,9 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! </p> </div> - <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="indmemrem">Indirect Malloc and Free Removal</a> -</div> -<div class="doc_text"> - <p> - This pass finds places where memory allocation functions may escape into - indirect land. Some transforms are much easier (aka possible) only if free - or malloc are not called indirectly. - </p> - - <p> - Thus find places where the address of memory functions are taken and construct - bounce functions with direct calls of those functions. - </p> -</div> - -<!-------------------------------------------------------------------------- --> -<div class="doc_subsection"> - <a name="indvars">Canonicalize Induction Variables</a> + <a name="indvars">-indvars: Canonicalize Induction Variables</a> </div> <div class="doc_text"> <p> @@ -899,7 +1143,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="inline">Function Integration/Inlining</a> + <a name="inline">-inline: Function Integration/Inlining</a> </div> <div class="doc_text"> <p> @@ -909,26 +1153,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="insert-block-profiling">Insert instrumentation for block profiling</a> -</div> -<div class="doc_text"> - <p> - This pass instruments the specified program with counters for basic block - profiling, which counts the number of times each basic block executes. This - is the most basic form of profiling, which can tell which blocks are hot, but - cannot reliably detect hot paths through the CFG. - </p> - - <p> - Note that this implementation is very naïve. Control equivalent regions of - the CFG should not require duplicate counters, but it does put duplicate - counters in. - </p> -</div> - -<!-------------------------------------------------------------------------- --> -<div class="doc_subsection"> - <a name="insert-edge-profiling">Insert instrumentation for edge profiling</a> + <a name="insert-edge-profiling">-insert-edge-profiling: Insert instrumentation for edge profiling</a> </div> <div class="doc_text"> <p> @@ -946,51 +1171,18 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="insert-function-profiling">Insert instrumentation for function profiling</a> + <a name="insert-optimal-edge-profiling">-insert-optimal-edge-profiling: Insert optimal instrumentation for edge profiling</a> </div> <div class="doc_text"> - <p> - This pass instruments the specified program with counters for function - profiling, which counts the number of times each function is called. - </p> -</div> - -<!-------------------------------------------------------------------------- --> -<div class="doc_subsection"> - <a name="insert-null-profiling-rs">Measure profiling framework overhead</a> -</div> -<div class="doc_text"> - <p> - The basic profiler that does nothing. It is the default profiler and thus - terminates <code>RSProfiler</code> chains. It is useful for measuring - framework overhead. - </p> -</div> - -<!-------------------------------------------------------------------------- --> -<div class="doc_subsection"> - <a name="insert-rs-profiling-framework">Insert random sampling instrumentation framework</a> -</div> -<div class="doc_text"> - <p> - The second stage of the random-sampling instrumentation framework, duplicates - all instructions in a function, ignoring the profiling code, then connects the - two versions together at the entry and at backedges. At each connection point - a choice is made as to whether to jump to the profiled code (take a sample) or - execute the unprofiled code. - </p> - - <p> - After this pass, it is highly recommended to run<a href="#mem2reg">mem2reg</a> - and <a href="#adce">adce</a>. <a href="#instcombine">instcombine</a>, - <a href="#load-vn">load-vn</a>, <a href="#gdce">gdce</a>, and - <a href="#dse">dse</a> also are good to run afterwards. + <p>This pass instruments the specified program with counters for edge profiling. + Edge profiling can give a reasonable approximation of the hot paths through a + program, and is used for a wide variety of program transformations. </p> </div> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="instcombine">Combine redundant instructions</a> + <a name="instcombine">-instcombine: Combine redundant instructions</a> </div> <div class="doc_text"> <p> @@ -1044,7 +1236,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="internalize">Internalize Global Symbols</a> + <a name="internalize">-internalize: Internalize Global Symbols</a> </div> <div class="doc_text"> <p> @@ -1056,7 +1248,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="ipconstprop">Interprocedural constant propagation</a> + <a name="ipconstprop">-ipconstprop: Interprocedural constant propagation</a> </div> <div class="doc_text"> <p> @@ -1070,7 +1262,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="ipsccp">Interprocedural Sparse Conditional Constant Propagation</a> + <a name="ipsccp">-ipsccp: Interprocedural Sparse Conditional Constant Propagation</a> </div> <div class="doc_text"> <p> @@ -1081,7 +1273,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if ! <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="jump-threading">Thread control through conditional blocks</a> + <a name="jump-threading">-jump-threading: Thread control through conditional blocks</a> </div> <div class="doc_text"> <p> @@ -1110,7 +1302,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="lcssa">Loop-Closed SSA Form Pass</a> + <a name="lcssa">-lcssa: Loop-Closed SSA Form Pass</a> </div> <div class="doc_text"> <p> @@ -1139,7 +1331,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="licm">Loop Invariant Code Motion</a> + <a name="licm">-licm: Loop Invariant Code Motion</a> </div> <div class="doc_text"> <p> @@ -1175,7 +1367,7 @@ if (X < 3) {</pre> </div> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="loop-deletion">Dead Loop Deletion Pass</a> + <a name="loop-deletion">-loop-deletion: Dead Loop Deletion Pass</a> </div> <div class="doc_text"> <p> @@ -1188,7 +1380,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="loop-extract">Extract loops into new functions</a> + <a name="loop-extract">-loop-extract: Extract loops into new functions</a> </div> <div class="doc_text"> <p> @@ -1201,7 +1393,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="loop-extract-single">Extract at most one loop into a new function</a> + <a name="loop-extract-single">-loop-extract-single: Extract at most one loop into a new function</a> </div> <div class="doc_text"> <p> @@ -1213,7 +1405,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="loop-index-split">Index Split Loops</a> + <a name="loop-index-split">-loop-index-split: Index Split Loops</a> </div> <div class="doc_text"> <p> @@ -1224,7 +1416,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="loop-reduce">Loop Strength Reduction</a> + <a name="loop-reduce">-loop-reduce: Loop Strength Reduction</a> </div> <div class="doc_text"> <p> @@ -1238,7 +1430,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="loop-rotate">Rotate Loops</a> + <a name="loop-rotate">-loop-rotate: Rotate Loops</a> </div> <div class="doc_text"> <p>A simple loop rotation transformation.</p> @@ -1246,7 +1438,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="loop-unroll">Unroll loops</a> + <a name="loop-unroll">-loop-unroll: Unroll loops</a> </div> <div class="doc_text"> <p> @@ -1258,7 +1450,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="loop-unswitch">Unswitch loops</a> + <a name="loop-unswitch">-loop-unswitch: Unswitch loops</a> </div> <div class="doc_text"> <p> @@ -1288,7 +1480,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="loopsimplify">Canonicalize natural loops</a> + <a name="loopsimplify">-loopsimplify: Canonicalize natural loops</a> </div> <div class="doc_text"> <p> @@ -1329,7 +1521,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="lowerallocs">Lower allocations from instructions to calls</a> + <a name="lowerallocs">-lowerallocs: Lower allocations from instructions to calls</a> </div> <div class="doc_text"> <p> @@ -1345,7 +1537,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="lowerinvoke">Lower invoke and unwind, for unwindless code generators</a> + <a name="lowerinvoke">-lowerinvoke: Lower invoke and unwind, for unwindless code generators</a> </div> <div class="doc_text"> <p> @@ -1386,7 +1578,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="lowersetjmp">Lower Set Jump</a> + <a name="lowersetjmp">-lowersetjmp: Lower Set Jump</a> </div> <div class="doc_text"> <p> @@ -1415,7 +1607,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="lowerswitch">Lower SwitchInst's to branches</a> + <a name="lowerswitch">-lowerswitch: Lower SwitchInst's to branches</a> </div> <div class="doc_text"> <p> @@ -1427,7 +1619,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="mem2reg">Promote Memory to Register</a> + <a name="mem2reg">-mem2reg: Promote Memory to Register</a> </div> <div class="doc_text"> <p> @@ -1443,7 +1635,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="memcpyopt">Optimize use of memcpy and friend</a> + <a name="memcpyopt">-memcpyopt: Optimize use of memcpy and friend</a> </div> <div class="doc_text"> <p> @@ -1454,7 +1646,28 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="mergereturn">Unify function exit nodes</a> + <a name="mergefunc">-mergefunc: Merge Functions</a> +</div> +<div class="doc_text"> + <p>This pass looks for equivalent functions that are mergable and folds them. + + A hash is computed from the function, based on its type and number of + basic blocks. + + Once all hashes are computed, we perform an expensive equality comparison + on each function pair. This takes n^2/2 comparisons per bucket, so it's + important that the hash function be high quality. The equality comparison + iterates through each instruction in each basic block. + + When a match is found the functions are folded. If both functions are + overridable, we move the functionality into a new internal function and + leave two overridable thunks to it. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="mergereturn">-mergereturn: Unify function exit nodes</a> </div> <div class="doc_text"> <p> @@ -1465,7 +1678,33 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="prune-eh">Remove unused exception handling info</a> + <a name="partial-inliner">-partial-inliner: Partial Inliner</a> +</div> +<div class="doc_text"> + <p>This pass performs partial inlining, typically by inlining an if + statement that surrounds the body of the function. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="partialspecialization">-partialspecialization: Partial Specialization</a> +</div> +<div class="doc_text"> + <p>This pass finds function arguments that are often a common constant and + specializes a version of the called function for that constant. + + This pass simply does the cloning for functions it specializes. It depends + on <a href="#ipsccp">IPSCCP</a> and <a href="#deadargelim">DAE</a> to clean up the results. + + The initial heuristic favors constant arguments that are used in control + flow. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="prune-eh">-prune-eh: Remove unused exception handling info</a> </div> <div class="doc_text"> <p> @@ -1478,7 +1717,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="reassociate">Reassociate expressions</a> + <a name="reassociate">-reassociate: Reassociate expressions</a> </div> <div class="doc_text"> <p> @@ -1501,7 +1740,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="reg2mem">Demote all values to stack slots</a> + <a name="reg2mem">-reg2mem: Demote all values to stack slots</a> </div> <div class="doc_text"> <p> @@ -1518,7 +1757,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="scalarrepl">Scalar Replacement of Aggregates</a> + <a name="scalarrepl">-scalarrepl: Scalar Replacement of Aggregates</a> </div> <div class="doc_text"> <p> @@ -1540,7 +1779,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="sccp">Sparse Conditional Constant Propagation</a> + <a name="sccp">-sccp: Sparse Conditional Constant Propagation</a> </div> <div class="doc_text"> <p> @@ -1563,7 +1802,17 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="simplify-libcalls">Simplify well-known library calls</a> + <a name="sink">-sink: Code Sinking</a> +</div> +<div class="doc_text"> + <p>This pass moves instructions into successor blocks, when possible, so that + they aren't executed on paths where their results aren't needed. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="simplify-libcalls">-simplify-libcalls: Simplify well-known library calls</a> </div> <div class="doc_text"> <p> @@ -1576,7 +1825,17 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="simplifycfg">Simplify the CFG</a> + <a name="simplify-libcalls-halfpowr">-simplify-libcalls-halfpowr: Simplify half_powr library calls</a> +</div> +<div class="doc_text"> + <p>Simple pass that applies an experimental transformation on calls + to specific functions. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="simplifycfg">-simplifycfg: Simplify the CFG</a> </div> <div class="doc_text"> <p> @@ -1595,11 +1854,48 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="strip">Strip all symbols from a module</a> + <a name="split-geps">-split-geps: Split complex GEPs into simple GEPs</a> +</div> +<div class="doc_text"> + <p>This function breaks GEPs with more than 2 non-zero operands into smaller + GEPs each with no more than 2 non-zero operands. This exposes redundancy + between GEPs with common initial operand sequences. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="ssi">-ssi: Static Single Information Construction</a> +</div> +<div class="doc_text"> + <p>This pass converts a list of variables to the Static Single Information + form. + + We are building an on-demand representation, that is, we do not convert + every single variable in the target function to SSI form. Rather, we receive + a list of target variables that must be converted. We also do not + completely convert a target variable to the SSI format. Instead, we only + change the variable in the points where new information can be attached + to its live range, that is, at branch points. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="ssi-everything">-ssi-everything: Static Single Information Construction (everything, intended for debugging)</a> +</div> +<div class="doc_text"> + <p>A pass that runs <a href="#ssi">SSI</a> on every non-void variable, intended for debugging. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="strip">-strip: Strip all symbols from a module</a> </div> <div class="doc_text"> <p> - Performs code stripping. This transformation can delete: + performs code stripping. this transformation can delete: </p> <ol> @@ -1609,7 +1905,7 @@ if (X < 3) {</pre> </ol> <p> - Note that this transformation makes code much less readable, so it should + note that this transformation makes code much less readable, so it should only be used in situations where the <tt>strip</tt> utility would be used, such as reducing code size or making it harder to reverse engineer code. </p> @@ -1617,7 +1913,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="strip-dead-prototypes">Remove unused function declarations</a> + <a name="strip-dead-prototypes">-strip-dead-prototypes: Remove unused function declarations</a> </div> <div class="doc_text"> <p> @@ -1630,7 +1926,41 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="sretpromotion">Promote sret arguments</a> + <a name="strip-debug-declare">-strip-debug-declare: Strip all llvm.dbg.declare intrinsics</a> +</div> +<div class="doc_text"> + <p>This pass implements code stripping. Specifically, it can delete: + <ul> + <li>names for virtual registers</li> + <li>symbols for internal globals and functions</li> + <li>debug information</li> + </ul> + Note that this transformation makes code much less readable, so it should + only be used in situations where the 'strip' utility would be used, such as + reducing code size or making it harder to reverse engineer code. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="strip-nondebug">-strip-nondebug: Strip all symbols, except dbg symbols, from a module</a> +</div> +<div class="doc_text"> + <p>This pass implements code stripping. Specifically, it can delete: + <ul> + <li>names for virtual registers</li> + <li>symbols for internal globals and functions</li> + <li>debug information</li> + </ul> + Note that this transformation makes code much less readable, so it should + only be used in situations where the 'strip' utility would be used, such as + reducing code size or making it harder to reverse engineer code. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="sretpromotion">-sretpromotion: Promote sret arguments</a> </div> <div class="doc_text"> <p> @@ -1653,7 +1983,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="tailcallelim">Tail Call Elimination</a> + <a name="tailcallelim">-tailcallelim: Tail Call Elimination</a> </div> <div class="doc_text"> <p> @@ -1685,7 +2015,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="tailduplicate">Tail Duplication</a> + <a name="tailduplicate">-tailduplicate: Tail Duplication</a> </div> <div class="doc_text"> <p> @@ -1705,7 +2035,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="deadarghaX0r">Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)</a> + <a name="deadarghaX0r">-deadarghaX0r: Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)</a> </div> <div class="doc_text"> <p> @@ -1716,7 +2046,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="extract-blocks">Extract Basic Blocks From Module (for bugpoint use)</a> + <a name="extract-blocks">-extract-blocks: Extract Basic Blocks From Module (for bugpoint use)</a> </div> <div class="doc_text"> <p> @@ -1726,7 +2056,19 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="preverify">Preliminary module verification</a> + <a name="instnamer">-instnamer: Assign names to anonymous instructions</a> +</div> +<div class="doc_text"> + <p>This is a little utility pass that gives instructions names, this is mostly + useful when diffing the effect of an optimization because deleting an + unnamed instruction can change all other instruction numbering, making the + diff very noisy. + </p> +</div> + +<!-------------------------------------------------------------------------- --> +<div class="doc_subsection"> + <a name="preverify">-preverify: Preliminary module verification</a> </div> <div class="doc_text"> <p> @@ -1742,7 +2084,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="verify">Module Verifier</a> + <a name="verify">-verify: Module Verifier</a> </div> <div class="doc_text"> <p> @@ -1793,7 +2135,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="view-cfg">View CFG of function</a> + <a name="view-cfg">-view-cfg: View CFG of function</a> </div> <div class="doc_text"> <p> @@ -1803,7 +2145,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="view-cfg-only">View CFG of function (with no function bodies)</a> + <a name="view-cfg-only">-view-cfg-only: View CFG of function (with no function bodies)</a> </div> <div class="doc_text"> <p> @@ -1814,7 +2156,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="view-dom">View dominator tree of function</a> + <a name="view-dom">-view-dom: View dominator tree of function</a> </div> <div class="doc_text"> <p> @@ -1824,7 +2166,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="view-dom-only">View dominator tree of function (with no function + <a name="view-dom-only">-view-dom-only: View dominator tree of function (with no function bodies) </a> </div> @@ -1837,7 +2179,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="view-postdom">View post dominator tree of function</a> + <a name="view-postdom">-view-postdom: View post dominator tree of function</a> </div> <div class="doc_text"> <p> @@ -1847,7 +2189,7 @@ if (X < 3) {</pre> <!-------------------------------------------------------------------------- --> <div class="doc_subsection"> - <a name="view-postdom-only">View post dominator tree of function (with no + <a name="view-postdom-only">-view-postdom-only: View post dominator tree of function (with no function bodies) </a> </div> @@ -1869,7 +2211,7 @@ if (X < 3) {</pre> <a href="mailto:rspencer@x10sys.com">Reid Spencer</a><br> <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 11:33:18 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-07-06 17:52:15 +0200 (Tue, 06 Jul 2010) $ </address> </body> diff --git a/docs/SourceLevelDebugging.html b/docs/SourceLevelDebugging.html index e017530..f70a0d3 100644 --- a/docs/SourceLevelDebugging.html +++ b/docs/SourceLevelDebugging.html @@ -401,7 +401,7 @@ height="369"> metadata, ;; Reference to type descriptor i1, ;; True if the global is local to compile unit (static) i1, ;; True if the global is defined in the compile unit (not extern) - { }* ;; Reference to the global variable + {}* ;; Reference to the global variable } </pre> </div> @@ -433,6 +433,13 @@ provide details such as name, type and where the variable is defined.</p> metadata, ;; Reference to type descriptor i1, ;; True if the global is local to compile unit (static) i1 ;; True if the global is defined in the compile unit (not extern) + i32 ;; Virtuality, e.g. dwarf::DW_VIRTUALITY__virtual + i32 ;; Index into a virtual function + metadata, ;; indicates which base type contains the vtable pointer for the + ;; derived class + i1 ;; isArtificial + i1 ;; isOptimized + Function *;; Pointer to LLVM function } </pre> </div> @@ -782,11 +789,11 @@ DW_TAG_return_variable = 258 <div class="doc_text"> <pre> - void %<a href="#format_common_declare">llvm.dbg.declare</a>( { } *, metadata ) + void %<a href="#format_common_declare">llvm.dbg.declare</a>({}*, metadata) </pre> <p>This intrinsic provides information about a local element (ex. variable.) The - first argument is the alloca for the variable, cast to a <tt>{ }*</tt>. The + first argument is the alloca for the variable, cast to a <tt>{}*</tt>. The second argument is the <tt>%<a href="#format_variables">llvm.dbg.variable</a></tt> containing the description of the variable. </p> @@ -800,7 +807,7 @@ DW_TAG_return_variable = 258 <div class="doc_text"> <pre> - void %<a href="#format_common_value">llvm.dbg.value</a>( metadata, i64, metadata ) + void %<a href="#format_common_value">llvm.dbg.value</a>(metadata, i64, metadata) </pre> <p>This intrinsic provides information when a user source variable is set to a @@ -854,14 +861,14 @@ entry: %X = alloca i32, align 4 ; <i32*> [#uses=4] %Y = alloca i32, align 4 ; <i32*> [#uses=4] %Z = alloca i32, align 4 ; <i32*> [#uses=3] - %0 = bitcast i32* %X to { }* ; <{ }*> [#uses=1] - call void @llvm.dbg.declare({ }* %0, metadata !0), !dbg !7 + %0 = bitcast i32* %X to {}* ; <{}*> [#uses=1] + call void @llvm.dbg.declare({}* %0, metadata !0), !dbg !7 store i32 21, i32* %X, !dbg !8 - %1 = bitcast i32* %Y to { }* ; <{ }*> [#uses=1] - call void @llvm.dbg.declare({ }* %1, metadata !9), !dbg !10 + %1 = bitcast i32* %Y to {}* ; <{}*> [#uses=1] + call void @llvm.dbg.declare({}* %1, metadata !9), !dbg !10 store i32 22, i32* %Y, !dbg !11 - %2 = bitcast i32* %Z to { }* ; <{ }*> [#uses=1] - call void @llvm.dbg.declare({ }* %2, metadata !12), !dbg !14 + %2 = bitcast i32* %Z to {}* ; <{}*> [#uses=1] + call void @llvm.dbg.declare({}* %2, metadata !12), !dbg !14 store i32 23, i32* %Z, !dbg !15 %tmp = load i32* %X, !dbg !16 ; <i32> [#uses=1] %tmp1 = load i32* %Y, !dbg !16 ; <i32> [#uses=1] @@ -872,7 +879,7 @@ entry: ret void, !dbg !18 } -declare void @llvm.dbg.declare({ }*, metadata) nounwind readnone +declare void @llvm.dbg.declare({}*, metadata) nounwind readnone !0 = metadata !{i32 459008, metadata !1, metadata !"X", metadata !3, i32 2, metadata !6}; [ DW_TAG_auto_variable ] @@ -914,7 +921,7 @@ declare void @llvm.dbg.declare({ }*, metadata) nounwind readnone <div class="doc_code"> <pre> -call void @llvm.dbg.declare({ }* %0, metadata !0), !dbg !7 +call void @llvm.dbg.declare({}* %0, metadata !0), !dbg !7 </pre> </div> @@ -949,7 +956,7 @@ call void @llvm.dbg.declare({ }* %0, metadata !0), !dbg !7 <div class="doc_code"> <pre> -call void @llvm.dbg.declare({ }* %2, metadata !12), !dbg !14 +call void @llvm.dbg.declare({}* %2, metadata !12), !dbg !14 </pre> </div> @@ -1773,7 +1780,7 @@ enum Trees { <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-06-05 00:49:55 +0200 (Sat, 05 Jun 2010) $ </address> </body> diff --git a/docs/TableGenFundamentals.html b/docs/TableGenFundamentals.html index 4ad6191..0bdb6dd 100644 --- a/docs/TableGenFundamentals.html +++ b/docs/TableGenFundamentals.html @@ -144,7 +144,6 @@ file prints this (at the time of this writing):</p> <b>bit</b> mayLoad = 0; <b>bit</b> mayStore = 0; <b>bit</b> isImplicitDef = 0; - <b>bit</b> isTwoAddress = 1; <b>bit</b> isConvertibleToThreeAddress = 1; <b>bit</b> isCommutable = 1; <b>bit</b> isTerminator = 0; @@ -422,11 +421,12 @@ class. This operation is analogous to $(foreach) in GNU make.</dd> <dt><tt>!null(a)</tt></dt> <dd>An integer {0,1} indicating whether list 'a' is empty.</dd> <dt><tt>!if(a,b,c)</tt></dt> - <dd>'b' if the result of integer operator 'a' is nonzero, 'c' otherwise.</dd> + <dd>'b' if the result of 'int' or 'bit' operator 'a' is nonzero, + 'c' otherwise.</dd> <dt><tt>!eq(a,b)</tt></dt> <dd>Integer one if string a is equal to string b, zero otherwise. This - only operates on string objects. Use !cast<string> to compare other - types of objects.</dd> + only operates on string, int and bit objects. Use !cast<string> to + compare other types of objects.</dd> </dl> <p>Note that all of the values have rules specifying how they convert to values @@ -687,6 +687,91 @@ Here is an example TableGen fragment that shows this idea: </pre> </div> +<p> +A defm can also be used inside a multiclass providing several levels of +multiclass instanciations. +</p> + +<div class="doc_code"> +<pre> +<b>class</b> Instruction<bits<4> opc, string Name> { + bits<4> opcode = opc; + string name = Name; +} + +<b>multiclass</b> basic_r<bits<4> opc> { + <b>def</b> rr : Instruction<opc, "rr">; + <b>def</b> rm : Instruction<opc, "rm">; +} + +<b>multiclass</b> basic_s<bits<4> opc> { + <b>defm</b> SS : basic_r<opc>; + <b>defm</b> SD : basic_r<opc>; + <b>def</b> X : Instruction<opc, "x">; +} + +<b>multiclass</b> basic_p<bits<4> opc> { + <b>defm</b> PS : basic_r<opc>; + <b>defm</b> PD : basic_r<opc>; + <b>def</b> Y : Instruction<opc, "y">; +} + +<b>defm</b> ADD : basic_s<0xf>, basic_p<0xf>; +... + +<i>// Results</i> +<b>def</b> ADDPDrm { ... +<b>def</b> ADDPDrr { ... +<b>def</b> ADDPSrm { ... +<b>def</b> ADDPSrr { ... +<b>def</b> ADDSDrm { ... +<b>def</b> ADDSDrr { ... +<b>def</b> ADDY { ... +<b>def</b> ADDX { ... +</pre> +</div> + +<p> +defm declarations can inherit from classes too, the +rule to follow is that the class list must start after the +last multiclass, and there must be at least one multiclass +before them. +</p> + +<div class="doc_code"> +<pre> +<b>class</b> XD { bits<4> Prefix = 11; } +<b>class</b> XS { bits<4> Prefix = 12; } + +<b>class</b> I<bits<4> op> { + bits<4> opcode = op; +} + +<b>multiclass</b> R { + <b>def</b> rr : I<4>; + <b>def</b> rm : I<2>; +} + +<b>multiclass</b> Y { + <b>defm</b> SS : R, XD; + <b>defm</b> SD : R, XS; +} + +<b>defm</b> Instr : Y; + +<i>// Results</i> +<b>def</b> InstrSDrm { + bits<4> opcode = { 0, 0, 1, 0 }; + bits<4> Prefix = { 1, 1, 0, 0 }; +} +... +<b>def</b> InstrSSrr { + bits<4> opcode = { 0, 1, 0, 0 }; + bits<4> Prefix = { 1, 0, 1, 1 }; +} +</pre> +</div> + </div> <!-- ======================================================================= --> @@ -754,6 +839,32 @@ examples:</p> need to be added to several records, and the records do not otherwise need to be opened, as in the case with the <tt>CALL*</tt> instructions above.</p> +<p>It's also possible to use "let" expressions inside multiclasses, providing +more ways to factor out commonality from the records, specially if using +several levels of multiclass instanciations. This also avoids the need of using +"let" expressions within subsequent records inside a multiclass.</p> + +<div class="doc_code"> +<pre> +<b>multiclass </b>basic_r<bits<4> opc> { + <b>let </b>Predicates = [HasSSE2] in { + <b>def </b>rr : Instruction<opc, "rr">; + <b>def </b>rm : Instruction<opc, "rm">; + } + <b>let </b>Predicates = [HasSSE3] in + <b>def </b>rx : Instruction<opc, "rx">; +} + +<b>multiclass </b>basic_ss<bits<4> opc> { + <b>let </b>IsDouble = 0 in + <b>defm </b>SS : basic_r<opc>; + + <b>let </b>IsDouble = 1 in + <b>defm </b>SD : basic_r<opc>; +} + +<b>defm </b>ADD : basic_ss<0xf>; +</pre> </div> <!-- *********************************************************************** --> @@ -795,7 +906,7 @@ This should highlight the APIs in <tt>TableGen/Record.h</tt>.</p> <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-06-21 22:35:09 +0200 (Mon, 21 Jun 2010) $ </address> </body> diff --git a/docs/WritingAnLLVMBackend.html b/docs/WritingAnLLVMBackend.html index 0b9dd9f..aa2612c 100644 --- a/docs/WritingAnLLVMBackend.html +++ b/docs/WritingAnLLVMBackend.html @@ -913,9 +913,6 @@ implementation in <tt>SparcRegisterInfo.cpp</tt>: <li><tt>getCalleeSavedRegs</tt> — Returns a list of callee-saved registers in the order of the desired callee-save stack frame offset.</li> -<li><tt>getCalleeSavedRegClasses</tt> — Returns a list of preferred - register classes with which to spill each callee saved register.</li> - <li><tt>getReservedRegs</tt> — Returns a bitset indexed by physical register numbers, indicating if a particular register is unavailable.</li> @@ -1313,7 +1310,8 @@ implementation in <tt>SparcInstrInfo.cpp</tt>: a direct store to a stack slot, return the register number of the destination and the <tt>FrameIndex</tt> of the stack slot.</li> -<li><tt>copyRegToReg</tt> — Copy values between a pair of registers.</li> +<li><tt>copyPhysReg</tt> — Copy values between a pair of physical + registers.</li> <li><tt>storeRegToStackSlot</tt> — Store a register value to a stack slot.</li> @@ -2554,7 +2552,7 @@ with assembler. <a href="http://www.woo.com">Mason Woo</a> and <a href="http://misha.brukman.net">Misha Brukman</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a> <br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-07-11 19:01:17 +0200 (Sun, 11 Jul 2010) $ </address> </body> diff --git a/docs/WritingAnLLVMPass.html b/docs/WritingAnLLVMPass.html index e353c2e..94c5ceb 100644 --- a/docs/WritingAnLLVMPass.html +++ b/docs/WritingAnLLVMPass.html @@ -189,18 +189,13 @@ LIBRARYNAME = Hello # dlopen/dlsym on the resulting library. LOADABLE_MODULE = 1 -# Tell the build system which LLVM libraries your pass needs. You'll probably -# need at least LLVMSystem.a, LLVMSupport.a, LLVMCore.a but possibly several -# others too. -LLVMLIBS = LLVMCore.a LLVMSupport.a LLVMSystem.a - # Include the makefile implementation stuff include $(LEVEL)/Makefile.common </pre></div> <p>This makefile specifies that all of the <tt>.cpp</tt> files in the current directory are to be compiled and linked together into a -<tt>Debug/lib/Hello.so</tt> shared object that can be dynamically loaded by +<tt>Debug+Asserts/lib/Hello.so</tt> shared object that can be dynamically loaded by the <tt>opt</tt> or <tt>bugpoint</tt> tools via their <tt>-load</tt> options. If your operating system uses a suffix other than .so (such as windows or Mac OS/X), the appropriate extension will be used.</p> @@ -337,7 +332,7 @@ is supplied as fourth argument. </p> <p>Now that it's all together, compile the file with a simple "<tt>gmake</tt>" command in the local directory and you should get a new -"<tt>Debug/lib/Hello.so</tt> file. Note that everything in this file is +"<tt>Debug+Asserts/lib/Hello.so</tt> file. Note that everything in this file is contained in an anonymous namespace: this reflects the fact that passes are self contained units that do not need external interfaces (although they can have them) to be useful.</p> @@ -363,7 +358,7 @@ through our transformation like this (or course, any bitcode file will work):</p> <div class="doc_code"><pre> -$ opt -load ../../../Debug/lib/Hello.so -hello < hello.bc > /dev/null +$ opt -load ../../../Debug+Asserts/lib/Hello.so -hello < hello.bc > /dev/null Hello: __main Hello: puts Hello: main @@ -380,7 +375,7 @@ interesting way, we just throw away the result of <tt>opt</tt> (sending it to <tt>opt</tt> with the <tt>-help</tt> option:</p> <div class="doc_code"><pre> -$ opt -load ../../../Debug/lib/Hello.so -help +$ opt -load ../../../Debug+Asserts/lib/Hello.so -help OVERVIEW: llvm .bc -> .bc modular optimizer USAGE: opt [options] <input bitcode> @@ -408,7 +403,7 @@ the execution time of your pass along with the other passes you queue up. For example:</p> <div class="doc_code"><pre> -$ opt -load ../../../Debug/lib/Hello.so -hello -time-passes < hello.bc > /dev/null +$ opt -load ../../../Debug+Asserts/lib/Hello.so -hello -time-passes < hello.bc > /dev/null Hello: __main Hello: puts Hello: main @@ -1423,7 +1418,7 @@ how our <a href="#basiccode">Hello World</a> pass interacts with other passes. Lets try it out with the <tt>gcse</tt> and <tt>licm</tt> passes:</p> <div class="doc_code"><pre> -$ opt -load ../../../Debug/lib/Hello.so -gcse -licm --debug-pass=Structure < hello.bc > /dev/null +$ opt -load ../../../Debug+Asserts/lib/Hello.so -gcse -licm --debug-pass=Structure < hello.bc > /dev/null Module Pass Manager Function Pass Manager Dominator Set Construction @@ -1460,7 +1455,7 @@ passes.</p> World</a> pass in between the two passes:</p> <div class="doc_code"><pre> -$ opt -load ../../../Debug/lib/Hello.so -gcse -hello -licm --debug-pass=Structure < hello.bc > /dev/null +$ opt -load ../../../Debug+Asserts/lib/Hello.so -gcse -hello -licm --debug-pass=Structure < hello.bc > /dev/null Module Pass Manager Function Pass Manager Dominator Set Construction @@ -1501,7 +1496,7 @@ href="#getAnalysisUsage"><tt>getAnalysisUsage</tt></a> method to our pass:</p> <p>Now when we run our pass, we get this output:</p> <div class="doc_code"><pre> -$ opt -load ../../../Debug/lib/Hello.so -gcse -hello -licm --debug-pass=Structure < hello.bc > /dev/null +$ opt -load ../../../Debug+Asserts/lib/Hello.so -gcse -hello -licm --debug-pass=Structure < hello.bc > /dev/null Pass Arguments: -gcse -hello -licm Module Pass Manager Function Pass Manager @@ -1742,8 +1737,8 @@ want:</p> <div class="doc_code"><pre> (gdb) <b>break llvm::PassManager::run</b> Breakpoint 1 at 0x2413bc: file Pass.cpp, line 70. -(gdb) <b>run test.bc -load $(LLVMTOP)/llvm/Debug/lib/[libname].so -[passoption]</b> -Starting program: opt test.bc -load $(LLVMTOP)/llvm/Debug/lib/[libname].so -[passoption] +(gdb) <b>run test.bc -load $(LLVMTOP)/llvm/Debug+Asserts/lib/[libname].so -[passoption]</b> +Starting program: opt test.bc -load $(LLVMTOP)/llvm/Debug+Asserts/lib/[libname].so -[passoption] Breakpoint 1, PassManager::run (this=0xffbef174, M=@0x70b298) at Pass.cpp:70 70 bool PassManager::run(Module &M) { return PM->run(M); } (gdb) @@ -1835,7 +1830,7 @@ Despite that, we have kept the LLVM passes SMP ready, and you should too.</p> <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-07-08 10:27:18 +0200 (Thu, 08 Jul 2010) $ </address> </body> diff --git a/docs/tutorial/LangImpl3.html b/docs/tutorial/LangImpl3.html index 602fd7d..783abb3 100644 --- a/docs/tutorial/LangImpl3.html +++ b/docs/tutorial/LangImpl3.html @@ -200,9 +200,9 @@ Value *BinaryExprAST::Codegen() { if (L == 0 || R == 0) return 0; switch (Op) { - case '+': return Builder.CreateAdd(L, R, "addtmp"); - case '-': return Builder.CreateSub(L, R, "subtmp"); - case '*': return Builder.CreateMul(L, R, "multmp"); + case '+': return Builder.CreateFAdd(L, R, "addtmp"); + case '-': return Builder.CreateFSub(L, R, "subtmp"); + case '*': return Builder.CreateFMul(L, R, "multmp"); case '<': L = Builder.CreateFCmpULT(L, R, "cmptmp"); // Convert bool 0/1 to double 0.0 or 1.0 @@ -574,8 +574,8 @@ ready> <b>def bar(a) foo(a, 4.0) + bar(31337);</b> Read function definition: define double @bar(double %a) { entry: - %calltmp = call double @foo( double %a, double 4.000000e+00 ) - %calltmp1 = call double @bar( double 3.133700e+04 ) + %calltmp = call double @foo(double %a, double 4.000000e+00) + %calltmp1 = call double @bar(double 3.133700e+04) %addtmp = fadd double %calltmp, %calltmp1 ret double %addtmp } @@ -596,7 +596,7 @@ ready> <b>cos(1.234);</b> Read top-level expression: define double @""() { entry: - %calltmp = call double @cos( double 1.234000e+00 ) + %calltmp = call double @cos(double 1.234000e+00) ret double %calltmp } </pre> @@ -629,8 +629,8 @@ entry: define double @bar(double %a) { entry: - %calltmp = call double @foo( double %a, double 4.000000e+00 ) - %calltmp1 = call double @bar( double 3.133700e+04 ) + %calltmp = call double @foo(double %a, double 4.000000e+00) + %calltmp1 = call double @bar(double 3.133700e+04) %addtmp = fadd double %calltmp, %calltmp1 ret double %addtmp } @@ -639,7 +639,7 @@ declare double @cos(double) define double @""() { entry: - %calltmp = call double @cos( double 1.234000e+00 ) + %calltmp = call double @cos(double 1.234000e+00) ret double %calltmp } </pre> @@ -1263,7 +1263,7 @@ int main() { <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-06-14 08:09:39 +0200 (Mon, 14 Jun 2010) $ </address> </body> </html> diff --git a/docs/tutorial/LangImpl4.html b/docs/tutorial/LangImpl4.html index aaec2b6..d286364 100644 --- a/docs/tutorial/LangImpl4.html +++ b/docs/tutorial/LangImpl4.html @@ -371,7 +371,7 @@ entry: ready> <b>testfunc(4, 10);</b> define double @""() { entry: - %calltmp = call double @testfunc( double 4.000000e+00, double 1.000000e+01 ) + %calltmp = call double @testfunc(double 4.000000e+00, double 1.000000e+01) ret double %calltmp } @@ -410,9 +410,9 @@ ready> <b>def foo(x) sin(x)*sin(x) + cos(x)*cos(x);</b> Read function definition: define double @foo(double %x) { entry: - %calltmp = call double @sin( double %x ) + %calltmp = call double @sin(double %x) %multmp = fmul double %calltmp, %calltmp - %calltmp2 = call double @cos( double %x ) + %calltmp2 = call double @cos(double %x) %multmp4 = fmul double %calltmp2, %calltmp2 %addtmp = fadd double %multmp, %multmp4 ret double %addtmp @@ -876,9 +876,9 @@ Value *BinaryExprAST::Codegen() { if (L == 0 || R == 0) return 0; switch (Op) { - case '+': return Builder.CreateAdd(L, R, "addtmp"); - case '-': return Builder.CreateSub(L, R, "subtmp"); - case '*': return Builder.CreateMul(L, R, "multmp"); + case '+': return Builder.CreateFAdd(L, R, "addtmp"); + case '-': return Builder.CreateFSub(L, R, "subtmp"); + case '*': return Builder.CreateFMul(L, R, "multmp"); case '<': L = Builder.CreateFCmpULT(L, R, "cmptmp"); // Convert bool 0/1 to double 0.0 or 1.0 @@ -1126,7 +1126,7 @@ int main() { <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-06-14 08:09:39 +0200 (Mon, 14 Jun 2010) $ </address> </body> </html> diff --git a/docs/tutorial/LangImpl5.html b/docs/tutorial/LangImpl5.html index 6f1f9df..b6398ca 100644 --- a/docs/tutorial/LangImpl5.html +++ b/docs/tutorial/LangImpl5.html @@ -676,7 +676,7 @@ entry: loop: ; preds = %loop, %entry %i = phi double [ 1.000000e+00, %entry ], [ %nextvar, %loop ] ; body - %calltmp = call double @putchard( double 4.200000e+01 ) + %calltmp = call double @putchard(double 4.200000e+01) ; increment %nextvar = fadd double %i, 1.000000e+00 @@ -1377,9 +1377,9 @@ Value *BinaryExprAST::Codegen() { if (L == 0 || R == 0) return 0; switch (Op) { - case '+': return Builder.CreateAdd(L, R, "addtmp"); - case '-': return Builder.CreateSub(L, R, "subtmp"); - case '*': return Builder.CreateMul(L, R, "multmp"); + case '+': return Builder.CreateFAdd(L, R, "addtmp"); + case '-': return Builder.CreateFSub(L, R, "subtmp"); + case '*': return Builder.CreateFMul(L, R, "multmp"); case '<': L = Builder.CreateFCmpULT(L, R, "cmptmp"); // Convert bool 0/1 to double 0.0 or 1.0 @@ -1771,7 +1771,7 @@ int main() { <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-06-14 08:09:39 +0200 (Mon, 14 Jun 2010) $ </address> </body> </html> diff --git a/docs/tutorial/LangImpl6.html b/docs/tutorial/LangImpl6.html index 47f08dc..7368ea7 100644 --- a/docs/tutorial/LangImpl6.html +++ b/docs/tutorial/LangImpl6.html @@ -277,9 +277,9 @@ Value *BinaryExprAST::Codegen() { if (L == 0 || R == 0) return 0; switch (Op) { - case '+': return Builder.CreateAdd(L, R, "addtmp"); - case '-': return Builder.CreateSub(L, R, "subtmp"); - case '*': return Builder.CreateMul(L, R, "multmp"); + case '+': return Builder.CreateFAdd(L, R, "addtmp"); + case '-': return Builder.CreateFSub(L, R, "subtmp"); + case '*': return Builder.CreateFMul(L, R, "multmp"); case '<': L = Builder.CreateFCmpULT(L, R, "cmptmp"); // Convert bool 0/1 to double 0.0 or 1.0 @@ -531,7 +531,7 @@ def unary!(v) def unary-(v) 0-v; -# Define > with the same precedence as >. +# Define > with the same precedence as <. def binary> 10 (LHS RHS) RHS < LHS; @@ -1392,9 +1392,9 @@ Value *BinaryExprAST::Codegen() { if (L == 0 || R == 0) return 0; switch (Op) { - case '+': return Builder.CreateAdd(L, R, "addtmp"); - case '-': return Builder.CreateSub(L, R, "subtmp"); - case '*': return Builder.CreateMul(L, R, "multmp"); + case '+': return Builder.CreateFAdd(L, R, "addtmp"); + case '-': return Builder.CreateFSub(L, R, "subtmp"); + case '*': return Builder.CreateFMul(L, R, "multmp"); case '<': L = Builder.CreateFCmpULT(L, R, "cmptmp"); // Convert bool 0/1 to double 0.0 or 1.0 @@ -1808,7 +1808,7 @@ int main() { <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-06-21 22:31:30 +0200 (Mon, 21 Jun 2010) $ </address> </body> </html> diff --git a/docs/tutorial/LangImpl7.html b/docs/tutorial/LangImpl7.html index ddd5a9b..be2d69e 100644 --- a/docs/tutorial/LangImpl7.html +++ b/docs/tutorial/LangImpl7.html @@ -558,10 +558,10 @@ then: ; preds = %entry else: ; preds = %entry <b>%x3 = load double* %x1</b> %subtmp = fsub double %x3, 1.000000e+00 - %calltmp = call double @fib( double %subtmp ) + %calltmp = call double @fib(double %subtmp) <b>%x4 = load double* %x1</b> %subtmp5 = fsub double %x4, 2.000000e+00 - %calltmp6 = call double @fib( double %subtmp5 ) + %calltmp6 = call double @fib(double %subtmp5) %addtmp = fadd double %calltmp, %calltmp6 br label %ifcont @@ -596,9 +596,9 @@ then: else: %subtmp = fsub double <b>%x</b>, 1.000000e+00 - %calltmp = call double @fib( double %subtmp ) + %calltmp = call double @fib(double %subtmp) %subtmp5 = fsub double <b>%x</b>, 2.000000e+00 - %calltmp6 = call double @fib( double %subtmp5 ) + %calltmp6 = call double @fib(double %subtmp5) %addtmp = fadd double %calltmp, %calltmp6 br label %ifcont @@ -626,9 +626,9 @@ entry: else: %subtmp = fsub double %x, 1.000000e+00 - %calltmp = call double @fib( double %subtmp ) + %calltmp = call double @fib(double %subtmp) %subtmp5 = fsub double %x, 2.000000e+00 - %calltmp6 = call double @fib( double %subtmp5 ) + %calltmp6 = call double @fib(double %subtmp5) %addtmp = fadd double %calltmp, %calltmp6 ret double %addtmp @@ -1672,9 +1672,9 @@ Value *BinaryExprAST::Codegen() { if (L == 0 || R == 0) return 0; switch (Op) { - case '+': return Builder.CreateAdd(L, R, "addtmp"); - case '-': return Builder.CreateSub(L, R, "subtmp"); - case '*': return Builder.CreateMul(L, R, "multmp"); + case '+': return Builder.CreateFAdd(L, R, "addtmp"); + case '-': return Builder.CreateFSub(L, R, "subtmp"); + case '*': return Builder.CreateFMul(L, R, "multmp"); case '<': L = Builder.CreateFCmpULT(L, R, "cmptmp"); // Convert bool 0/1 to double 0.0 or 1.0 @@ -2158,7 +2158,7 @@ int main() { <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-06-14 08:09:39 +0200 (Mon, 14 Jun 2010) $ </address> </body> </html> diff --git a/docs/tutorial/OCamlLangImpl3.html b/docs/tutorial/OCamlLangImpl3.html index 06dded1..c7c5370 100644 --- a/docs/tutorial/OCamlLangImpl3.html +++ b/docs/tutorial/OCamlLangImpl3.html @@ -524,8 +524,8 @@ ready> <b>def bar(a) foo(a, 4.0) + bar(31337);</b> Read function definition: define double @bar(double %a) { entry: - %calltmp = call double @foo( double %a, double 4.000000e+00 ) - %calltmp1 = call double @bar( double 3.133700e+04 ) + %calltmp = call double @foo(double %a, double 4.000000e+00) + %calltmp1 = call double @bar(double 3.133700e+04) %addtmp = fadd double %calltmp, %calltmp1 ret double %addtmp } @@ -546,7 +546,7 @@ ready> <b>cos(1.234);</b> Read top-level expression: define double @""() { entry: - %calltmp = call double @cos( double 1.234000e+00 ) + %calltmp = call double @cos(double 1.234000e+00) ret double %calltmp } </pre> @@ -579,8 +579,8 @@ entry: define double @bar(double %a) { entry: - %calltmp = call double @foo( double %a, double 4.000000e+00 ) - %calltmp1 = call double @bar( double 3.133700e+04 ) + %calltmp = call double @foo(double %a, double 4.000000e+00) + %calltmp1 = call double @bar(double 3.133700e+04) %addtmp = fadd double %calltmp, %calltmp1 ret double %addtmp } @@ -589,7 +589,7 @@ declare double @cos(double) define double @""() { entry: - %calltmp = call double @cos( double 1.234000e+00 ) + %calltmp = call double @cos(double 1.234000e+00) ret double %calltmp } </pre> @@ -1087,7 +1087,7 @@ main () <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-05-28 19:07:41 +0200 (Fri, 28 May 2010) $ </address> </body> </html> diff --git a/docs/tutorial/OCamlLangImpl4.html b/docs/tutorial/OCamlLangImpl4.html index 3277e10..a86184c 100644 --- a/docs/tutorial/OCamlLangImpl4.html +++ b/docs/tutorial/OCamlLangImpl4.html @@ -387,7 +387,7 @@ entry: ready> <b>testfunc(4, 10);</b> define double @""() { entry: - %calltmp = call double @testfunc( double 4.000000e+00, double 1.000000e+01 ) + %calltmp = call double @testfunc(double 4.000000e+00, double 1.000000e+01) ret double %calltmp } @@ -426,9 +426,9 @@ ready> <b>def foo(x) sin(x)*sin(x) + cos(x)*cos(x);</b> Read function definition: define double @foo(double %x) { entry: - %calltmp = call double @sin( double %x ) + %calltmp = call double @sin(double %x) %multmp = fmul double %calltmp, %calltmp - %calltmp2 = call double @cos( double %x ) + %calltmp2 = call double @cos(double %x) %multmp4 = fmul double %calltmp2, %calltmp2 %addtmp = fadd double %multmp, %multmp4 ret double %addtmp @@ -1023,7 +1023,7 @@ extern double putchard(double X) { <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-05-28 19:07:41 +0200 (Fri, 28 May 2010) $ </address> </body> </html> diff --git a/docs/tutorial/OCamlLangImpl5.html b/docs/tutorial/OCamlLangImpl5.html index 7194a02..3173803 100644 --- a/docs/tutorial/OCamlLangImpl5.html +++ b/docs/tutorial/OCamlLangImpl5.html @@ -651,7 +651,7 @@ entry: loop: ; preds = %loop, %entry %i = phi double [ 1.000000e+00, %entry ], [ %nextvar, %loop ] ; body - %calltmp = call double @putchard( double 4.200000e+01 ) + %calltmp = call double @putchard(double 4.200000e+01) ; increment %nextvar = fadd double %i, 1.000000e+00 @@ -1563,7 +1563,7 @@ operators</a> <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-05-28 19:07:41 +0200 (Fri, 28 May 2010) $ </address> </body> </html> diff --git a/docs/tutorial/OCamlLangImpl6.html b/docs/tutorial/OCamlLangImpl6.html index f365e2d..1d4f8c7 100644 --- a/docs/tutorial/OCamlLangImpl6.html +++ b/docs/tutorial/OCamlLangImpl6.html @@ -512,7 +512,7 @@ def unary!(v) def unary-(v) 0-v; -# Define > with the same precedence as >. +# Define > with the same precedence as <. def binary> 10 (LHS RHS) RHS < LHS; @@ -1568,7 +1568,7 @@ SSA construction</a> <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-06-21 22:31:30 +0200 (Mon, 21 Jun 2010) $ </address> </body> </html> diff --git a/docs/tutorial/OCamlLangImpl7.html b/docs/tutorial/OCamlLangImpl7.html index 8f95389..ac31fbf 100644 --- a/docs/tutorial/OCamlLangImpl7.html +++ b/docs/tutorial/OCamlLangImpl7.html @@ -582,10 +582,10 @@ then: ; preds = %entry else: ; preds = %entry <b>%x3 = load double* %x1</b> %subtmp = fsub double %x3, 1.000000e+00 - %calltmp = call double @fib( double %subtmp ) + %calltmp = call double @fib(double %subtmp) <b>%x4 = load double* %x1</b> %subtmp5 = fsub double %x4, 2.000000e+00 - %calltmp6 = call double @fib( double %subtmp5 ) + %calltmp6 = call double @fib(double %subtmp5) %addtmp = fadd double %calltmp, %calltmp6 br label %ifcont @@ -620,9 +620,9 @@ then: else: %subtmp = fsub double <b>%x</b>, 1.000000e+00 - %calltmp = call double @fib( double %subtmp ) + %calltmp = call double @fib(double %subtmp) %subtmp5 = fsub double <b>%x</b>, 2.000000e+00 - %calltmp6 = call double @fib( double %subtmp5 ) + %calltmp6 = call double @fib(double %subtmp5) %addtmp = fadd double %calltmp, %calltmp6 br label %ifcont @@ -650,9 +650,9 @@ entry: else: %subtmp = fsub double %x, 1.000000e+00 - %calltmp = call double @fib( double %subtmp ) + %calltmp = call double @fib(double %subtmp) %subtmp5 = fsub double %x, 2.000000e+00 - %calltmp6 = call double @fib( double %subtmp5 ) + %calltmp6 = call double @fib(double %subtmp5) %addtmp = fadd double %calltmp, %calltmp6 ret double %addtmp @@ -1901,7 +1901,7 @@ extern double printd(double X) { <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br> <a href="mailto:idadesub@users.sourceforge.net">Erick Tryzelaar</a><br> - Last modified: $Date: 2010-05-07 02:28:04 +0200 (Fri, 07 May 2010) $ + Last modified: $Date: 2010-05-28 19:07:41 +0200 (Fri, 28 May 2010) $ </address> </body> </html> |