
viluva sankhya

viluva sankhya anedi oka prograamlo rendu gananalu eppudu samanamga unnayo nirnayinche saanketikata mariyu vaatilo okadaanni semantics-preserving optimisationtho tolagistundi.
prapancha viluva sankhya.
global value numbering (gvn) anedi static single assainment phaaram (ssa) intermediate praatinidhyam aadhaaramgaa compiler optimisation. idhi konnisaarlu saadhaarana upa-vyakteekarana tolagimpu (cse) cheyani anavasaramaina kodnu tolaginchadaaniki sahaayapadutundi. ayithe, adhe samayamlo, cse, gvn cheyani kodnu tolaginchavacchu, kabatti rendoo tarachugaa aadhunika compilerlalo kanipistaayi. global value numbering anedi sthaanika viluva numbering nundi bhinnamgaa untundi, dheenilo viluva-sankhya mappinglu praathamika block sarihaddula meedugaa kooda untaayi, mariyu mappinglanu lekkinchadaaniki vividha algaarithamlanu upayogistaaru.
global value numbering anedi chararaasulu mariyu vyakteekaranalaku viluva sankhyanu ketayinchadam dwara panichestundi. adhe viluva sankhyanu aaa chararaasulaku mariyu vyakteekaranalaku ketayistaru, ivi niroopinchadagina samaanamainavi. udaaharanaku, eee krindi code loeh
 doubleue = 3
 x: = 3
 y: = x + 4
 z: = w + 4
oka manchi gvn rotein adhe viluva sankhyanu coque _ 1 mariyu coque _ 2 kuu ketayistundi, mariyu adhe viluva sankhyanu coque _ 3 mariyu coque _ 4 kii ketayistundi. udaaharanaku, mapp formula _ 1 eee block kosam saraina viluva-sankhya mappingnu kaligi untundi.
eee samacharanni upayoginchi, munupati code sakalaanni surakshitamgaa ilaa maarchavachuhu
 doubleue = 3
 x: = W
 y: = w + 4
 z: = y
eee bhaganni anusarinche kodnu batti, coppy pracharam anedi coque _ 2 mariyu coque _ 4 kuu ketaayimpulanu tolaginchagaladu.
konnisaarlu cse kante gvn marinta saktivantamainadi kaavadaaniki kaaranam cse lexically saaruupya vyakteekaranalato saripolutundi, ayithe gvn antarleena samaanatvaanni nirnayinchadaaniki prayatnistundi. udaaharanaku, code loeh
 a: = c × d
 e: = c
 f: = e × d
coppy pracharam lekunda, cse anedi coc _ 7kii ketaayinchina recomputation tolaginchadu, conny paelavamaina gvn algorithm kooda eee redendenseeni kanugoni tolaginchaali.
tappudu suutram _ 2 mappinglu srushtinchabadakundaa undataaniki gvn nirvahinchadaaniki ssa roopam avasaram.
sthaanika viluva sankhya.
sthaanika viluva sankhya (lvn) anedi compiler optimisation, idhi samaanamaina vyakteekaranala yokka bahula udaaharanalanu kanugonadam lakshyamgaa pettukundi (i.ii. adhe phalitaanni ichhe vyakteekaranalu) mariyu vaatini modati sanghatanatho bharti cheyandi. lvn anedi sthaanika optimisation, antey prapancha viluva sankhyala maadirigaa kakunda, idhi oka samayamlo oke praathamika blacklo panichestundi.
prati operationku oka pratyeka sankhyanu ketayinchadam dwara mariyu eee sanghaalanu gurthunchukovadam dwara sthaanika viluva sankhyalu panicheestaayi. tadupari suuchanalu pariseelinchabadataayi mariyu, okelanti suuchana ippatike namodu cheyabadi unte, munupati suuchana phalitamtho bharti cheyabadataayi. udaaharanakuh
 a 4 a nii #1 gaa tagg cheyabadindi
 b·5b nii #2 gaa tagg chesaaru
 c _ (a + bc) (#1 + #2) nuu #3 gaa tagg cheyabadindi.
 d ≤5d nii #2 gaa tagg cheyabadindi, b kii samanamga untundi
 e-a + d e, '#1 + #2' gaa undatam valana #3 gaa tagg cheyabadindi
suuchanalaku sankhyalanu ketayinchadam dwara, nakileela kosam polchadam anedi saadhaarana puurnaanka poolikalagaa maarchabadutundi. eee pratyeka udaaharanalo, coque _ 8 mariyu coque _ 9 oke sankhyanu (#3) ketayinchabaddayi, tadwara coque _ 9 kuu sambandhinchina evaina suuchanalanu kevalam coque _ 8 thoo bharti cheyavachani kampailarku sanketam istaaru.
ibbandulu mariyu podigimpulu.
ssa upayoginchanappudu samasyalu.
amayaka amalu sankhyalaku badulugaa chararaasula paerlanu neerugaa upayoginchadam dwara optimizationnu nirvahinchadaaniki prayatninchavacchu. ayithe, chararaasula viluvalu maaragalagadamto eee vidhanam panicheyadu. sudokodnu pariganinchandih
 a1 a nii #1 gaa tagg cheyabadindi
 b2b nii #2 gaa tagg chesaaru
 c _ a + b _ c nii #3 gaa tagg cheyabadindi
 b 3
 d + bd nuu #3 gaa tappugaa tagg chesaaru
eee drushtaamtamlo, coque _ 12kii 3 sankhyanu tappugaa ketaayinchaaru endukante vaadanalu coque _ 8kii saripolutaayi. ayithe, idhi tappu, endukante coque _ 14 viluva 2 nundi 3kii maarindi, tadwara vaastava phalitaalu bhinnamgaa untaayi. ssa praatinidhyaanni upayoginchadam eee asamaanatanu parishkaristundi.
ganita gurtimpulanu upayoginchadam.
oka saadhaarana amalu kooda anni samaanamaina vyakteekaranalanu pattukolekapovachhu, avi vaati operandla kramamlo matrame bhinnamgaa unnappatikee. eee krindi udaaharanalo, cock _ 15 mariyu cock _ 14 oke sankhyanu ketayinchavachuhu
 a 1 + 2
 b 2 + 1
rendu kesulaku oke sankhyanu ketayinchadam dwara eee samasyanu sulabhamgaa parishkarinchavacchu (i.ii. coque _ 17 mariyu coque _ 18 rendoo oke sankhyatho namodu cheyabadataayi) ledhaa samaanamaina vaati kosam tanikhi cheyadaaniki mundu aaparendlanu kramabaddhikarinchadam dwara.
sthaanika viluva numbering optimizerlu kooda ganita gurtimpula gurinchi telusukovacchu. coque _ 15 oka puurnaamkam anie bhaavinchi, eee krindi vyakteekaranalannintiki oke viluvanu ketayinchavachuhu
 b + 0
 c * 1
 d _ (a, garishta _ int)
 e ≤ (a, a)
 f _ a & 0xff..ff ('&' anedi bitwaisga suuchistumdi mariyu)