0% found this document useful (0 votes)
23 views

DocScanner 23-Jun-2023 9-23 pm

The document discusses optimization techniques in computing, focusing on improving efficiency through methods like common subexpression elimination and strength reduction. It emphasizes the importance of optimizing code to enhance performance and reduce computational overhead. Various examples and strategies are provided to illustrate these optimization techniques.

Uploaded by

Sasi Balaji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
23 views

DocScanner 23-Jun-2023 9-23 pm

The document discusses optimization techniques in computing, focusing on improving efficiency through methods like common subexpression elimination and strength reduction. It emphasizes the importance of optimizing code to enhance performance and reduce computational overhead. Various examples and strategies are provided to illustrate these optimization techniques.

Uploaded by

Sasi Balaji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 29
ae ‘optimisation —S EET een BO ET et BT eet oN een et ea Semmes eer 8 Te ea oO EEA HE PROTIMING ang SEAL pee fe ees eee SS een cn ees gia oe ae He ONE SoNCTATIN Fe ENT “ape sso PEI TTT chang sen ISIE tg ay S Se St SiS oe Sem SS Be ST Se wr drag poe ee EEE TIN Soe eae SS] — eee ee . (=a) oe uve depen optiizaon i Beaton oot Te ta cca recent oe ange eae geet i ees hor Uo man smite Hones 1 Ae ee oe eh ten se ea Se erence Soa SSIS Sag SNS ES reese a oo a = mprove the efficiency of target, nes ea {Si ere per tnaompn a unc et [tee of ash Sine omputig Seep eae ems aoe Saleen Se Aang er - SYM de ee Re ee sve Ne { sgpemang seriee Sa so mp mate een ti | so “Sera the lea traalormatons se ope st eS at te ne no ee arin soe nat rH ~~ san Tang or common Py EEE connie Tine evtnton eee Sas eee = eee eas oe “a ne in fel of ach sub expres os or example seein ey in ran e ‘ws instead of computing it “Smputed preveuly. Then the oper te all ately D tam Mls ta lod geal bm = oy ‘The common fb exproion t= 1 mite a computation aed yond vue of sot een hanged om done tana pi io i at of ite om ESE copy Propaaaties eve of ee EADIE MISA Of any, tn set) ‘ante prom oe ores! ati oe tae con be optinized by em Tote nt 5 psn Sees we me resto a lg mr fc oN amas eas Saar aia EEE cute novonet Ly : Fa eres te trata Ne Pa compe = — or esate: = mre “strength Reduction poy rate “| gs fs ns test f rah PTO higher hin alles Fi nance sh of * rs se Mae eng on we age eh Sern se es I ow enh ener y feeceeoriLE OLE i a ES : ba t E- | TR Ty Bee Ros fF ceo cone Fam one Kop The hs “ati » rs se 2. Ini athe el sere 41109 wing, Pes cei cer sec eet Wt te ely expe HEKE ond Code finan oe tecnique hich te he ce te he ep ten Jaton ees Inthe hep hve oat renee ert chp ee on several te, hen ih a i oa fe ed po le ae The hep) Heve bln the hp ry tthe nia ze C umeuum a oO scan be opie hy emeving he epi of Mat ei te ie : a th evi as sat ant ot sea est se ——Leteeotn : sates see a east ees a roe example : SUES OT TG by heer strength operseOn, pagher Senses ore gg | ‘For example: x oe Lio ESI | fo tre we Get woe g rrength reduction se fol it 100) vem sing neh cto ets ait comma, EO € aui=bik Sea ail=bu: Tn code con Be replaced BY ie ea tusion or L29p Jamming — post sso nent of rutiplcaton by atonal 5p th objet a va on meester ops aed ee The reaceent of moat changing the Mesing ofa ene Tg Pe eamples soon a persion re SE are wis not applied tthe Noating point is not apr Me Bese a 2 np nt mee engin he le ny _ i ete mas id te rw gah an Myr ne orien compo esos For example oH esos 10 0 Donia costo Te bop ea et % res wiegesm ee a i er) P00 = i ghey Cnc ents AaB TE % oe 00 = opie hess cate ing rs epiiaton tings eee 3 goto 2 sw ving common subexpression elimination we an epic sre ade. Aer Pe ya usendiiee) Chit eo +8 U1 61 Be } Seton ne ad ame AYN Hee) Fray eer 3072 i saemlte =a vee cpm is cde we need to fener row code fo een “Py neeusi eso os a 2] ie el ae et eee sata pees felt gious ices piel Soren Scion == characteris The poole re 2. alse ii a ee aT annem IES a cast Soman sll role oe mats AREY apo no ee Ss - Progra, Me So SEInE capac ae proem n arene SOUR, | ro Peete Otneton a one by one. Meat SE ON NN a east) ‘SES, unmade bean oe eect ‘2 pt onion my ay as ca ree ec oe mp By the andra, ae a itm] > |i pane i sensm| =D faomne Zoe temictoes os aioe Sees nae yj = Th ae in the bai eh pase feet rs are cheaper than cern mach me a EN ag Th a i te Sera ere deme fn say ae |" cea me ep od ns ne stots FF Om an ond vino. Swe ea ee te nt ne ger tam mi su Sty way ae eae} ran eapcaon and dete“ ee i as Calne aaa 5. machine iors “Te tog inrt ‘pgaritm for Paritloning Into Blocks pertinence wre the icity: For example, ie a lr a a | errmsg) Mee nen wing ing ict operation eit saterent kad 6 tt ste fee nro in ner (0) Any. stare acre pin en pot toe tt ined follow 2 2. alam tnt a arise wa By) fre beck Src eating of te nr se ste Bloch | TRS pout Beader tome APPS pa ee fo epg rit ie back > ee: ST th en whout al or pena | z alt of pemy (EE core er Do ib ate ' Detinit re ce tet ck nsw Bas care | ‘ a tt (aw +a for ae Z ae ean ae ee cory coor oration mt ree YY {a compmtin fate 22 ft compton + eat mise Bw tert goto rth we gap bi 2 el Hos = et FS Seca oom ee TTS TEST eS = 1 goto Fe FA Bele Hocts Ken Xs Pana vue nave epecod he goto cobin by men ses ane seo eat tne one stom ete a rs toca! OPtnienion ‘atoms aS “on Fett IE oy a4 Oe eo Vie os — cm I ‘ al UP” pe ONG 10tcenitn a Lee gy rein: hig f, Spee (122) «converted Ino equivalent 3. pend =20*/ 8 Jae = 887 forthe ven code egret wt gto f BAG 2 tt, Basie Block Be giaeee Ot ae Sie a Fe at Sam Be const (fn EE ow wy th inning, and Wuence 2 / vo tne beginning eaves at iy. Mar ce at ne OF optimizations thay ct en sing tions asc ght or tag ys Pe tents a rcs ert eh aga sea transformation, 3 de ‘0 ae are eservINg. Eaneformating . = Seo ees SUCH AS commen ons SM be Fio.7.88 one i se tection, code Movement, dent rr (SERED Hits rps te owing io age Dag» 4 Sr one as ; dco Sn Po, sas re mesenger ta Seton The DAG can be en Ee constructed Tat gg OMC bea ~ 1 heb fons can be applied etl nN fo vabesprestion can be eux a Det /> on deca by < Le craig bo ete og OLAS ete EERE comic 46 fr ating se wae ae stoning of common sb expression) 8 % fig, 174 DAG fo ientsng COMO 8 peo, rately mand gate te ame, The DAG conse and the expressions that are For us the common sub expressions TEAS hat ate guaran ub errata metod fr opinion i elect e ‘ode from the DAG that hs no anton common expressions canbe identified, compute the same value ead code elimination. We can delete aY ‘This results in dead code elimination 2.ae of alba lees ge ees are wed in pepo epimiaon eis, Ako ang Spt taafrmatons can be appli in ode to optimize the code For example: as0za alee afiza “Ths comespndingientis canbe applied on corresponding algebraic express [Tec PRETO An bee ene cena tv0cOMEN SU OLSON s ganeormation can by bingy a weeaN USCA + 9, wget ‘ Ae, we 18305 Care mi wy é et strength OPEL nsteg folding. technique can s Hood of wing a= 2 computations ion Su expesong oe . bent ei rn u jy 8127 Hag 7 Seti, $6 80 consider # Hock crit oe BM lat weed i ee a = red Byte, Ziemann ft i of gtt ‘tn ¢ in Flow Graphs Ey troduced with some comman feminalois bi Iie being sed ke ops in fw go yor ie jow graph, a node d domins ors: In a HOW BF Hes if ey path oa ei trough d only. This can 254 segs tough | ony. be denoted asd do 9 Bt ae re RL Aer oe eee en he ew SSSI Tag esieaimine Ter eumete toe grag an hon in 7 Soe ea oe aa omits ery ee done 3a to en SRRAITUIRY Sin cemtet ese Soa te ey ph BRST AIEN TESLA ine ots ne 2 peneercereritcn . Se tmnt ge Teo ht we ERE Rte one at 1568 whet not though SERENADE ta game ae 5 there another path 129 a Oe Speck (howe 4 deus 2 nade aeabars mo a 2 ge SLO Goede & » SSE Ng tect & a oS ‘Ye tal ap sa he ee by a hash em 1 tue ig al the yates of ne we eat © d a o } 9.78 Flo gro ot ane > 0 ewe ert er won #42 SS ny. i Toop that coma no other top, eit “ace 8 2 nowblok crated sch that acon of G Sr ck Al be ene oot hie ne Se tae ir era te horn a om ee we as a. see eiveble gE 1S a ow tm chic ete ae 80 Hs of earl eges and bak s e eiges ave flow se he ne oes “Pane forward edge frm an aye gap the baek cag ate shee he a domi heii ie 785 Petar ‘hs How graph is luce a sow in Fg 86, We can rice this gar by semi bak ge fr 32g Sly y emo he bach om 8 Toe ca rede the above fw gph Aa! i ln ph ee en “eprom ste fn whch te ie we of Man, ie OF go ance erat 3 Nae yt wh aay alte o oy Foe the to ‘Neer ta 51m a flow raph masks 'W domninat pede aes threnigh “a node (Block) unlye SY PAN 9 nade eam Every node (Mock) dominates Heel U1 = As itis an ital nade i dominates al the nade 02 = 13, 14, 85, Ne, 7, WH, LW, 10, BI a = 5, 07, 1s = 7, ns 186 «= Dominates uel bocative there exe another path alo to goto other remaining, nodes ponies i Finis alt “oni Pits HH tag, ” ne spn 10 bats ma yt nee #2 a gsm prod Al Bi ho = 20 2 wes He ae ae, we aden Senet sear = etl Ssaat ea A Ko HS the wounen y vamp wang 0a te FES] Ty) Taran +The common shespenion, Inp-inin apm care the mots taney ae Dearne tox understencina } oma Concer fing raga Sage 0-0) | um = aa taorean t ‘ eure su Jape i \ vaya of How ara aS so 618 UNION Gg Te, he tu gots 1 oy i A HN AN OPE sg ns, aval st 1 Any expen Ane aon capa Nan oa lata th Mpeg A ay oa > joe a stat am ae ith lala th pay sae ane a Sw a rat a air nnn ont th ail mite a ttl pons 1 ah af 2 iar oven melon? Ds EKESE Date Flow Propertloe tate Hw per ata fh pe he fii scale! dei i efilton pol, vic cider some Fas re docs ean wile ging ed ga ol os lexi ty oA Ayn in a i ese #8 HE ay fet 7 ua pint a sich ae eH AEN IS ey oly | Lata naan (RTE) Ere ~ = tv Fp. 1.11 Page pots eoasion A ep wy fanaa ‘eae ug ibe a pga pt ad o yin ei 7 hae ep rerwo a eaae 1 i in ig ie a st ta sgh uth fn ie a" Teale Case Cae ip 182 ve expen for 2 8 lek for apres 8 aetisthe an BH besa 8 te expres yay ofthe ques at ee ca advantage of avail exesion eth we of ite rien 2, Reaching sions iat ven bees caren arias 0 etl FST aati vere wel Fe den cde einai Oe acemen See EAE Z A gg TUES Drcasente eked hen Shere & mefiion of eeu acemage of reaching Seteion snr won me a ere ea nee Ee eens gone toe sis oe ay seis a Ae ov a ee os aire Pees nah st en nb rer a = 7 = “= sal= eS) ee aa seas {BEDI Emicient Dats Few Aportine a +E De ee [EETE Recundas Connon Stearn Se? Bea pt Allow Baph emtain vt Eileen ‘B08 BRPR Sd ae onsen ye SES a eat pei and Oe Soult re ee Coes pDeemibe fe Sime nse oe fromm efirition of x. SS rs wed 7 eeiect 5) Is ass te : “i x fod in by : For example: cheeneageey, emmsrene, ery oe it, gee we : error then, ‘Soce wis ft ard xi ot ared alg the pth fem i defen ee i replace xy ted th eliza he copy sneer na ee a fo into of ction ve, et anion of induction varies, eater sth reaching dtion ifrmatn,p invart 2.08 aon ad ive varable information ert geaph without Icon variable, ction vibe wh I Coir es fm < Be B where | a Induct are ands ot nid sve ner eet inactan Waren vate a 007 Le tn rete FE te SEE ag | a oe ang oe nD evoomele: for op or 12214010 i ni wy aul signent fo he lint incon val an dete a vale st fall We ROWE 10 identity 9 sly deduction variables will Be useless ables fom the loop L Sanne i rte sans omen towing ome gies yn we 7 i . ee er a Sas eee Seen the ae Fw ee earn faa Pe te tap by ‘| = sas ve AS Tore he te fore Soon Rm Angee te lle ty tht eat 82 _ ont vy = ale ea) weten Wi ean Cor Ly ty Comat flow graph: Tor the ote (0 The towing ps ae i) Compl sri ii) Lecet common subexpression etinination (CSE) (10) Imtarlant cote motion (6) Reduction in strength: idee CEE, Frat an "eC PEAT ane ee ee ‘Local comman subexpression elimination: = ai (i) <4 an ed" 1 are common subexpression Ut i SUES ore lig pang in, rt tn id [are] ee eine ee ad eg s | isto os oe yw graph can be built as. er Lome _ o conser the ling bse Hk. Dr he DAG rion fe Ha SE tal onmon ih cei Einar he nm re re oe ee ck, Asse hat nn f te poy csi Sw 5 a> 21511 ge = 5564) prop = 58 r=. asia r= 20070? ronue SIRT fin he ft ty of anton pin it Ming ah ett dal oe imine Of rr ows Fag ID ah sig ae tintin no ean Me

You might also like