Similar documents
Model-driven Reengineering for a Blue Planet - Refactoring for Energy Efficiency -

EXPLORING THE PROCESS OF ASSESSMENT AND OTHER RELATED CONCEPTS

Record of Revisions to Patient Tracking Spreadsheet Template

CSE 331, Spring 2000

HIS Registry of Ministry Resources

How to become an AME Online

Breast Cancer Awareness Month 2018 Key Messages (as of June 6, 2018)

Code of employment practice on infant feeding

FUNCTIONAL MOVEMENT SYSTEMS SCREEN FINDINGS REPORT

(Please text me on once you have submitted your request online and the cell number you used)

The principles of evidence-based medicine

A foot x-ray series is required only if there is pain in the midfoot zone and any one of the following:

Q 5: Is relaxation training better (more effective than/as safe as) than treatment as usual in adults with depressive episode/disorder?

P02-03 CALA Program Description Proficiency Testing Policy for Accreditation Revision 1.9 July 26, 2017

University College Hospital. Pump school Starting on an insulin pump. Children and Young People s Diabetes Service

FOUNDATIONS OF DECISION-MAKING...

BROCKTON AREA MULTI-SERVICES, INC. MEDICAL PROCEDURE GUIDE. Date(s) Reviewed/Revised:

Building Code 101 OWMC November 20, Ministry of Municipal Affairs and Housing

A Phase I Study of CEP-701 in Patients with Refractory Neuroblastoma NANT (01-03) A New Approaches to Neuroblastoma Therapy (NANT) treatment protocol.

Candida March, Ines Smyth, and Maitrayee Mukhopadhyay, 1999, A Guide to Gender-Analysis Frameworks, London: Oxfam Publishing.

MGPR Training Courses Guide

Structured Assessment using Multiple Patient. Scenarios (StAMPS) Exam Information

Implementation of G6PD testing and radical cure in P. vivax endemic countries: considerations

The Mental Capacity Act 2005; a short guide for the carers and relatives of those who may need support. Ian Burgess MCA Lead 13 February 2017

NATIONAL SENIOR CERTIFICATE GRADE 12

Commun. Theor. Phys. (Beijing, China) 38 (2002) pp. 555{560 c International Academic Publishers Vol. 38, No. 5, November 15, 2002 Capability Analysis

CONSENT FOR KYBELLA INJECTABLE FAT REDUCTION

2017 CMS Web Interface

AP Biology Lab 12: Introduction to the Scientific Method and Animal Behavior

1.11 INSULIN INFUSION PUMP MANAGEMENT INPATIENT

Data Fusion for Predicting Breast Cancer Survival

Extended G/L Segment Codes

SCALES NW HEARING PROTECTION PROGRAM

Success Criteria: Extend your thinking:

Module 3. Chapter 5 Microbial Metabolism. Catabolic and Anabolic Reactions Metabolism Two general types of metabolic reactions: o :

Career Confidence. by Kevin Gaw

2017 CMS Web Interface

Appendix C. Master of Public Health. Practicum Guidelines

2016 CWA Political Action Fund Administrative Procedures Checklist

TABLE OF CONTENTS Glossary of terms Code Pad Diagram 3. Understanding the Code Pad lights.4.

Intended Use KontrolFlex Endodontic Rotary Files fit into a dental handpiece allowing the user to perform root canal debridement.

Instruction Manual IC ACCESS CONTROL

Benefits for Anesthesia Services for the CSHCN Services Program to Change Effective for dates of service on or after July 1, 2008, benefit criteria

The estimator, X, is unbiased and, if one assumes that the variance of X7 is constant from week to week, then the variance of X7 is given by

Bariatric Surgery FAQs for Employees in the GRMC Group Health Plan

Lee County Florida Income Guideline Chart

Seeking and Appraising Evidence

Swindon Joint Strategic Needs Assessment Bulletin

US Public Health Service Clinical Practice Guidelines for PrEP

BRCA1 and BRCA2 Mutations

Getting Started. Learning Guide. with Continuous Glucose Monitoring for the MiniMed 530G with Enlite. CGM Foundations

Service Change Process. Gateway 1 High-level Proposition. Innovation project name: Patient Self-Monitoring/Management of Warfarin

Assessment Field Activity Collaborative Assessment, Planning, and Support: Safety and Risk in Teams

NHAIS SIS Communication

UNIT 6. DEVELOPING THREAT/HAZARD-SPECIFIC ANNEXES

Meaningful Use Roadmap Stage Edition Eligible Hospitals

ACRIN 6666 Screening Breast US Follow-up Assessment Form

2019 Canada Winter Games Team NT Female Hockey Selection Camp August 16-19, 2018

Continuous Quality Improvement: Treatment Record Reviews. Third Thursday Provider Call (August 20, 2015) Wendy Bowlin, QM Administrator

Multi-effects Prostate Therapeutic Apparatus. Product Description:

CRANIOFACIAL RESECTION

EMC believes the information in this publication is accurate as of its publication date. The information is subject to change without notice.

Specifically, on page 12 of the current evicore draft, we find the statement:

Using the RC View DAT App

EXECUTIVE SUMMARY INNOVATION IS THE KEY TO CHANGING THE PARADIGM FOR THE TREATMENT OF PAIN AND ADDICTION TO CREATE AN AMERICA FREE OF OPIOID ADDICTION

Corporate Governance Code for Funds: What Will it Mean?

PROCEDURAL SAFEGUARDS NOTICE PARENTAL RIGHTS FOR PRIVATE SCHOOL SPECIAL EDUCATION STUDENTS

SUFFOLK COUNTY COUNCIL. Anti- Social Behaviour Act Penalty Notice. Code of conduct

Creating and Linking Charge Objects

BIOLOGY 101. CHAPTER 13: Meiosis and Sexual Life Cycles: Variations on a Theme

Reliability and Validity Plan 2017

EDPS 475: Instructional Objectives for Midterm Exam Behaviorism

2017 PEPFAR Data and Systems Applied Learning Summit Day 2: MER Analytics/Available Visualizations, Clinical Cascade Breakout Session TB/HIV EXERCISE

Field Epidemiology Training Program

William Paterson University College of Science and Health DEPARTMENT OF PUBLIC HEALTH HealthyU Syllabus

Making Medicare + Medi-Cal Work for California s Dual Eligibles

2. What is SO 2? 3. The World Health Organization states that air pollution.

Statement of Work for Linked Data Consulting Services

Podcast Transcript Title: Common Miscoding of LARC Services Impacting Revenue Speaker Name: Ann Finn Duration: 00:16:10

Lower Extremity Amputation (LEA) Considerations / Issues

Annual Principal Investigator Worksheet About Local Context

Percutaneous Nephrolithotomy (PCNL)

Frequently Asked Questions: IS RT-Q-PCR Testing

Name: Anchana Ganesh Age: 21 years Home Town: Chennai, Tamil Nadu Degree: B.Com. Profilometer Score. Profilometer Graph

A pre-conference should include the following: an introduction, a discussion based on the review of lesson materials, and a summary of next steps.

Organization: ANNE ARUNDEL MEDICAL CENTER Solution Title; REDUCTION OF STEMI DOOR TO BALLOON TIME: A COLLABORATIVE EFFORT!

19 th INTERNATIONAL CONGRESS ON ACOUSTICS MADRID, 2-7 SEPTEMBER 2007 NARROW TUBES ACOUSTIC IMPEDANCE CHARACTERIZATION USING FINITE ELEMENT BASED TOOLS

2017 Optum, Inc. All rights reserved BH1124_112017

Initial Postoperative Knee Care Patella or Quadriceps Tendon Repairs: - Videos are available on Dr. Witty s website: drjeffreywitty.

CLINICAL MEDICAL POLICY

Before Your Visit: Mohs Skin Cancer Surgery

2017 CMS Web Interface

Execu/Suite QuickBooks Interface

Community Health Worker / Certified Recovery Specialist Training Application

Module 6: Goal Setting

Code Clone Analysis Environment for Software Maintenance

DATA RELEASE: UPDATED PRELIMINARY ANALYSIS ON 2016 HEALTH & LIFESTYLE SURVEY ELECTRONIC CIGARETTE QUESTIONS

2017 CMS Web Interface

Food Stamp Program Pandemic Flu Planning

Human papillomavirus (HPV) refers to a group of more than 150 related viruses.

Transcription:

Cnsideratin fr Optimizatin: Optimizatin is a prgram transfrmatin technique, which tries t imprve the cde by making it cnsume fewer resurces (i.e. CPU, Memry) and deliver high speed. In ptimizatin, high-level general prgramming cnstructs are replaced by very efficient lw-level prgramming cdes. A cde ptimizing prcess must fllw the three rules given belw: The utput cde must nt, in any way, change the meaning f the prgram. Optimizatin shuld increase the speed f the prgram and if pssible, the prgram shuld demand less number f resurces. Optimizatin shuld itself be fast and shuld nt delay the verall cmpiling prcess. Optimizatin can be categrized bradly int tw types: machine independent and machine dependent. Machine-Independent Optimizatin Intermediate cde generatin prcess intrduces many inefficiencies: Extra cpies f variables, using variables instead f cnstants, repeated evaluatin f expressins, etc. Cde ptimizatin remves such inefficiencies and imprves cde. Imprvement may be time, space, r pwer cnsumptin. It changes the structure f prgrams, smetimes f beynd recgnitin. Inlines functins, unrlls lps, eliminates sme prgrammer-defined variables, etc. Cde ptimizatin cnsists f a bunch f heuristics and percentage f imprvement depends n prgrams (may be zer als) Machine-dependent Optimizatin www.sakshieducatin.cm Machine-dependent ptimizatin is dne after the target cde has been generated and when the cde is transfrmed accrding t the target machine architecture. It invlves CPU registers and may have abslute memry references rather than relative references. Machinedependent ptimizers put effrts t take maximum advantage f memry hierarchy. www.sakshieducatin.cm Basic Blcks www.sakshieducatin.cm

Surce cdes generally have a number f instructins, which are always executed in sequence and are cnsidered as the basic blcks f the cde. These basic blcks d nt have any jump statements amng them, i.e., when the first instructin is executed, all the instructins in the same basic blck will be executed in their sequence f appearance withut lsing the flw cntrl f the prgram. A prgram can have varius cnstructs as basic blcks, like IF-THEN-ELSE, SWITCH- CASE cnditinal statements and lps such as DO-WHILE, FOR, and REPEAT-UNTIL, etc. Basic Blck Identificatin: We may use the fllwing algrithm t find the basic blcks in a prgram: Search header statements f all the basic blcks frm where a basic blck starts: First statement f a prgram. Statements that are target f any branch (cnditinal/uncnditinal). Statements that fllw any branch statement. Header statements and the statements fllwing them frm a basic blck. A basic blck des nt include any header statement f any ther basic blck. Basic blcks are imprtant cncepts frm bth cde generatin and ptimizatin pint f view. www.sakshieducatin.cm www.sakshieducatin.cm www.sakshieducatin.cm

www.sakshieducatin.cm Basic blcks play an imprtant rle in identifying variables, which are being used mre than nce in a single basic blck. If any variable is being used mre than nce, the register memry allcated t that variable need nt be emptied unless the blck finishes executin. Cntrl Flw Graph Basic blcks in a prgram can be represented by means f cntrl flw graphs. A cntrl flw graph depicts hw the prgram cntrl is being passed amng the blcks. It is a useful tl that helps in ptimizatin by help lcating any unwanted lps in the prgram. Lcal Optimizatin: Optimizatins perfrmed exclusively within a basic blck are called "lcal ptimizatins". These are typically the easiest t perfrm since we d nt cnsider any cntrl flw infrmatin; we just wrk with the statements within the blck. Many f the lcal www.sakshieducatin.cm ptimizatins we will discuss have crrespnding glbal ptimizatins that perate n the same principle, but require additinal analysis t perfrm. Lp Optimizatin Mst prgrams run as a lp in the system. It becmes necessary t ptimize the lps in rder t save CPU cycles and memry. Lps can be ptimized by the fllwing techniques: www.sakshieducatin.cm

Invariant cde: A fragment f cde that resides in the lp and cmputes the same value at each iteratin is called a lp-invariant cde. This cde can be mved ut f the lp by saving it t be cmputed nly nce, rather than with each iteratin. Inductin analysis: A variable is called an inductin variable if its value is altered within the lp by a lp-invariant value. Strength reductin: There are expressins that cnsume mre CPU cycles, time, and memry. These expressins shuld be replaced with cheaper expressins withut cmprmising the utput f expressin. Fr example, multiplicatin (x * 2) is expensive in terms f CPU cycles than (x << 1) and yields the same result. Dead-cde Eliminatin Dead cde is ne r mre than ne cde statements, which are: Either never executed r unreachable, Or if executed, their utput is never used. Thus, dead cde plays n rle in any prgram peratin and therefre it can simply be eliminated. Partially dead cde There are sme cde statements whse cmputed values are used nly under certain circumstances, i.e., smetimes the values are used and smetimes they are nt. Such cdes are knwn as partially dead-cde. www.sakshieducatin.cm www.sakshieducatin.cm The abve cntrl flw graph depicts a chunk f prgram where variable a is used t assign the utput f expressin x * y. Let us assume that the value assigned t a is never used inside the lp. Immediately after the cntrl leaves the lp, a is assigned the value f variable z, which wuld be used later in the prgram. We cnclude here that the assignment cde f a is never used anywhere, therefre it is eligible t be eliminated. www.sakshieducatin.cm

www.sakshieducatin.cm Likewise, the picture abve depicts that the cnditinal statement is always false, implying that the cde, written in true case, will never be executed, hence it can be remved. Partial Redundancy Redundant expressins are cmputed mre than nce in parallel path, withut any change in perands whereas partial-redundant expressins are cmputed mre than nce in a path, withut any change in perands. Fr example, www.sakshieducatin.cm [redundant expressin] [partially redundant expressin] Lp-invariant cde is partially redundant and can be eliminated by using a cde-mtin technique. Anther example f a partially redundant cde can be: www.sakshieducatin.cm

If (cnditin) a = y OP z; else c = y OP z; We assume that the values f perands (y and z) are nt changed frm assignment f variable a t variable c. Here, if the cnditin statement is true, then y OP z is cmputed twice, therwise nce. Cde mtin can be used t eliminate this redundancy, as shwn belw: If (cnditin) else tmp = y OP z; a = tmp; tmp = y OP z; c = tmp; www.sakshieducatin.cm Here, whether the cnditin is true r false; y OP z shuld be cmputed nly nce. Directed Acyclic Graph Directed Acyclic Graph (DAG) is a tl that depicts the structure f basic blcks, helps t see the flw f values flwing amng the basic blcks, and ffers ptimizatin t. DAG prvides easy transfrmatin n basic blcks. DAG can be understd here: Leaf ndes represent identifiers, names r cnstants. www.sakshieducatin.cm www.sakshieducatin.cm

Interir ndes represent peratrs. Interir ndes als represent the results f expressins r the identifiers/name where the values are t be stred r assigned. Example: t 0 = a + b t 1 = t 0 + c d = t 0 + t 1 [t 0 = a + b] www.sakshieducatin.cm [t 1 = t 0 + c] [d = t 0 + t 1 ] www.sakshieducatin.cm www.sakshieducatin.cm