X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FPasses.html;h=bbf6b3dc943b217bdb50e8661d94e9b68faed3d6;hb=6a29201565cb6ff98e29636fad9ab33322a9d98b;hp=352263eca73aac14af5ab186c33d570da9577aee;hpb=75ff18ed2b43439c76d449f7cc14776308bb85ea;p=oota-llvm.git diff --git a/docs/Passes.html b/docs/Passes.html index 352263eca73..bbf6b3dc943 100644 --- a/docs/Passes.html +++ b/docs/Passes.html @@ -78,33 +78,31 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if ! -anders-aaAndersen's Interprocedural Alias Analysis -basicaaBasic Alias Analysis (default AA impl) -basiccgBasic CallGraph Construction --basicvnBasic Value Numbering (default GVN impl) --callgraphPrint a call graph --callsccPrint SCCs of the Call Graph --cfgsccPrint SCCs of each function CFG -codegenprepareOptimize for code generation -count-aaCount Alias Analysis Query Responses -debug-aaAA use debugger -domfrontierDominance Frontier Construction -domtreeDominator Tree Construction --externalfnconstantsPrint external fn callsites passed constants +-dot-callgraphPrint Call Graph to 'dot' file +-dot-cfgPrint CFG of function to 'dot' file +-dot-cfg-onlyPrint CFG of function to 'dot' file (with no function bodies) -globalsmodref-aaSimple mod/ref analysis for globals -instcountCounts the various types of Instructions -intervalsInterval Partition Construction --load-vnLoad Value Numbering -loopsNatural Loop Construction -memdepMemory Dependence Analysis -no-aaNo Alias Analysis (always returns 'may' alias) -no-profileNo Profile Information -postdomfrontierPost-Dominance Frontier Construction -postdomtreePost-Dominator Tree Construction --printPrint function to stderr -print-alias-setsAlias Set Printer --print-callgraphPrint Call Graph to 'dot' file --print-cfgPrint CFG of function to 'dot' file --print-cfg-onlyPrint CFG of function to 'dot' file (with no function bodies) --printmPrint module to stderr --printusedtypesFind Used Types +-print-callgraphPrint a call graph +-print-callgraph-sccsPrint SCCs of the Call Graph +-print-cfg-sccsPrint SCCs of each function CFG +-print-externalfnconstantsPrint external fn callsites passed constants +-print-functionPrint function to stderr +-print-modulePrint module to stderr +-print-used-typesFind Used Types -profile-loaderLoad profile information from llvmprof.out -scalar-evolutionScalar Evolution Analysis -targetdataTarget Data Layout @@ -116,7 +114,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if ! -argpromotionPromote 'by reference' arguments to scalars -block-placementProfile Guided Basic Block Placement -break-crit-edgesBreak critical edges in CFG --ceeCorrelated Expression Elimination +-codegenpreparePrepare a function for code generation -condpropConditional Propagation -constmergeMerge Duplicate Global Constants -constpropSimple constant propagation @@ -125,11 +123,9 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if ! -deadtypeelimDead Type Elimination -dieDead Instruction Elimination -dseDead Store Elimination --gcseGlobal Common Subexpression Elimination -globaldceDead Global Elimination -globaloptGlobal Variable Optimizer -gvnGlobal Value Numbering --gvnpreGlobal Value Numbering/Partial Redundancy Elimination -indmemremIndirect Malloc and Free Removal -indvarsCanonicalize Induction Variables -inlineFunction Integration/Inlining @@ -142,8 +138,10 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if ! -internalizeInternalize Global Symbols -ipconstpropInterprocedural constant propagation -ipsccpInterprocedural Sparse Conditional Constant Propagation +-jump-threadingThread control through conditional blocks -lcssaLoop-Closed SSA Form Pass -licmLoop Invariant Code Motion +-loop-deletionDead Loop Deletion Pass -loop-extractExtract loops into new functions -loop-extract-singleExtract at most one loop into a new function -loop-index-splitIndex Split Loops @@ -152,18 +150,14 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if ! -loop-unrollUnroll loops -loop-unswitchUnswitch loops -loopsimplifyCanonicalize natural loops --lower-packedlowers packed operations to operations on smaller packed datatypes -lowerallocsLower allocations from instructions to calls --lowergcLower GC intrinsics, for GCless code generators -lowerinvokeLower invoke and unwind, for unwindless code generators --lowerselectLower select instructions to branches -lowersetjmpLower Set Jump -lowerswitchLower SwitchInst's to branches -mem2regPromote Memory to Register +-memcpyoptOptimize use of memcpy and friends -mergereturnUnify function exit nodes --predsimplifyPredicate Simplifier -prune-ehRemove unused exception handling info --raiseallocsRaise allocations from calls to instructions -reassociateReassociate expressions -reg2memDemote all values to stack slots -scalarreplScalar Replacement of Aggregates @@ -171,6 +165,8 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if ! -simplify-libcallsSimplify well-known library calls -simplifycfgSimplify the CFG -stripStrip all symbols from a module +-strip-dead-prototypesRemove unused function declarations +-sretpromotionPromote sret arguments -tailcallelimTail Call Elimination -tailduplicateTail Duplication @@ -179,7 +175,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if ! OptionName -deadarghaX0rDead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE) -extract-blocksExtract Basic Blocks From Module (for bugpoint use) --emitbitcodeBitcode Writer +-preverifyPreliminary module verification -verifyModule Verifier -view-cfgView CFG of function -view-cfg-onlyView CFG of function (with no function bodies) @@ -272,6 +268,12 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if ! located at getNode(F) + CallReturnPos. The arguments start at getNode(F) + CallArgPos.

+ +

+ Please keep in mind that the current andersen's pass has many known + problems and bugs. It should be considered "research quality". +

+ @@ -294,52 +296,6 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if !

Yet to be written.

- -
- Basic Value Numbering (default GVN impl) -
-
-

- This is the default implementation of the ValueNumbering - interface. It walks the SSA def-use chains to trivially identify - lexically identical expressions. This does not require any ahead of time - analysis, so it is a very fast default implementation. -

-
- - -
- Print a call graph -
-
-

- This pass, only available in opt, prints the call graph to - standard output in a human-readable form. -

-
- - -
- Print SCCs of the Call Graph -
-
-

- This pass, only available in opt, prints the SCCs of the call - graph to standard output in a human-readable form. -

-
- - -
- Print SCCs of each function CFG -
-
-

- This pass, only available in opt, prints the SCCs of each - function CFG to standard output in a human-readable form. -

-
-
Optimize for code generation @@ -404,14 +360,38 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if !

- Print external fn callsites passed constants + Print Call Graph to 'dot' file

- This pass, only available in opt, prints out call sites to - external functions that are called with constant arguments. This can be - useful when looking for standard library functions we should constant fold - or handle in alias analyses. + This pass, only available in opt, prints the call graph into a + .dot graph. This graph can then be processed with the "dot" tool + to convert it to postscript or some other suitable format. +

+
+ + +
+ Print CFG of function to 'dot' file +
+
+

+ This pass, only available in opt, prints the control flow graph + into a .dot graph. This graph can then be processed with the + "dot" tool to convert it to postscript or some other suitable format. +

+
+ + +
+ Print CFG of function to 'dot' file (with no function bodies) +
+
+

+ This pass, only available in opt, prints the control flow graph + into a .dot graph, omitting the function bodies. This graph can + then be processed with the "dot" tool to convert it to postscript or some + other suitable format.

@@ -454,28 +434,6 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if !

- -
- Load Value Numbering -
-
-

- This pass value numbers load and call instructions. To do this, it finds - lexically identical load instructions, and uses alias analysis to determine - which loads are guaranteed to produce the same value. To value number call - instructions, it looks for calls to functions that do not write to memory - which do not have intervening instructions that clobber the memory that is - read from. -

- -

- This pass builds off of another value numbering pass to implement value - numbering for non-load and non-call instructions. It uses Alias Analysis so - that it can disambiguate the load instructions. The more powerful these base - analyses are, the more powerful the resultant value numbering will be. -

-
-
Natural Loop Construction @@ -549,64 +507,73 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if !

- Print function to stderr + Alias Set Printer +
+
+

Yet to be written.

+
+ + +
+ Print a call graph

- The PrintFunctionPass class is designed to be pipelined with - other FunctionPasses, and prints out the functions of the module - as they are processed. + This pass, only available in opt, prints the call graph to + standard output in a human-readable form.

- Alias Set Printer + Print SCCs of the Call Graph
-

Yet to be written.

+

+ This pass, only available in opt, prints the SCCs of the call + graph to standard output in a human-readable form. +

- Print Call Graph to 'dot' file + Print SCCs of each function CFG

- This pass, only available in opt, prints the call graph into a - .dot graph. This graph can then be processed with the "dot" tool - to convert it to postscript or some other suitable format. + This pass, only available in opt, prints the SCCs of each + function CFG to standard output in a human-readable form.

- Print CFG of function to 'dot' file + Print external fn callsites passed constants

- This pass, only available in opt, prints the control flow graph - into a .dot graph. This graph can then be processed with the - "dot" tool to convert it to postscript or some other suitable format. + This pass, only available in opt, prints out call sites to + external functions that are called with constant arguments. This can be + useful when looking for standard library functions we should constant fold + or handle in alias analyses.

- Print CFG of function to 'dot' file (with no function bodies) + Print function to stderr

- This pass, only available in opt, prints the control flow graph - into a .dot graph, omitting the function bodies. This graph can - then be processed with the "dot" tool to convert it to postscript or some - other suitable format. + The PrintFunctionPass class is designed to be pipelined with + other FunctionPasses, and prints out the functions of the module + as they are processed.

- Print module to stderr + Print module to stderr

@@ -616,7 +583,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if !

@@ -739,27 +706,12 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if !

-

Correlated Expression Elimination propagates information from conditional - branches to blocks dominated by destinations of the branch. It propagates - information from the condition check itself into the body of the branch, - allowing transformations like these for example:

- -
-if (i == 7)
-  ... 4*i;  // constant propagation
-
-M = i+1; N = j+1;
-if (i == j)
-  X = M-N;  // = M-M == 0;
-
- -

This is called Correlated Expression Elimination because we eliminate or - simplify expressions that are correlated with the direction of a branch. In - this way we use static information to give us some information about the - dynamic value of a variable.

+ This pass munges the code in the input function to better prepare it for + SelectionDAG-based code generation. This works around limitations in it's + basic-block-at-a-time approach. It should eventually be removed.
@@ -864,19 +816,6 @@ if (i == j)

- - -
-

- This pass is designed to be a very quick global transformation that - eliminates global common subexpressions from a function. It does this by - using an existing value numbering implementation to identify the common - subexpressions, eliminating them when possible. -

-
-
Dead Global Elimination @@ -909,27 +848,11 @@ if (i == j)

- This pass performs global value numbering to eliminate fully redundant - instructions. It also performs simple dead load elimination. + This pass performs global value numbering to eliminate fully and partially + redundant instructions. It also performs redundant load elimination.

- - -
-

- This pass performs a hybrid of global value numbering and partial redundancy - elimination, known as GVN-PRE. It performs partial redundancy elimination on - values, rather than lexical expressions, allowing a more comprehensive view - the optimization. It replaces redundant values with uses of earlier - occurences of the same value. While this is beneficial in that it eliminates - unneeded computation, it also increases register pressure by creating large - live ranges, and should be used with caution on platforms that are very - sensitive to register pressure. -

-
@@ -1181,6 +1104,35 @@ if (i == j)

+ + +
+

+ Jump threading tries to find distinct threads of control flow running through + a basic block. This pass looks at blocks that have multiple predecessors and + multiple successors. If one or more of the predecessors of the block can be + proven to always cause a jump to one of the successors, we forward the edge + from the predecessor to the successor by duplicating the contents of this + block. +

+

+ An example of when this can occur is code like this: +

+ +
if () { ...
+  X = 4;
+}
+if (X < 3) {
+ +

+ In this case, the unconditional branch at the end of the first if can be + revectored to the false side of the second if. +

+
+
Loop-Closed SSA Form Pass @@ -1246,6 +1198,18 @@ if (i == j) variable.
+ + +
+

+ This file implements the Dead Loop Deletion Pass. This pass is responsible + for eliminating loops with non-infinite computable trip counts that have no + side effects or volatile instructions, and do not contribute to the + computation of the function's return value. +

+
@@ -1388,17 +1352,6 @@ if (i == j)

- - -
-

- Lowers operations on vector datatypes into operations on more primitive vector - datatypes, and finally to scalar operations. -

-
-
Lower allocations from instructions to calls @@ -1415,29 +1368,6 @@ if (i == j)

- - -
-

- This file implements lowering for the llvm.gc* intrinsics for targets - that do not natively support them (which includes the C backend). Note that - the code generated is not as efficient as it would be for targets that - natively support the GC intrinsics, but it is useful for getting new targets - up-and-running quickly. -

- -

- This pass implements the code transformation described in this paper: -

- -

- "Accurate Garbage Collection in an Uncooperative Environment" - Fergus Henderson, ISMM, 2002 -

-
-
Lower invoke and unwind, for unwindless code generators @@ -1479,25 +1409,6 @@ if (i == j)

- - -
-

- Lowers select instructions into conditional branches for targets that do not - have conditional moves or that have not implemented the select instruction - yet. -

- -

- Note that this pass could be improved. In particular it turns every select - instruction into a new conditional branch, even though some common cases have - select instructions on the same predicate next to each other. It would be - better to use the same branch for the whole group of selects. -

-
-
Lower Set Jump @@ -1557,35 +1468,24 @@ if (i == j)

- Ensure that functions have at most one ret instruction in them. - Additionally, it keeps track of which node is the new exit node of the CFG. + This pass performs various transformations related to eliminating memcpy + calls, or transforming sets of stores into memset's.

- Path-sensitive optimizer. In a branch where x == y, replace uses of - x with y. Permits further optimization, such as the - elimination of the unreachable call: + Ensure that functions have at most one ret instruction in them. + Additionally, it keeps track of which node is the new exit node of the CFG.

- -
void test(int *p, int *q)
-{
-  if (p != q)
-    return;
-
-  if (*p != *q)
-    foo(); // unreachable
-}
@@ -1601,17 +1501,6 @@ if (i == j)

- - -
-

- Converts @malloc and @free calls to malloc and - free instructions. -

-
-
Reassociate expressions @@ -1643,7 +1532,7 @@ if (i == j)

This file demotes all registers to memory references. It is intented to be the inverse of -mem2reg. By converting to - load instructions, the only values live accross basic blocks are + load instructions, the only values live across basic blocks are alloca instructions and load instructions before phi nodes. It is intended that this should make CFG hacking much easier. To make later hacking easier, the entry block is split into two, such @@ -1751,6 +1640,42 @@ if (i == j)

+ + +
+

+ This pass loops over all of the functions in the input module, looking for + dead declarations and removes them. Dead declarations are declarations of + functions for which no implementation is available (i.e., declarations for + unused library functions). +

+
+ + + +
+

+ This pass finds functions that return a struct (using a pointer to the struct + as the first argument of the function, marked with the 'sret' attribute) and + replaces them with a new function that simply returns each of the elements of + that struct (using multiple return values). +

+ +

+ This pass works under a number of conditions: +

+ +
    +
  • The returned struct must not contain other structs
  • +
  • The returned struct must only be used to load values from
  • +
  • The placeholder struct passed in is the result of an alloca
  • +
+
+
Tail Call Elimination @@ -1826,10 +1751,18 @@ if (i == j)
-

Yet to be written.

+

+ Ensures that the module is in the form required by the Module Verifier pass. +

+ +

+ Running the verifier runs this pass automatically, so there should be no need + to use it directly. +

@@ -1845,7 +1778,7 @@ if (i == j) before performing optimizing transformations.

-

+

  • Both of a binary operator's parameters are of the same type.
  • Verify that the indices of mem access instructions match other operands.
  • @@ -1854,10 +1787,10 @@ if (i == j) integrals f.e.
  • All of the constants in a switch statement are of the correct type.
  • The code is in valid SSA form.
  • -
  • It should be illegal to put a label into any other type (like a - structure) or to return one. [except constant arrays!]
  • -
  • Only phi nodes can be self referential: 'add int %0, %0 ; :0' is - bad.
  • +
  • It is illegal to put a label into any other type (like a structure) or + to return one.
  • +
  • Only phi nodes can be self referential: %x = add i32 %x, %x is + invalid.
  • PHI nodes must have an entry for each predecessor, with no extras.
  • PHI nodes must be the first thing in a basic block, all grouped together.
  • @@ -1875,7 +1808,7 @@ if (i == j) not agree with the function return value type.
  • Function call argument types match the function prototype.
  • All other things that are tested by asserts spread about the code.
  • -

    +

Note that this does not provide full security verification (like Java), but @@ -1909,9 +1842,9 @@ if (i == j)


Valid CSS! + src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS"> Valid HTML 4.01! + src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"> Reid Spencer
LLVM Compiler Infrastructure