From af4af3ae5972cf477cef0b48c992710fbd289609 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Tue, 27 Mar 2007 02:49:31 +0000 Subject: [PATCH] For PR601: Add a little flesh to the document skeleton. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35377 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/Passes.html | 54 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/docs/Passes.html b/docs/Passes.html index fa6e22fedff..46957690088 100644 --- a/docs/Passes.html +++ b/docs/Passes.html @@ -477,7 +477,10 @@ Aggressive Dead Code Elimination
-

Yet to be written.

+

ADCE aggressively tries to eliminate code. This pass is similar to + DCE but it assumes that values are dead until proven + otherwise. This is similar to SCCP, except applied to + the liveness of values.

@@ -493,7 +496,21 @@ Profile Guided Basic Block Placement
-

Yet to be written.

+

This pass implements a very simple profile guided basic block placement + algorithm. The idea is to put frequently executed blocks together at the + start of the function, and hopefully increase the number of fall-through + conditional branches. If there is no profile information for a particular + function, this pass basically orders blocks in depth-first order.

+

The algorithm implemented here is basically "Algo1" from "Profile Guided + Code Positioning" by Pettis and Hansen, except that it uses basic block + counts instead of edge counts. This could be improved in many ways, but is + very simple for now.

+

Basically we "place" the entry block, then loop over all successors in a + DFO, placing the most frequently executed successor until we run out of + blocks. Did we mention that this was extremely simplistic? This is + also much slower than it could be. When it becomes important, this pass + will be rewritten to use a better algorithm, and then we can worry about + efficiency.

@@ -509,7 +526,23 @@ Correlated Expression Elimination
-

Yet to be written.

+

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.

@@ -517,7 +550,8 @@ Conditional Propagation
-

Yet to be written.

+

This pass propagates information about conditional expressions through the + program, allowing it to eliminate conditional branches in some cases.

@@ -530,10 +564,18 @@
- Simple constant propagation + Constant Propagation
-

Yet to be written.

+

This file implements constant propagation and merging. It looks for + instructions involving only constant operands and replaces them with a + constant value instead of an instruction. For example: +

add i32 1, 2

+ becomes +
i32 3

+

NOTE: this pass has a habit of making definitions be dead. It is a good + idea to to run a DIE (Dead Instruction Elimination) pass + sometime after running this pass.