validation fixes
[oota-llvm.git] / docs / Passes.html
index b8d5fa105234f0433cd0c7d3996d9427605d2cec..3492a2797092ea4338e62da4d8563941a341cfc8 100644 (file)
@@ -179,7 +179,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="#emitbitcode">-emitbitcode</a></td><td>Bitcode Writer</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>
 <tr><td><a href="#view-cfg-only">-view-cfg-only</a></td><td>View CFG of function (with no function bodies)</td></tr>
@@ -1808,7 +1808,10 @@ if (i == j)
   <a name="deadarghaX0r">Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)</a>
 </div>
 <div class="doc_text">
-  <p>Yet to be written.</p>
+  <p>
+  Same as dead argument elimination, but deletes arguments to functions which
+  are external.  This is only for use by <a
+  href="Bugpoint.html">bugpoint</a>.</p>
 </div>
 
 <!-------------------------------------------------------------------------- -->
@@ -1816,15 +1819,25 @@ if (i == j)
   <a name="extract-blocks">Extract Basic Blocks From Module (for bugpoint use)</a>
 </div>
 <div class="doc_text">
-  <p>Yet to be written.</p>
+  <p>
+  This pass is used by bugpoint to extract all blocks from the module into their
+  own functions.</p>
 </div>
 
 <!-------------------------------------------------------------------------- -->
 <div class="doc_subsection">
-  <a name="emitbitcode">Bitcode Writer</a>
+  <a name="preverify">Preliminary module verification</a>
 </div>
 <div class="doc_text">
-  <p>Yet to be written.</p>
+  <p>
+  Ensures that the module is in the form required by the <a
+  href="#verifier">Module Verifier</a> pass.
+  </p>
+  
+  <p>
+  Running the verifier runs this pass automatically, so there should be no need
+  to use it directly.
+  </p>
 </div>
 
 <!-------------------------------------------------------------------------- -->
@@ -1832,7 +1845,50 @@ if (i == j)
   <a name="verify">Module Verifier</a>
 </div>
 <div class="doc_text">
-  <p>Yet to be written.</p>
+  <p>
+  Verifies an LLVM IR code. This is useful to run after an optimization which is
+  undergoing testing. Note that <tt>llvm-as</tt> verifies its input before
+  emitting bitcode, and also that malformed bitcode is likely to make LLVM
+  crash. All language front-ends are therefore encouraged to verify their output
+  before performing optimizing transformations.
+  </p>
+
+  <ul>
+    <li>Both of a binary operator's parameters are of the same type.</li>
+    <li>Verify that the indices of mem access instructions match other
+        operands.</li>
+    <li>Verify that arithmetic and other things are only performed on
+        first-class types.  Verify that shifts and logicals only happen on
+        integrals f.e.</li>
+    <li>All of the constants in a switch statement are of the correct type.</li>
+    <li>The code is in valid SSA form.</li>
+    <li>It should be illegal to put a label into any other type (like a
+        structure) or to return one. [except constant arrays!]</li>
+    <li>Only phi nodes can be self referential: <tt>%x = add int %x, %x</tt> is
+        invalid.</li>
+    <li>PHI nodes must have an entry for each predecessor, with no extras.</li>
+    <li>PHI nodes must be the first thing in a basic block, all grouped
+        together.</li>
+    <li>PHI nodes must have at least one entry.</li>
+    <li>All basic blocks should only end with terminator insts, not contain
+        them.</li>
+    <li>The entry node to a function must not have predecessors.</li>
+    <li>All Instructions must be embedded into a basic block.</li>
+    <li>Functions cannot take a void-typed parameter.</li>
+    <li>Verify that a function's argument list agrees with its declared
+        type.</li>
+    <li>It is illegal to specify a name for a void value.</li>
+    <li>It is illegal to have a internal global value with no initializer.</li>
+    <li>It is illegal to have a ret instruction that returns a value that does
+        not agree with the function return value type.</li>
+    <li>Function call argument types match the function prototype.</li>
+    <li>All other things that are tested by asserts spread about the code.</li>
+  </ul>
+  
+  <p>
+  Note that this does not provide full security verification (like Java), but
+  instead just tries to ensure that code is well-formed.
+  </p>
 </div>
 
 <!-------------------------------------------------------------------------- -->
@@ -1840,7 +1896,9 @@ if (i == j)
   <a name="view-cfg">View CFG of function</a>
 </div>
 <div class="doc_text">
-  <p>Yet to be written.</p>
+  <p>
+  Displays the control flow graph using the GraphViz tool.
+  </p>
 </div>
 
 <!-------------------------------------------------------------------------- -->
@@ -1848,7 +1906,10 @@ if (i == j)
   <a name="view-cfg-only">View CFG of function (with no function bodies)</a>
 </div>
 <div class="doc_text">
-  <p>Yet to be written.</p>
+  <p>
+  Displays the control flow graph using the GraphViz tool, but omitting function
+  bodies.
+  </p>
 </div>
 
 <!-- *********************************************************************** -->