Archive for November, 2007

Figure 18.1: (Tomcat web server) Some loops; in each case, 1

Friday, November 30th, 2007

Figure 18.1: Some loops; in each case, 1 is the header node. Team-Fly Team-Fly REDUCIBLE FLOW GRAPHS A reducible flow graph is one in which the dictionary definition of loop corresponds more closely to the technical definition; but let us develop a more precise definition. Figure 18.2a does not contain a loop; either node in the strongly connected component (2, 3) can be reached without going through the other. Figure 18.2: None of these contains a loop. Dotted lines indicate reduction of graph (c) by deleting edges and collapsing nodes. Figure 18.2c contains the same pattern of nodes 1, 2, 3; this becomes more clear if we repeatedly delete edges and collapse together pairs of nodes (x, y), where x is the only predecessor of y. That is: Delete 6 . 9, 5 . 4, collapse (7, 9), (3, 7), (7, 8) , (5, 6), (1, 5), (1, 4); and we obtain Figure 18.2a. An irreducible flow graph is one in which -after collapsing nodes and deleting edges -we can find a subgraph like Figure 18.2a. A reducible flow graph is one that cannot be collapsed to contain such a subgraph. Without such subgraphs, then any cycle of nodes does have a unique header node. Common control-flow constructs such as if-then, if-then-else, while-do, repeat-until, for, and break (even multilevel break) can only generate reducible flow graphs. Thus, the control-flow graph for a MiniJava or Java function, or a C function without goto, will always be reducible.
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.

Yahoo web space - use of, the lemma that each node is

Friday, November 30th, 2007

use of, the lemma that each node is visited after all of its predecessors. . e. Suppose we order the nodes according to the order they are first visited by depth-first search. Calculate reaching definitions using that order, showing the results in tabular format; how many iterations are required? . *17.6 Write down a work-list algorithm for liveness analysis, in a form similar to that of Algorithm 17.6. Team-Fly Team-Fly Chapter 18: Loop Optimizations OVERVIEW loop: a series of instructions that is repeated until a terminating condition is reached Webster’s Dictionary Loops are pervasive in computer programs, and a great proportion of the execution time of a typical program is spent in one loop or another. Hence it is worthwhile devising optimizations to make loops go faster. Intuitively, a loop is a sequence of instructions that ends by jumping back to the beginning. But to be able to optimize loops effectively we will use a more precise definition. A loop in a control-flow graph is a set of nodes S including a header node h with the following properties: . From any node in S there is a path of directed edges leading to h. . There is a path of directed edges from h to any node in S. . There is no edge from any node outside S to any node in S other than h. Thus, the dictionary definition (from Webster’s) is not the same as the technical definition. Figure 18.1 shows some loops. A loop entry node is one with some predecessor outside the loop; a loop exit node is one with a successor outside the loop. Figures 18.1c, 18.1d, and 18.1f illustrate that a loop may have multiple exits, but may have only one entry. Figures 18.1e and 18.1f contain nested loops.
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

Cpanel web hosting - Team-Fly Team-Fly EXERCISES . 17.1 Show the dataflow

Thursday, November 29th, 2007

Team-Fly Team-Fly EXERCISES . 17.1 Show the dataflow equations for reaching expressions(page 358). Be specific about what happens in the case of quadruples such as t . t . b or t . M[t], where the defined temporary also appears on the right-hand side. The elements of the gen and kill sets will be definition IDs, as in reaching definitions. Hint: If the definition on page 358 is not clear enough to formulate a precise definition, be guided by the role that reaching expressions must play in common-subexpression elimination (page 359). . 17.2 Write down the control-flow graph of basic blocks (not just statements) for Program 17.3, and show the genand killsets (for reaching definitions) of each block. . *17.3 Show how to combine the genand killeffects of two adjacent statements in the same basic block for each of: a. Available expressions. b. Liveness analysis. . **17.4 Modify the algorithm for computing available expressions to simultaneously compute reaching expressions. To make the algorithm more efficient, you may take advantage of the fact that if an expression is not available at statement s, then we do not need to know if it reaches s or not (for purposes of common-subexpression elimination). Hint: For each available expression a + b that is propagated through statement s, also propagate a set representing all the statements that define a + b and reach s. . 17.5 Consider the calculation of reaching definitionson the following program: x := 1; y := 1; if z <> 0 then x := 2 else y := 2; w := x+y . a. Draw a control-flow graph for this program. . b. Show the sorted array that results from running Algorithm 17.5 on the program. . c. Calculate reaching definitions, showing the result of each iteration in tabular format as on page 356. How many iterations are required? . *d. Prove that when reaching definitions is computed by iteration on an acyclic graph, taking the nodes in the order given by Algorithm 17.5, only one iteration is necessary (the second iteration merely verifies that nothing has changed). Hint: Prove, and make
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

Web hosting uk - alias x at 2is false; then M[t] is

Thursday, November 29th, 2007

alias x at 2is false; then M[t] is still available at line 3, and we can eliminate the common subexpression; after copy propagation, we obtain: 1 : z . M[t] 2 : M[x] . r 4 : b . z + z What we have shown here is intraprocedural alias analysis. But an interprocedural analysis would help to analyze the effect of CALL instructions. For example, in the program 1: t . fp + 12 2: u . M[t] 3: f(t) 4: w . M[t] 5: b . u + w does the function f modify M[t]? If so, then M[t] is not available at line 4. However, interprocedural alias analysis is beyond the scope of this book. ALIAS ANALYSIS IN STRICT PURE-FUNCTIONAL LANGUAGES Some languages have immutable variables that cannot change after their initialization. For example, const variables in the C language, most variables in the ML language, and all variables in PureFun- MiniJava (see Chapter 15) are immutable. Alias analysis is not needed for these variables. The purpose of alias analysis is to determine whether different statements in the program interfere, or whether one definition kills another. Though it is true that there could be many pointers to the same value, none of the pointers can cause the value to change, i.e., no immutable variable can be killed. This is a good thing for the optimizer, and also for the the programmer. The optimizer can do constant propagation and loop-invariant detection (see Chapter 18) without being bothered by aliases; and the programmer can also understand what a segment of the program is doing without the confusion and complexity introduced by stores through aliased pointers. Team-Fly Team-Fly FURTHER READING G odel [1931] proved the full employment theorem for mathematicians. Turing [1937] proved that the halting problem is undecidable, and Rice [1953] proved the full employment theorem for compiler writers, even before there were any compiler writers. Ershov [1958] developed value numbering. Allen [1969] codified many program optimizations; Allen [1970] and Cocke [1970] designed the first global dataflow analysis algorithms. Kildall [1973] first presented the fixed-point iteration method for dataflow analysis. Landi and Ryder [1992] give an algorithm for interprocedural alias analysis.
Searching for affordable and proven webhost to host and run your servlet applications? Go to Linux Web Hosting services and you will find it.

if a>b goto L1 else L2 A goto (Michigan web site)

Wednesday, November 28th, 2007

if a>b goto L1 else L2 A goto LA L : A f(a1, , an) A d : t . allocRecord(a)(A - t) . {(t, d, 0)} t . f(a1, , an) A t The initial set A0 includes the binding (FP, frame,0), where frame is the special alias class of all frame-allocated variables of the current function. We use the abbreviation t to mean the set of all tuples (t, d, k), where d, k is the alias class of any record field whose type is compatible with variable t. Cooperation from the front end in providing a “small” t for each t makes the analysis more accurate. Of course, in a typeless language, or one with type-casts, t might have to be the set of all alias classes. The set equations for alias flow analysis are and we can compute a solution by iteration in the usual way. Producing may-alias information. Finally, we say that p may-alise q at statement s if there exists d; k such that (p, d, k) . in[s] and (q, d, k) . in[s]. USING MAY-ALIAS INFORMATION Given the may-alias relation, we can treat each alias class as a “variable” in dataflow analyses such as reaching definitions and available expressions. To take available expressions as an example, we modify one line of Table 17.4, the gen and kill sets: statement s gen[s] kill[s] M[a] . b {} {M[x]| a may alise x at s} Now we can analyze the following program fragment: 1 : u . M[t] 2 : M[x] . r 3 : w . M[t] 4 : b . u + w Without alias analysis, the store instruction in line 2 would kill the availability of M[t], since we would not know whether t and x were related. But suppose alias analysis has determined that t may
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.

PROGRAM 17.9: p and q are (Web server setup) not aliases.

Wednesday, November 28th, 2007

PROGRAM 17.9: p and q are not aliases. type list = {head: int, {int *p, *q; tail: list} int h,i; varp:list:=nil p=&h; varq:list:=nil q=&i; q := list{head=0, tail=nil}; *p = 0; p := list{head=0, tail=q}; *q = 5; q.head := 5; a = *p; a := p.head } (a) MiniJava program (b) C program To catch these distinctions automatically, we will make an alias class for each point of creation. That is, for every different statement where a record is allocated (that is, for each call to malloc inC or new in Pascal or Java) we make a new alias class. Also, each different local or global variable whose address is taken is an alias class. A pointer (or call-by-reference parameter) can point to variables of more than one alias class. In the program 1 p := list {head=0, tail=nil}; 2 q := list {head=6, tail=p}; 3 if a=0 4 then p:=q; 5 p.head := 4; at line 5, q can point only to alias class 2, but p might point to alias class 1 or 2, depending on the value of a. So we must associate with each MEM node a set of alias classes, not just a single class. After line 2 we have the information p . {1}, q . {2}; out of line 4 we have p . {2}, q . {2}. But when two branches of control flow merge (in the example, we have the control edges 3 . 5 and 4 . 5) we must merge the alias class information; at line 5 we have p . {1, 2}, q . {2}. Algorithm The dataflow algorithm manipulates sets of tuples of the form (t, d, k) where t is a variable and d, k is the alias class of all instances of the kth field of a record allocated at location d. The set in[s] contains (t, d, k) if t - k might point to a record of alias class d at the beginning of statement s. This is an example of a dataflow problem where bit vectors will not work as well as a tree or hash-table representation better suited to sparse problems. Instead of using gen and kill sets, we use a transfer function: We say that if A is the alias information (set of tuples) on entry to a statement s, then trans s(A) is the alias information on exit. The transfer function is defined by Table 17.10 for the different kinds of quadruples. Table 17.10: Transfer function for alias flow analysis. Statement s transs(A) t . b (A - t) . {(t, d, k) . (b, d, k) . A} t . b + k (k is a constant) (A - t) . {(t, d, i) . (b, d, i - k) . A} t . b . c (A - t) . {(t, d, i) . (b, d, j) . A} n (c, d, k) . A} t . M[b] A t M[a] . bA
From our experience, we can recommend PHP5 Web Hosting services, if you need affordable webhost to host and run your web application.

Similarly, with call-by-reference parameters, in the program function (Web site counters)

Tuesday, November 27th, 2007

Similarly, with call-by-reference parameters, in the program function f( ref i: int, ref j: int) = (i := 5; j := 7; return i) a naive computation of reaching definitions would miss the fact that i might be the same variable as j, if f is called with f(x,x). The may-alias relation We use alias analysis, a kind of dataflow analysis, to learn about different names that may point to the same memory locations. The result of alias analysis is a may-alias relation: p may-alias q if, in some run of the program, p and q might point to the same data. As with most dataflow analyses, static (compile-time) information cannot be completely accurate, so the may-alias relation is conservative: We say that p may-alias q if we cannot prove that p is never an alias for q. ALIAS ANALYSIS BASED ON TYPES For languages with strong typing (such as Pascal, Java, ML, MiniJava) where if two variables have incompatible types they cannot possibly be names for the same memory location, we can use the type information to provide a useful may-alias relation. Also in these languages the programmer cannot explicitly make a pointer point to a local variable, and we will use that fact as well. We divide all the memory locations used by the program into disjoint sets, called alias classes. For MiniJava, here are the classes we will use: . For every frame location created by Frame.allocLocal(true), wehave a new class; . For every record field of every record type, a new class; . For every array type a, a new class. The semantic analysis phase of the compiler must compute these classes, as they involve the concept of type, of which the later phases are ignorant. Each class can be represented by a different integer. The Translate functions must label every fetch and store (that is, every MEM node in the Tree language) with its class. We will need to modify the Tree data structure, putting an aliasClass field into the MEM node. Given two MEM nodes Mi[x] and Mj[y], where i and j are the alias classes of the MEM nodes, we can say that Mi[x] may-alias Mj[y] if i = j. This works for MiniJava and Java. But it fails in the presence of call-by-reference or type casting. ALIAS ANALYSIS BASED ON FLOW Instead of, or in addition to, alias classes based on types, we can also make alias classes based on point of creation. In Program 17.9a, even though p and q are the same type, we know they point to different records. Therefore we know that a must be assigned 0; the definition q.head:=5 cannot affect a. Similarly, in Program 17.9b we know p and q cannot be aliases, so a must be 0.
In case you need quality webspace to host and run your web applications, try our personal web hosting services.

A more refined liveness analysis Therefore, we must (Crystaltech web hosting)

Tuesday, November 27th, 2007

A more refined liveness analysis Therefore, we must use a better algorithm. The solution is that at each point where a variable d is defined, we must keep track of exactly what uses it might have. Our liveness calculation will be very much like Algorithm 10.4, but it will operate on sets of uses instead of sets of variables. In fact, it is just like the reaching definitions algorithm in reverse. Let uses(v) be the set of all uses of variable v in the program. Given a statement s : a . b . c, the set live-out[s] n uses (a) contains all the uses of a that could possibly be reached by this definition. Now, when we delete a quadruple that uses some variable b, we can delete that use of b from all the live-in and live-out sets. This gives the least fixed point, as we desire. Cascades of dead code After deleting statement 3a from the program above, the incremental liveness analysis will find that statement 0 is dead code and can be deleted. Thus, incremental liveness analysis cooperates well with dead-code elimination. Other kinds of dataflow analysis can similarly be made in-cremental; sometimes, as in the case of liveness analysis, we must first refine the analysis. Team-Fly Team-Fly 17.5 ALIAS ANALYSIS The analyses we have described in this chapter consider only the values of Tree-language temporaries. Variables that escape are represented (by the front end of the compiler) in memory locations with explicit fetches and stores, and we have not tried to analyze the definitions, uses, and liveness of these variables. The problem is that a variable or memory location may have several different names, or aliases, so that it is hard to tell which statements affect which variables. Variables that can be aliases include: . variables passed as call-by-reference parameters (in Pascal, C++, Fortran); . variables whose address is taken (in C, C++); . l-value expressions that dereference pointers, such as p.x in MiniJava or *p in C; . l-value expressions that explicitly subscript arrays, such as a[i]; . and variables used in inner-nested procedures (in Pascal, MiniJava, ML). A good optimizer should optimize these variables. For example, in the program fragment p.x := 5; q.x := 7; a := p.x we might want our reaching definitions analysis to show that only one definition of p.x (namely, 5) reaches the definition of a. But the problem is that we cannot tell if one name is an alias for another. Could q point to the same record as p? If so, there are two definitions (5 and 7) that could reach a.
Searching for affordable and proven webhost to host and run your servlet applications? Go to Linux Web Hosting services and you will find it.

Web server extensions - numbering algorithm, with hidden bindings shown crossed out;

Monday, November 26th, 2007

numbering algorithm, with hidden bindings shown crossed out; (c) a view of the table as a DAG. Value numbering is an example of a single dataflow analysis that calculates the effect of cascaded optimizations: in this case, cascaded common-subexpression elimination. But the optimizer would like to perform a wide variety of transformations -especially when the loop optimizations described in the next chapter are included. It is very hard to design a single dataflow analysis capable of predicting the results of many different optimizations in combination. Instead, we use a general-purpose dataflow analyzer and a general-purpose optimizer; but when the optimizer changes the program, it must tell the analyzer what information is no longer valid. Incremental liveness analysis. For example, an incremental algorithm for liveness analysis must keep enough information so that if a statement is inserted or deleted, the liveness information can be efficiently updated. Suppose we delete this statement s : a . b . c from a flow graph on which we have live-in and live- out information for every node. The changes to the dataflow information are as follows: 1. a is no longer defined here. Therefore, if a is live-out of this node, it will now be live-in where it was not before. 2. b is no longer used here. Therefore, if b is not live-out of this node, it will no longer be live-in. We must propagate this change backwards, and do the same for c. A work-list algorithm will be useful here, since we can just add the predecessor of s to the work list and run until the work list is empty; this will often terminate quickly. Propagating change (1) does the same kind of thing that the original (non-incremental) work-list algorithm for liveness does: It makes the live-sets bigger. Thus, our proof (Exercise 10.2) that the algorithm finds a least fixed point of the liveness equations also applies to the propagation of additional liveness caused by the deletion of the definition of a. Even the proof that the liveness analysis terminates was based on the idea that any change makes things bigger, and there was an a priori limit to how big the sets could get. But change (2) makes live-sets smaller, not bigger, so naively running our original algorithm starting from the previously computed in and out sets may find a fixed point that is not a least fixed point. For example, suppose we have the following program: Liveness analysis shows that d is live-in at statements 1, 2, 3, 3a, 4, 5. But a is not live-out of statement 3a, so this statement is dead code, and we can delete it. If we then start with the previously computed dataflow information and use Algorithm 10.4 (page 206) until it reaches a fixed point, we will end up with the column Y of Table 10.7, which is not the best possible approximation of the actual liveness information.
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

Hp web site - The algorithm maintains a table T, mapping variables

Monday, November 26th, 2007

The algorithm maintains a table T, mapping variables to value numbers, and also mapping triples of the form (value number, operator, value number) to value numbers. For efficiency, T should be represented as a hash table. There is also a global number N counting how many distinct values have been seen so far. Using T and N, the value-numbering algorithm (Algorithm 17.7) scans the quadruples of a block from beginning to end. Whenever it sees an expression b + c, it looks up the value number of b and the value number of c. It then looks up hash(nb, nc, +) in T ; if found, it means that b + c repeats the work of an earlier computation; we mark b + c for deletion, and use the previously computed result. If not found, we leave b + c in the program and also enter it in the hash table. ALGORITHM 17.7: Value numbering. T . empty N . 0 for each quadruple a . b . c in the block if (b . k) . T for some k nb . k else N . N +1 nb . N put b . nb into T if (c . k) . T for some k n. k c else N . N +1 n. N c put c . nc into T if ((nb, ., nc) . m) . T for some m put a . m into T mark this quadruple a . b . c as a common subexpression else N . N +1 put (nb, ., nc) . N into T put a . N into T Figure 17.8 illustrates value numbering on a basic block: (a) is the list of quadruples, and (b) is the table (after the algorithm is finished). We can view the table as a directed acyclic graph (DAG), if we view an entry (m; , n) . q as a node q with edges to nodes m and n, as shown in Figure 17.8c. Figure 17.8: An illustration of value numbering. (a) A basic block; (b) the table created by the value
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.