1 / 24

Operation Reuse on Handheld Devices

Operation Reuse on Handheld Devices. Yonghua Ding and Zhiyuan Li For LCPC 2003. Outline. Introduction Computation reuse Branch reuse by IF-merging Conclusions. Introduction. Handheld devices have Limited processing power Limited energy resource Operation reuse Computation reuse

tierra
Download Presentation

Operation Reuse on Handheld Devices

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. Operation Reuse on Handheld Devices Yonghua Ding and Zhiyuan Li For LCPC 2003

  2. Outline • Introduction • Computation reuse • Branch reuse by IF-merging • Conclusions

  3. Introduction • Handheld devices have • Limited processing power • Limited energy resource • Operation reuse • Computation reuse • Branch reuse • Hardware solutions • Software solutions

  4. Computation Reuse • Can be viewed as an extension of CSE • Redundancy among different instances of a code segment • Code segment with repetitive inputs • A hashing table records the input values and the computed output values • Replace the computation with a table look-up if the input is in the table

  5. An Example code • Int quan(int val) { • int I; • for (i=0; i<15; i++) { • if (val < power2[i]) • break; • } • return (i); • }

  6. Transformation Code • Int quan(int val) { • int I, key • if (check_hash(val,hash_tab,&key)==0) { • for (i=0; i<15; i++) { • if ( val<power2[i] ) • break; • } • hash_tab[key].output = I; • } • else • I = hash_tab[key].output; • return (i); • }

  7. Framework of the Scheme Identify candidate code segments Data flow analysis to determine input/output Estimate hashing overhead Granularity analysis Choose code segments for value profiling Determine code segments to transform

  8. Important factors • Computation granularity ( C ) • Hashing overhead ( O ) • Hashing function complexity • The size of input/output • Reuse rate ( R ) • R = 1 – Nds/N

  9. Cost-Benefit Analysis • Cost of computation reuse • (C+O)(1-R)+O.R • The gain of computation reuse • C - (C+O)(1-R)+O.R Ξ R.C – O • Criteria to choose code segments • R.C – O > 0 or R > O/C

  10. Experimentation Setup • Compaq iPAQ 3650 PDA • 206MHZ StrongARM SA1110 processor • 32MB RAM • 16KB I-cache and 8KB D-cache • Digital multi-meter HP 3458a • 6 MediaBench programs and a GNU GO game

  11. Performance Improvement

  12. Energy Saving

  13. Performance Improvement for Different Input Files

  14. Related Work • Richardson’s result cache • Sodani and Sohi’s instruction reuse • Huang and Lilja’s basic block level reuse • Connors and Hwu’s code region level reuse

  15. Branch Reuse by IF-Merging • Motivation • Branch instructions degrade the efficiency of deep pipelining • Branches reduce the size of basic blocks • Branches introduce control dependences • Source-level code transformation

  16. An Example Code • If ( sign ) { • diff = -diff; • } • …… • If ( sign ) • valpred -= vpdiff; • Else • valpred += vpdiff;

  17. Transformation by IF-merging • If ( sign ) { • diff = -diff; • …… • valpred -= vpdiff; • } • Else { • …… • valpred += vpdiff; • }

  18. Three Schemes of IF-Merging • A basic IF-merging scheme • Merge IF statements with identical condition • An IF-condition Factoring scheme • Factor and merge common sub-predicates • A path profiling scheme • IF-merging with path profiling information

  19. A Basic IF-Merging Scheme • Symbolic analysis to identify IF statements with identical IF condition • Data dependence analysis to determine intermediate statements

  20. A Factoring Scheme • Non-identical conditions have common sub-predicates (a&&b, a&&c) • Factor the common sub-predicates to construct a common IF statement • The new IF statement encloses the original IF statements with the remaining sub-predicates as conditions

  21. A Path Profiling Scheme • Merge IF statements with high rate of alltaken • Exchange nested IF statements whose conditions are dependent

  22. Experimental Results

  23. Related Work • Kreahling et al’s profile-based condition merging • Branch prediction • Predicated execution • Muller and Whalley’s avoiding branches by code replication • Yang et al’s branch reordering

  24. Conclusions • Operation reuse techniques are desirable for both program speed and energy saving on handheld devices • Computation reuse • Branch reuse by IF-merging

More Related