





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A part of lecture 30 in module 15 of 'reaching definition' in multi-core architecture. It covers various techniques for static program analysis, including interval analysis, live variable analysis, and common sub-expression elimination. These techniques help in optimizing code by identifying redundant expressions, dead code, and live variables.
Typology: Slides
1 / 9
This page cannot be seen from the preview
Don't miss anything!
For block
For the while loop
Interval analysis is trivial; it is identical to structural analysis. Only three kinds of regions appear: general acyclic, proper, and improper.
Harder to model as single exit is not guaranteed in programs For constructs with single exit we can ’turn the equations around’
U is the universal set of all expressions appearing in a program In[B] and out[B] are sets of expressions available at the beginning/end of B E-gen[B] and e-kill[B] are sets of expressions generated and killed in B Out[B] = in[B] - e-kill[B] e-gen[B] In[B] = out[P] for B not initial In[B] = where B 0 is the initial block Initialization: In[B 0 ] = Out[B 0 ] = e-gen[B 0 ] Out[B] = U - e-kill[B] if B is not an entry block
Used for dead code elimination In[B] and out[B] are sets of live variables at entry and exit Def[B] set of variables assigned value in B prior to use in B Use[B] set of variables whose value may be used before definition in B In[B] = use[B] S (out[B] - def[B]) Out[B] = S in[S] where S is successor of B A variable is live coming into a block if EITHER is it used in the block before re-definition OR it is live coming out and not re-defined A variable is live coming out of a block if it is live coming into one of its successors Initialization: in[B]= for all B
In[B] and Out[B] are sets of VBE at the beginning and end of B Use[B] set of expressions b+c computed in B with no prior definition of b or c Def[B] set of expression b+c for which either b or c is defined in block B prior to computation of b+c In[B] = out[B] - def[B] use[B]
out[B] = in[S] where S is successor of B An expression is VBE coming into a block if either it is used in B or it is live coming out and not defined in B An expression is VBE coming out of a block if it is live going into all the successors of B Initialization: in[B] = U for all B
For every statement s of the form x=y+z such that y+z is available at the beginning of the block and y and z are not re-defined prior to s
A variable X is called induction variable of a loop if in every iteration value of X is changed by a constant value. Basic induction variables: as defined i=i ± c Secondary induction variable: a basic function of basic induction variable
Input: A loop L with reaching definition information and loop invariant computation information Output: A set of induction variables. Associated with each induction variable j is a triple (i, c, d) such that j=c*i+d. i is assumed to be basic induction variable, and j is said to belong to family of i.
Consider each basic induction variable. For every induction variable j in family of i with triple (i, c, d)
No definitions of B or C. Is B+C available at E := B+C depends whether *P changes B or C
Safe Assumption : Indirect assignment can change any variable, indirect use can use any name Therefore,
More live variable and reaching definitions than realistic. Fewer available expressions than realistic