diff --git a/docs/Passes.html b/docs/Passes.html index 192f4420bf7..c144e2ba63d 100644 --- a/docs/Passes.html +++ b/docs/Passes.html @@ -1149,7 +1149,11 @@ if (i == j) Internalize Global Symbols
Yet to be written.
++ This pass loops over all of the functions in the input module, looking for a + main function. If a main function is found, all other functions and all + global variables with initializers are marked as internal. +
Yet to be written.
++ This pass implements an extremely simple interprocedural constant + propagation pass. It could certainly be improved in many different ways, + like using a worklist. This pass makes arguments dead, but does not remove + them. The existing dead argument elimination pass should be run after this + to clean up the mess. +
Yet to be written.
++ An interprocedural variant of Sparse Conditional Constant + Propagation. +
Yet to be written.
++ This pass transforms loops by placing phi nodes at the end of the loops for + all values that are live across the loop boundary. For example, it turns + the left into the right code: +
+ +for (...) for (...) + if (c) if (c) + X1 = ... X1 = ... + else else + X2 = ... X2 = ... + X3 = phi(X1, X2) X3 = phi(X1, X2) +... = X3 + 4 X4 = phi(X3) + ... = X4 + 4+ +
+ This is still valid LLVM; the extra phi nodes are purely redundant, and will
+ be trivially eliminated by InstCombine
. The major benefit of
+ this transformation is that it makes many other loop optimizations, such as
+ LoopUnswitching, simpler.
+
Yet to be written.
++ This pass performs loop invariant code motion, attempting to remove as much + code from the body of a loop as possible. It does this by either hoisting + code into the preheader block, or by sinking code to the exit blocks if it is + safe. This pass also promotes must-aliased memory locations in the loop to + live in registers, thus hoisting and sinking "invariant" loads and stores. +
+ ++ This pass uses alias analysis for two purposes: +
+ +Yet to be written.
+
+ A pass wrapper around the ExtractLoop()
scalar transformation to
+ extract each top-level loop into its own new function. If the loop is the
+ only loop in a given function, it is not touched. This is a pass most
+ useful for debugging via bugpoint.
+
Yet to be written.
++ Similar to Extract loops into new functions, + this pass extracts one natural loop from the program into a function if it + can. This is used by bugpoint. +
Yet to be written.
++ This pass divides loop's iteration range by spliting loop such that each + individual loop is executed efficiently. +
Yet to be written.
++ This pass performs a strength reduction on array references inside loops that + have as one or more of their components the loop induction variable. This is + accomplished by creating a new value to hold the initial value of the array + access for the first iteration, and then creating a new GEP instruction in + the loop to increment the value by the appropriate amount. +
Yet to be written.
+A simple loop rotation transformation.
Yet to be written.
++ This pass implements a simple loop unroller. It works best when loops have + been canonicalized by the -indvars pass, + allowing it to determine the trip counts of loops easily. +
Yet to be written.
++ This pass transforms loops that contain branches on loop-invariant conditions + to have multiple loops. For example, it turns the left into the right code: +
+ +for (...) if (lic) + A for (...) + if (lic) A; B; C + B else + C for (...) + A; C+ +
+ This can increase the size of the code exponentially (doubling it every time + a loop is unswitched) so we only unswitch if the resultant code will be + smaller than a threshold. +
+ ++ This pass expects LICM to be run before it to hoist invariant conditions out + of the loop, to make the unswitching opportunity obvious. +
Yet to be written.
++ This pass performs several transformations to transform natural loops into a + simpler form, which makes subsequent analyses and transformations simpler and + more effective. +
+ ++ Loop pre-header insertion guarantees that there is a single, non-critical + entry edge from outside of the loop to the loop header. This simplifies a + number of analyses and transformations, such as LICM. +
+ ++ Loop exit-block insertion guarantees that all exit blocks from the loop + (blocks which are outside of the loop that have predecessors inside of the + loop) only have predecessors from inside of the loop (and are thus dominated + by the loop header). This simplifies transformations such as store-sinking + that are built into LICM. +
+ ++ This pass also guarantees that loops will have exactly one backedge. +
+ ++ Note that the simplifycfg pass will clean up blocks which are split out but + end up being unnecessary, so usage of this pass should not pessimize + generated code. +
+ ++ This pass obviously modifies the CFG, but updates loop information and + dominator information. +
Yet to be written.
++ Lowers operations on vector datatypes into operations on more primitive vector + datatypes, and finally to scalar operations. +
Yet to be written.
++ Turn malloc and free instructions into @malloc and + @free calls. +
+ ++ This is a target-dependent tranformation because it depends on the size of + data types and alignment constraints. +
Yet to be written.
++ 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 +
Yet to be written.
++ This transformation is designed for use by code generators which do not yet + support stack unwinding. This pass supports two models of exception handling + lowering, the 'cheap' support and the 'expensive' support. +
+ ++ 'Cheap' exception handling support gives the program the ability to execute + any program which does not "throw an exception", by turning 'invoke' + instructions into calls and by turning 'unwind' instructions into calls to + abort(). If the program does dynamically use the unwind instruction, the + program will print a message then abort. +
+ ++ 'Expensive' exception handling support gives the full exception handling + support to the program at the cost of making the 'invoke' instruction + really expensive. It basically inserts setjmp/longjmp calls to emulate the + exception handling as necessary. +
+ ++ Because the 'expensive' support slows down programs a lot, and EH is only + used for a subset of the programs, it must be specifically enabled by the + -enable-correct-eh-support option. +
+ ++ Note that after this pass runs the CFG is not entirely accurate (exceptional + control flow edges are not correct anymore) so only very simple things should + be done after the lowerinvoke pass has run (like generation of native code). + This should not be used as a general purpose "my LLVM-to-LLVM pass doesn't + support the invoke instruction yet" lowering pass. +
Yet to be written.
++ 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. +
Yet to be written.
++ Lowers setjmp and longjmp to use the LLVM invoke and unwind + instructions as necessary. +
+ ++ Lowering of longjmp is fairly trivial. We replace the call with a + call to the LLVM library function __llvm_sjljeh_throw_longjmp(). + This unwinds the stack for us calling all of the destructors for + objects allocated on the stack. +
+ ++ At a setjmp call, the basic block is split and the setjmp + removed. The calls in a function that have a setjmp are converted to + invoke where the except part checks to see if it's a longjmp + exception and, if so, if it's handled in the function. If it is, then it gets + the value returned by the longjmp and goes to where the basic block + was split. invoke instructions are handled in a similar fashion with + the original except block being executed if it isn't a longjmp + except that is handled by that function. +
Yet to be written.
++ Rewrites switch instructions with a sequence of branches, which + allows targets to get away with not implementing the switch instruction until + it is convenient. +
Yet to be written.
++ This file promotes memory references to be register references. It promotes + alloca instructions which only have loads and + stores as uses. An alloca is transformed by using dominator + frontiers to place phi nodes, then traversing the function in + depth-first order to rewrite loads and stores as + appropriate. This is just the standard SSA construction algorithm to construct + "pruned" SSA form. +
Yet to be written.
++ 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. +
Yet to be written.
++ 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: +
+ +void test(int *p, int *q) +{ + if (p != q) + return; + + if (*p != *q) + foo(); // unreachable +}
Yet to be written.
++ 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. +
Yet to be written.
++ Converts @malloc and @free calls to malloc and + free instructions. +
Yet to be written.
++ This pass reassociates commutative expressions in an order that is designed + to promote better constant propagation, GCSE, LICM, PRE, etc. +
+ ++ For example: 4 + (x + 5) ⇒ x + (4 + 5) +
+ ++ In the implementation of this algorithm, constants are assigned rank = 0, + function arguments are rank = 1, and other values are assigned ranks + corresponding to the reverse post order traversal of current function + (starting at 2), which effectively gives values in deep loops higher rank + than values not in loops. +
Yet to be written.
++ 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 + 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 + that all introduced alloca instructions (and nothing else) are in the + entry block. +
Yet to be written.
++ The well-known scalar replacement of aggregates transformation. This + transform breaks up alloca instructions of aggregate type (structure + or array) into individual alloca instructions for each member if + possible. Then, if possible, it transforms the individual alloca + instructions into nice clean scalar SSA form. +
+ ++ This combines a simple scalar replacement of aggregates algorithm with the mem2reg algorithm because often interact, + especially for C++ programs. As such, iterating between scalarrepl, + then mem2reg until we run out of things to + promote works well. +
Yet to be written.
++ Sparse conditional constant propagation and merging, which can be summarized + as: +
+ ++ Note that this pass has a habit of making definitions be dead. It is a good + idea to to run a DCE pass sometime after running this pass. +
Yet to be written.
++ Applies a variety of small optimizations for calls to specific well-known + function calls (e.g. runtime library functions). For example, a call + exit(3) that occurs within the main() function can be + transformed into simply return 3. +
Yet to be written.
++ Performs dead code elimination and basic block merging. Specifically: +
+ +Yet to be written.
++ Performs code stripping. This transformation can delete: +
+ ++ 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. +
Yet to be written.
++ This file transforms calls of the current function (self recursion) followed + by a return instruction with a branch to the entry of the function, creating + a loop. This pass also implements the following extensions to the basic + algorithm: +
+ +Yet to be written.
++ This pass performs a limited form of tail duplication, intended to simplify + CFGs by removing some unconditional branches. This pass is necessary to + straighten out loops created by the C front-end, but also is capable of + making other code nicer. After this pass is run, the CFG simplify pass + should be run to clean up the mess. +