[go: up one dir, main page]

0% found this document useful (0 votes)
25 views10 pages

LP Assignment

LP important questions

Uploaded by

Adhi Sheshu
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)
25 views10 pages

LP Assignment

LP important questions

Uploaded by

Adhi Sheshu
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/ 10
Kang uage Proceors A signment B brat ou thou addun codu? Explain the differnt oupswruntoctions of the thie adder cod. Three addus code (TAC) u an intermediate supsumutation vsed in compilou cluring eptinisatin. Jt reales devon comp la exprussiows inte Atinplin Fnatyricliont pith at most thee operands awd ens eperatoy. Sh thu addusn cools! 7 Eade inutruction suepourinl an omiqnuuit wo spenatibn - Pt una tempovany vardalla qeutratecl ny tha compilin fo sine intermediate susulle - a > This rinepilifier cools an abycit oud eptnutabion for compiler. Thaw on motidy hop ways to supruut TAC instructions | > Suacloupls This format wr the folloring few fields ° opi The operator C4, =, m, ete) © eng t The finet operand (cam be a varinbl wi a conitaut) ° ang> > The Merad Sprroud : © vault | Th veriabte whvw the optration vusult Kx stoved . Exe temp ‘= ath : Sees ‘ => Bipla This fremat yar Hous fielals 52 Op porte opena lov 3 * ongh ; Be fink cporand : +092) The seeondl operand Tipls dent eaplicidy Store Ha nuult. tstead hay ethan we temaporory voutiablr (ov prints +9 avoiol seduumolanig « The supaumcation ue chepiue barcel on > Quadvupla oo sirnplen t undirrtanc omd easier -fo inmphncwad > Triples com be mou rrueney officiel especially por complex . expowsions with. omg tonporany vorabler . Q What ka type chaelan 2 Explain. the apecitica tions of TC. A 4ype chun uo compounit of a compiltr Hat ews the covtetnis of olata. ‘typ uno ina programe and acl tha goteeuper veri fying chat operations ase: performed en compatible date types Basel, poseecting eviors be fore the prgm even rua. The Apecificatious of Type Checkin a: > Type Syston sulin ona predefined Hpe eystim which clefin a the allesed datatype , Keiv propention and Ht vadiol operations betwen Huw. ° — Type Rubus? These ave a act of suds that olictade Les types ane absiguecl and Ap prrations ost allowed bastol en tha involved elo. te lypis aes 5 Enver Reperting! Wolan it encomation am tavaliol Wype tmbination it gueratis an eer mncbtagh apecitiong Ht locats amd nadine of Hel uit hich, ‘help: hn ile fag omal fring potential gun tine: CYL eanly ba the developwaut prow - a Type In founer vs) Explicit Declaations « Some lomguages suguive explicit pe diclanations for vavia bls wh ofhuw ust type in fom automatically datenmine ype komad ew the Context ° Regernollun fe type chen enms comristoney amol befor err type suls ta bete carts - Q Explain clifford racthods for vagistin, allocation of amignuait a clifford mathods fr vegulir allocation of aaguoaen oon, => Local w9 Global Allocation: ° Loca! allocation : is arsigns. rugislore within a block Lhasic) carol iba Siwplon approach often ured for fhe buall fomctions 3 St ineduols Hechitiqnts auch ar ‘ a+ freqpumog count — Availabe Exprisions o Glblal Allocation : This consiclan he, cutive fauction gov progran pr sugis ln antiqued - St com Lad 4 better sugisten utilisation acvox all basic blocks . Hh fneludis tecluutyper hc on chairs Scone, > Graph coloring ldattn's Myo). Ls Interval - Baseol Alle cation : : This mutand foousr com Me, intervals celaning whith variabls ane alive. Jt levity om tn Pomme graph pitt necks rupsustuting varidul amd colgu comnacting in fering vartale lex IE coloving alae fo ansign vugtslis shih radia’ Ging “apis moguls, na as coe Ba Compl wer Bete sealed Te goal & matte Be eee span mange fr ewtcal we tpl 5 epic AT Register. Spilling « Thin ua fell back thrategy Phun fi nd- Of vive vaniabl excerd He available sagt, he Tha cate Ha compl chests Har least yd vortabls ancl pill Hum te mumony woh puoled - The goal is do wtvsmate the spills amd maxiwuse the sugis bon maage fo eniticad varialliA + Thin nuthsos worl togedlar te optinie veg tix wage anal Inaparove ta programe per formate » Q Explain. othe sudunclanug eltnanation techuatgatr . Th few suclunclinty climenation fechuugpur ove: > brome. ~ Sub eprucion elimtwation CCSE): aaa ideabifics ioleuctical expsutions appearing rauultiple Hints witin code block. ett caleulals He smatills one , thre Tra Lemprony vertalle anc yes TE plower the some expiertion Scout. > Lorp- Tnvanioal Coole Hokion > focums m caludations Mriole leaps tot alent depend on | voriabls ( Haviy vals Sumodia conbtowdl trorahonct Ha beop) . oH identifi, Hise cadewlationa amrol moves Hum outdide te loop © This tlininstr srclundoind computa tons Performed tn coche Htevalion , Locking fo fetter execution. : > Deal Code elitva tion + This tolanti fits amel Aumover enol Kehions Hat ane unrtachable to wwen execs teal alunivg pregyann Woo: 8 § i > Pantial Reclundancy Elimination (PRE: * This -qou boeymmd CSE amd -tacklu expressions Het one postially suclundaut - © PRE icluati fies the elumal with coustod valu tough evil a tBol: blade amel pen forwes optinigation Q Explain the primeiple Sunes of, optiuigortion . Optinazations in compiler come from ‘vanious douts bul ane broadly categorised jnte tu main suas bawal on dhe Scope of omnady rs 5 > Local Dptinsisations ; ae focuses om Jnnproving inolividual basle blocks within a function . otag amalye 0 Amal dection of cock ond dont consiola fhe fateractons with ethur pale 4 pregrare - Tha techanipts Inchecle the follossing ; * Guta Folding ¢ Evaluating expressions with corto valuta at ‘compile time , eliruiina ting He rusal foy suatine caleationt. + Copy Propagation | Replacing Asia nnstile sath prsviously aasigne valuss if Hag howen't changed . +> deal (oole Elinsinatinn ; Removing code Anctigns Hot wu wuntacabl wv nven executed . > Global Optimisation ; Analyse (ol acrors eative fumetiond ov even whole progvou Cowidir the contre! How amal data flow beboeur ppouak pols of he programe dp fdeatify aie optimisation opportunities. The techurtquas inclu tte Ppllossing « Gunmen - SubExpsunion Elimination; Avoiding suelurdarcl colulotions of Fduaticad expausions appearing wueltipl tim In ta pregran/bloce . 7 Loop - Srvantich Coos Hobo : Moving calealabions ‘hat don't depend on loop variablu exitkicl Ha loop #0 aveiol supetitions - > Function Talla S Replacing fomction calls within tHe adlual - function body if beneficial . > Machine Depeucuit Optinvisations . Tht Lappn effi He cools i trauslatid inte machine ssadlabl. format ond foums on orploiting specific fedlnn aud te inatruclion cel of tu tanget proctor .. The techatgnr inelrol He Pollossing ; ? Instruction Sehachaling * PArvvomai 4 inbtrnebions to MaXinnice prsdmey Utilication dmol waininigia ta wailing, Hom. #2. Regislov Allocation : Aesigning vowwablu CPU sugistou f foster acer , covrioluuy sug low avaielai lt and voniall usage: Pp Stremate Reduction ; Replacing compl operations roth te Alsplr oats epics by te tonget anchitectwu - By applying thre Com Ages ficasclly iaprrove te performance, runmony wage amol evenall officeang 7 He genenaeel mathine cool G, Explain constant prspagrtion sit ame cravople Constant propagation 4 a compilr optinai sation te chamape tat felencti fies anol vuplaus variabl with thus sor constant vabuth Hroogl. out the pogrom - This. elinedvadles manacuniainy coluulations ama abeaplifitr coo , leaching to foster txeubhon. for vhowmp lt , con cioluning He wodlt. bnippet int a 2 Op - y int barry int c= bea: Mae wus of te code with ©. ; The compilr aang A this code vaiwcol pen fon conatowd propegetion 1b dk Atoms 02'S did’ Hover tha comstond value of a . a Wh it dntoumtos b carr , it’ substilula He coubtovel Value o * 10 te Prstucton beeamu ‘beSta by dinvpple Jy tog iE > Siilandy Yor C= bes, the compiler stored the valu ges Alte “wu suplacal awa Pe forme tha piral coleulation C= FeB. Se his Comp le > Couttout Propagation inivala Ave vidundaut coleulahions anol Aivapliefics he code « This wp tn tation Cow Sigil fiamithy naprove performances for Code with mousy conttascl etl punaticls oarcl Cobtlartionr - & Explai. about loop opal eachion Teche With, exownple 1p eptiaisadions a crucial teehandgynth tro compilae Hat focus om Tenproning the por formance 4 tock thou itnahing a mper He mumber 4 Fits + The Common Hechaeigypas Nil example > Leep - Tnvaniont Gols Motion? This techni jolt fies coleulations with loops that don't depuwol on loop vantablia ( thut coledations ant ttdunclat acrvon Ttenabion,. by moving thus caludations eutviols Me lorp we aid ruduudonzt Campritations foreach iteration leading to the foster execution Eu: conbiola te cls Shippel for int iz0; few; itt) ZS dtbves aR HT Bo sk, Upon opply tte above colt wptinitation +echulyar int Gmst = 2a

You might also like