X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FPasses.html;h=d79da12c08bbb07bd1bf5591b323f4e915bef1cb;hb=937790195ecb644e3fcbae2d70a879748c14b4b8;hp=352263eca73aac14af5ab186c33d570da9577aee;hpb=75ff18ed2b43439c76d449f7cc14776308bb85ea;p=oota-llvm.git diff --git a/docs/Passes.html b/docs/Passes.html index 352263eca73..d79da12c08b 100644 --- a/docs/Passes.html +++ b/docs/Passes.html @@ -27,7 +27,7 @@ while () { my $o = $order{$1}; $o = "000" unless defined $o; push @x, "$o-$1$2\n"; - push @y, "$o $2\n"; + push @y, "$o -$1: $2\n"; } @x = map { s/^\d\d\d//; $_ } sort @x; @y = map { s/^\d\d\d//; $_ } sort @y; @@ -75,49 +75,67 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if ! ANALYSIS PASSES OptionName -aa-evalExhaustive Alias Analysis Precision Evaluator --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) +-dot-domPrint dominator tree of function to 'dot' file +-dot-dom-onlyPrint dominator tree of function to 'dot' file (with no function bodies) +-dot-postdomPrint post dominator tree of function to 'dot' file +-dot-postdom-onlyPrint post dominator tree of function to 'dot' file (with no function bodies) -globalsmodref-aaSimple mod/ref analysis for globals -instcountCounts the various types of Instructions +-interprocedural-aa-evalExhaustive Interprocedural Alias Analysis Precision Evaluator +-interprocedural-basic-aaInterprocedural Basic Alias Analysis -intervalsInterval Partition Construction --load-vnLoad Value Numbering --loopsNatural Loop Construction +-iv-usersInduction Variable Users +-lazy-value-infoLazy Value Information Analysis +-ldaLoop Dependence Analysis +-libcall-aaLibCall Alias Analysis +-lintCheck for common errors in LLVM IR +-live-valuesValue Liveness Analysis +-loopsNatural Loop Information -memdepMemory Dependence Analysis +-module-debuginfoPrints module debug info metadata -no-aaNo Alias Analysis (always returns 'may' alias) -no-profileNo Profile Information +-pointertrackingTrack pointer bounds -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-dbginfoPrint debug info in human readable form +-print-dom-infoDominator Info Printer +-print-externalfnconstantsPrint external fn callsites passed constants +-print-functionPrint function to stderr +-print-modulePrint module to stderr +-print-used-typesFind Used Types +-profile-estimatorEstimate profiling information -profile-loaderLoad profile information from llvmprof.out +-regionsDetect single entry single exit regions in a function +-profile-verifierVerify profiling information -scalar-evolutionScalar Evolution Analysis +-scev-aaScalarEvolution-based Alias Analysis -targetdataTarget Data Layout TRANSFORM PASSES OptionName +-abcdRemove redundant conditional branches -adceAggressive Dead Code Elimination +-always-inlineInliner for always_inline functions -argpromotionPromote 'by reference' arguments to scalars -block-placementProfile Guided Basic Block Placement -break-crit-edgesBreak critical edges in CFG --ceeCorrelated Expression Elimination --condpropConditional Propagation +-codegenpreparePrepare a function for code generation -constmergeMerge Duplicate Global Constants -constpropSimple constant propagation -dceDead Code Elimination @@ -125,25 +143,22 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if ! -deadtypeelimDead Type Elimination -dieDead Instruction Elimination -dseDead Store Elimination --gcseGlobal Common Subexpression Elimination +-functionattrsDeduce function attributes -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 --insert-block-profilingInsert instrumentation for block profiling -insert-edge-profilingInsert instrumentation for edge profiling --insert-function-profilingInsert instrumentation for function profiling --insert-null-profiling-rsMeasure profiling framework overhead --insert-rs-profiling-frameworkInsert random sampling instrumentation framework +-insert-optimal-edge-profilingInsert optimal instrumentation for edge profiling -instcombineCombine redundant instructions -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,25 +167,34 @@ 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 +-loweratomicLower atomic intrinsics -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 +-mergefuncMerge Functions -mergereturnUnify function exit nodes --predsimplifyPredicate Simplifier +-partial-inlinerPartial Inliner +-partialspecializationPartial Specialization -prune-ehRemove unused exception handling info --raiseallocsRaise allocations from calls to instructions -reassociateReassociate expressions -reg2memDemote all values to stack slots -scalarreplScalar Replacement of Aggregates -sccpSparse Conditional Constant Propagation +-sinkCode Sinking -simplify-libcallsSimplify well-known library calls +-simplify-libcalls-halfpowrSimplify half_powr library calls -simplifycfgSimplify the CFG +-split-gepsSplit complex GEPs into simple GEPs +-ssiStatic Single Information Construction +-ssi-everythingStatic Single Information Construction (everything, intended for debugging) -stripStrip all symbols from a module +-strip-dead-debug-infoStrip debug info for unused symbols +-strip-dead-prototypesRemove unused function declarations +-strip-debug-declareStrip all llvm.dbg.declare intrinsics +-strip-nondebugStrip all symbols, except dbg symbols, from a module +-sretpromotionPromote sret arguments -tailcallelimTail Call Elimination -tailduplicateTail Duplication @@ -179,10 +203,15 @@ 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 +-instnamerAssign names to anonymous instructions +-preverifyPreliminary module verification -verifyModule Verifier -view-cfgView CFG of function -view-cfg-onlyView CFG of function (with no function bodies) +-view-domView dominator tree of function +-view-dom-onlyView dominator tree of function (with no function bodies) +-view-postdomView post dominator tree of function +-view-postdom-onlyView post dominator tree of function (with no function bodies) @@ -194,7 +223,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if !

- Exhaustive Alias Analysis Precision Evaluator + -aa-eval: Exhaustive Alias Analysis Precision Evaluator

This is a simple N^2 alias analysis accuracy evaluator. @@ -208,216 +237,178 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if !

- This is an implementation of Andersen's interprocedural alias - analysis -

- -

- In pointer analysis terms, this is a subset-based, flow-insensitive, - field-sensitive, and context-insensitive algorithm pointer algorithm. -

- -

- This algorithm is implemented as three stages: -

- -
    -
  1. Object identification.
  2. -
  3. Inclusion constraint identification.
  4. -
  5. Offline constraint graph optimization.
  6. -
  7. Inclusion constraint solving.
  8. -
- -

- The object identification stage identifies all of the memory objects in the - program, which includes globals, heap allocated objects, and stack allocated - objects. -

- -

- The inclusion constraint identification stage finds all inclusion constraints - in the program by scanning the program, looking for pointer assignments and - other statements that effect the points-to graph. For a statement like - A = B, this statement is processed to - indicate that A can point to anything that B can point - to. Constraints can handle copies, loads, and stores, and address taking. -

- -

- The offline constraint graph optimization portion includes offline variable - substitution algorithms intended to computer pointer and location - equivalences. Pointer equivalences are those pointers that will have the - same points-to sets, and location equivalences are those variables that - always appear together in points-to sets. -

- -

- The inclusion constraint solving phase iteratively propagates the inclusion - constraints until a fixed point is reached. This is an O(n³) - algorithm. -

- -

- Function constraints are handled as if they were structs with X - fields. Thus, an access to argument X of function Y is - an access to node index getNode(Y) + X. - This representation allows handling of indirect calls without any issues. To - wit, an indirect call Y(a,b) is - equivalent to *(Y + 1) = a, *(Y + 2) = - b. The return node for a function F is always - located at getNode(F) + CallReturnPos. The arguments - start at getNode(F) + CallArgPos. + This is 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.

-

- This is 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. -

+

Yet to be written.

-

Yet to be written.

+

+ 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. +

- 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. + A pass which can be used to count how many alias queries + are being made and how the alias analysis implementation being used responds.

- This pass, only available in opt, prints the call graph to - standard output in a human-readable form. + This simple pass checks alias analysis users to ensure that if they + create a new value, they do not query AA without informing it of the value. + It acts as a shim over any other AA pass you want. +

+ +

+ Yes keeping track of every value in the program is expensive, but this is + a debugging pass.

- This pass, only available in opt, prints the SCCs of the call - graph to standard output in a human-readable form. + This pass is a simple dominator construction algorithm for finding forward + dominator frontiers.

- This pass, only available in opt, prints the SCCs of each - function CFG to standard output in a human-readable form. + This pass is a simple dominator construction algorithm for finding forward + dominators.

- 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. + 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.

- A pass which can be used to count how many alias queries - are being made and how the alias analysis implementation being used responds. + 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 simple pass checks alias analysis users to ensure that if they - create a new value, they do not query AA without informing it of the value. - It acts as a shim over any other AA pass you want. + 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.

- +
+ + + +

- Yes keeping track of every value in the program is expensive, but this is - a debugging pass. + This pass, only available in opt, prints the dominator tree + 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 is a simple dominator construction algorithm for finding forward - dominator frontiers. + This pass, only available in opt, prints the dominator tree + 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.

- This pass is a simple dominator construction algorithm for finding forward - dominators. + This pass, only available in opt, prints the post dominator tree + 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. + This pass, only available in opt, prints the post dominator tree + 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.

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

\n" if !

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

\n" if !

+
+

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. +

+
+ + + +
+

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. +

+
+ + +

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

\n" if !

-

- 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. -

+

Bookkeeping for "interesting" users of expressions computed from + induction variables.

+
+ + + +
+

Interface for lazy computation of value constraint information.

+
+ + + +
+

Loop dependence analysis framework, which is used to detect dependences in + memory accesses in loops.

+
+ + + +
+

LibCall Alias Analysis.

+
+ + + +
+

This pass statically checks for common and easily-identified constructs + which produce undefined or likely unintended behavior in LLVM IR.

+ +

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.

-

- 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. +

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.

+ +

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.

+ +

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.

+
+

LLVM IR Value liveness analysis pass.

+
+ + +

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

\n" if !

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

\n" if !

+
+

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. +

+
+ + +

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

\n" if !

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

\n" if !

+
+

Tracking of pointer bounds. +

+
+ + +

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

\n" if !

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

\n" if !

+
+

Yet to be written.

+
+ + +

- 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 error in a human-readable form.

-

Yet to be written.

+

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

- 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 error in a human-readable form.

+
+

Pass that prints instructions, and associated debug info:

+
    + +
  • source/line/col information
  • +
  • original variable name
  • +
  • original type name
  • +
+
+ + + +
+

Dominator Info Printer.

+
+ + +

- 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.

- 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.

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

\n" if !

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

\n" if !

+
+

Profiling information that estimates the profiling information + in a very crude and unimaginative way. +

+
+ + +

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

\n" if !

+
+

Pass that checks profiling information for plausibility.

+
+ +
+

+ The RegionInfo pass detects single entry single exit regions in a + function, where a region is defined as any subgraph that is connected to the + remaining graph at only two spots. Furthermore, an hierarchical region tree is + built. +

+
+ + +

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

\n" if !

+
+

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. +

+
+ + + +
+

+ performs code stripping. this transformation can delete: +

+ +
    +
  1. names for virtual registers
  2. +
  3. symbols for internal globals and functions
  4. +
  5. debug information
  6. +
+ +

+ 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. +

+
+ + +

Provides other passes access to information on how the size and alignment @@ -672,7 +857,22 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if !

+
+

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.

+

It is advisable to run SimplifyCFG and + Aggressive Dead Code Elimination after ABCD + to clean up the code.

+
+ + +

ADCE aggressively tries to eliminate code. This pass is similar to @@ -683,7 +883,16 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if !

+
+

A custom inliner that handles only functions that are marked as + "always inline".

+
+ + +

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

\n" if !

This pass is a very simple profile guided basic block placement algorithm. @@ -726,7 +935,7 @@ perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print "

\n" if !

@@ -739,41 +948,17 @@ 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 propagates information about conditional expressions through the - program, allowing it to eliminate conditional branches in some cases.

+ 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.

@@ -786,7 +971,7 @@ if (i == j)

This file implements constant propagation and merging. It looks for @@ -802,7 +987,7 @@ if (i == j)

@@ -814,7 +999,7 @@ if (i == j)

@@ -832,7 +1017,7 @@ if (i == j)

@@ -844,7 +1029,7 @@ if (i == j)

@@ -855,7 +1040,7 @@ if (i == j)

@@ -866,20 +1051,22 @@ 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. +

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.

@@ -893,7 +1080,7 @@ if (i == j)

@@ -905,52 +1092,18 @@ if (i == j)

-
-

- This pass performs global value numbering to eliminate fully redundant - instructions. It also performs simple dead 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. -

-
- - -

- 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. -

- -

- Thus find places where the address of memory functions are taken and construct - bounce functions with direct calls of those functions. + This pass performs global value numbering to eliminate fully and partially + redundant instructions. It also performs redundant load elimination.

@@ -1001,7 +1154,7 @@ if (i == j)

@@ -1011,26 +1164,7 @@ if (i == j)

-
-

- 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. -

- -

- 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. -

-
- - -

@@ -1048,51 +1182,18 @@ if (i == j)

-
-

- This pass instruments the specified program with counters for function - profiling, which counts the number of times each function is called. -

-
- - - -
-

- The basic profiler that does nothing. It is the default profiler and thus - terminates RSProfiler chains. It is useful for measuring - framework overhead. -

-
- - -
-

- 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. -

- -

- After this pass, it is highly recommended to runmem2reg - and adce. instcombine, - load-vn, gdce, and - dse also are good to run afterwards. +

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.

@@ -1146,7 +1247,7 @@ if (i == j)

@@ -1158,7 +1259,7 @@ if (i == j)

@@ -1172,7 +1273,7 @@ if (i == j)

@@ -1183,7 +1284,36 @@ 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. +

+
+ + +

@@ -1212,7 +1342,7 @@ if (i == j)

@@ -1246,10 +1376,22 @@ 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. +

+

@@ -1262,7 +1404,7 @@ if (i == j)

@@ -1274,7 +1416,7 @@ if (i == j)

@@ -1285,7 +1427,7 @@ if (i == j)

@@ -1299,7 +1441,7 @@ if (i == j)

A simple loop rotation transformation.

@@ -1307,7 +1449,7 @@ if (i == j)

@@ -1319,7 +1461,7 @@ if (i == j)

@@ -1349,7 +1491,7 @@ if (i == j)

@@ -1390,18 +1532,7 @@ if (i == j)

-
-

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

-
- - -

@@ -1417,30 +1548,25 @@ 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 lowers atomic intrinsics to non-atomic form for use in a known + non-preemptible environment.

- +

- This pass implements the code transformation described in this paper: + The pass does not verify that the environment is non-preemptible (in + general this would require knowledge of the entire call graph of the + program including any libraries which may not be available in bitcode form); + it simply lowers every atomic intrinsic.

- -

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

@@ -1481,26 +1607,7 @@ 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. -

-
- - -

@@ -1529,7 +1636,7 @@ if (i == j)

@@ -1541,7 +1648,7 @@ if (i == j)

@@ -1557,64 +1664,89 @@ 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. +

+
+ + + +
+

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.

- 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 -} + + +
+

This pass performs partial inlining, typically by inlining an if + statement that surrounds the body of the function. +

-

- This file implements a simple interprocedural pass which walks the call-graph, - turning invoke instructions into call instructions if and - only if the callee cannot throw an exception. It implements this as a - bottom-up traversal of the call-graph. +

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 IPSCCP and DAE to clean up the results. + + The initial heuristic favors constant arguments that are used in control + flow.

- Converts @malloc and @free calls to malloc and - free instructions. + This file implements a simple interprocedural pass which walks the call-graph, + turning invoke instructions into call instructions if and + only if the callee cannot throw an exception. It implements this as a + bottom-up traversal of the call-graph.

@@ -1637,13 +1769,13 @@ 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 @@ -1654,7 +1786,7 @@ if (i == j)

@@ -1676,7 +1808,7 @@ if (i == j)

@@ -1699,7 +1831,17 @@ if (i == j)

+
+

This pass moves instructions into successor blocks, when possible, so that + they aren't executed on paths where their results aren't needed. +

+
+ + +

@@ -1712,7 +1854,17 @@ if (i == j)

+
+

Simple pass that applies an experimental transformation on calls + to specific functions. +

+
+ + +

@@ -1731,11 +1883,48 @@ if (i == j)

+
+

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. +

+
+ + + +
+

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. +

+
+ + + +
+

A pass that runs SSI on every non-void variable, intended for debugging. +

+
+ + +

- Performs code stripping. This transformation can delete: + performs code stripping. this transformation can delete:

    @@ -1745,7 +1934,7 @@ if (i == j)

- 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 strip utility would be used, such as reducing code size or making it harder to reverse engineer code.

@@ -1753,7 +1942,79 @@ 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 implements code stripping. Specifically, it can delete:

+
    +
  • names for virtual registers
  • +
  • symbols for internal globals and functions
  • +
  • debug information
  • +
+

+ 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. +

+
+ + + +
+

This pass implements code stripping. Specifically, it can delete:

+
    +
  • names for virtual registers
  • +
  • symbols for internal globals and functions
  • +
  • debug information
  • +
+

+ 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. +

+
+ + + +
+

+ 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
  • +
+
+ + +

@@ -1785,7 +2046,7 @@ if (i == j)

@@ -1805,7 +2066,7 @@ if (i == j)

@@ -1816,7 +2077,7 @@ if (i == j)

@@ -1826,15 +2087,35 @@ if (i == j)

-

Yet to be written.

+

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. +

+
+

+ 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 +2126,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 +2135,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 +2156,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 @@ -1885,7 +2166,7 @@ if (i == j)

@@ -1895,7 +2176,7 @@ if (i == j)

@@ -1904,14 +2185,60 @@ if (i == j)

+ + +
+

+ Displays the dominator tree using the GraphViz tool. +

+
+ + + +
+

+ Displays the dominator tree using the GraphViz tool, but omitting function + bodies. +

+
+ + + +
+

+ Displays the post dominator tree using the GraphViz tool. +

+
+ + + +
+

+ Displays the post dominator tree using the GraphViz tool, but omitting + function bodies. +

+
+
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