Operation Reuse on Handheld Devices

  • View
    22

  • Download
    2

Embed Size (px)

DESCRIPTION

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 - PowerPoint PPT Presentation

Text of Operation Reuse on Handheld Devices

  • Operation Reuse on Handheld DevicesYonghua Ding and Zhiyuan Li

    For LCPC 2003

  • OutlineIntroductionComputation reuseBranch reuse by IF-mergingConclusions

  • IntroductionHandheld devices haveLimited processing powerLimited energy resourceOperation reuseComputation reuseBranch reuseHardware solutionsSoftware solutions

  • Computation ReuseCan be viewed as an extension of CSERedundancy among different instances of a code segmentCode segment with repetitive inputsA hashing table records the input values and the computed output valuesReplace the computation with a table look-up if the input is in the table

  • An Example codeInt quan(int val) { int I; for (i=0; i
  • Transformation CodeInt quan(int val) { int I, key if (check_hash(val,hash_tab,&key)==0) { for (i=0; i
  • Framework of the SchemeIdentify candidate code segmentsData flow analysis to determine input/outputEstimate hashing overheadGranularity analysisChoose code segments for value profilingDetermine code segments to transform

  • Important factorsComputation granularity ( C )Hashing overhead ( O )Hashing function complexityThe size of input/outputReuse rate ( R )R = 1 Nds/N

  • Cost-Benefit AnalysisCost of computation reuse (C+O)(1-R)+O.RThe gain of computation reuse C - (C+O)(1-R)+O.R R.C OCriteria to choose code segments R.C O > 0 or R > O/C

  • Experimentation SetupCompaq iPAQ 3650 PDA206MHZ StrongARM SA1110 processor32MB RAM16KB I-cache and 8KB D-cacheDigital multi-meter HP 3458a6 MediaBench programs and a GNU GO game

  • Performance Improvement

  • Energy Saving

  • Performance Improvement for Different Input Files

  • Related WorkRichardsons result cacheSodani and Sohis instruction reuseHuang and Liljas basic block level reuseConnors and Hwus code region level reuse

  • Branch Reuse by IF-MergingMotivationBranch instructions degrade the efficiency of deep pipeliningBranches reduce the size of basic blocksBranches introduce control dependencesSource-level code transformation

  • An Example CodeIf ( sign ) { diff = -diff;}If ( sign ) valpred -= vpdiff;Else valpred += vpdiff;

  • Transformation by IF-mergingIf ( sign ) { diff = -diff; valpred -= vpdiff;}Else { valpred += vpdiff;}

  • Three Schemes of IF-MergingA basic IF-merging schemeMerge IF statements with identical conditionAn IF-condition Factoring schemeFactor and merge common sub-predicatesA path profiling schemeIF-merging with path profiling information

  • A Basic IF-Merging SchemeSymbolic analysis to identify IF statements with identical IF conditionData dependence analysis to determine intermediate statements

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

  • A Path Profiling SchemeMerge IF statements with high rate of all taken Exchange nested IF statements whose conditions are dependent

  • Experimental Results

  • Related WorkKreahling et als profile-based condition mergingBranch predictionPredicated executionMuller and Whalleys avoiding branches by code replicationYang et als branch reordering

  • ConclusionsOperation reuse techniques are desirable for both program speed and energy saving on handheld devicesComputation reuseBranch reuse by IF-merging