1 / 8

DAG and Peep hole optimization

DAG and Peep hole optimization. G Shravan Kumar Reddy 04cs3023. Issues of optimization 1) Breaking into basic blocks. 2) Within block (Normalization optimization) 3) Among blocks. Things to consider for Normalization optimization 1) Temporary variable minimization.

hide
Télécharger la présentation

DAG and Peep hole optimization

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DAGandPeep hole optimization G Shravan Kumar Reddy 04cs3023

  2. Issues of optimization 1)Breaking into basic blocks. 2)Within block (Normalization optimization) 3)Among blocks.

  3. Things to consider for Normalization optimization 1)Temporary variable minimization. 2)Common sub-expression identification. 3)Which are the basic variables that are used in basic block but come from outside. 4)Which are the variables that have been updated in current basic block.

  4. .Using DAG to get the above information Example: t1 = 4 * I t2 = a [ t1] t3=4 * I t4 = b [ t3]  t5 = t2 * t4 t6 = prod + t5 t7 = I + 1 I = t7 If I <= 20 goto 1

  5. nleaves are variables coming from outside. nCommon sub-expressions are identified. nAll variables appeared in node other than leaves are the variables updated here. Additional info – equivalence of variables , which expressions are live can also be known.

  6. Peep hole optimization See small part of code at a time and fix easy “ BUGS ” 1) MOV R0 , a 2) goto L2   MOV a , R0 L2 : goto L3 3)X = X + 0 X = X * 1

  7. END

More Related