0% found this document useful (0 votes)
10 views22 pages

CD Unit-5 Imp

Uploaded by

Prakash Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views22 pages

CD Unit-5 Imp

Uploaded by

Prakash Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

LIC

LIrE INSURANCE CORPORATION OF INDIA


Hwwwtat

MEMBER
NAMANAQERS
OR AGENTS

NTE TRT

te t, 01444861
R.Balaiah
Ot-5
Member ol the Dlvislonal Manager's Club tor Apents
Code No. 01444661
Om Si Rama Dhuthaya Namaha

1) Dtscus about Fotouwerg Concept,


Mach fndapendert opimizatfen
D Functiorn-preseuf ne ansfoemafon
(ov) almnabfon

sub expsesslen f oeod coda


Commen
rOh an ezampa explalo
mehads o ddatl los)
elnfnates obal commen-&ub
Procedye thct
ExplaRn în ddale

exreken.
-Machine Lndependast opiraation-
&Pndapendont
oftagt
opliminatn
* Machra Lndoe endert langunge
charastextrlRa
Surce
dnthe dtesmedsat

ackine but dopende mako e


buesb
optimfradan
MackeIndepandent
Code mes e etbiient
studwe Po orda
Appopriat progeam
The cptierdaalion uee
The
Coco.
mpsove esticfene eot Jaoje
Machine- Indapendait
opRmitaion

ooe optimi äai o


Fanctien
Presesuiia
:(73 A), ETE YTE, terTe zte, frfdz
RTH:Post &Mdl: Kondapak, Dist: Siddipet 502 372
E:99499 06004 email : [email protected]

Off:(73 A), Near Old Bus Sand, Hyderabad Road, Siddipet. lrn
Hesi Post& Mdl: Kondapak, Dist: Slddipet-502 372
Cell :99499 06004 emalil : [email protected]
*Voefoug machna Podependard Codo oplfnfation techriajueg a30
bcal optferisakon
loal oplfmsion

ocal eplmitakion
-Casoied out uR
HID o 8Pralo
Palo baate
basle
ho opmfzoaliens
Thege a

to
block. ifomation teqsdtre
uajufre -ka
do not
ot
T techrfajue
ab Contiol.
data R Plow
å fnpla
npla
*Tmplamartadfo) o e s techrajue

Gloh optfmadiong oct


accros basfe blot3
ace

that Casefed
Ase t h ptimisatiens
T h ese
basfe blok.
Xnstead ab ngh d a t a - f l o o
analyRe
a

Anayes
auo knoen
*Th
B te Compler.

Tplermorytd%n
Tsansfoorratons
Fancten- Presohr
mprovYng a Progroam code
-kansfomadiens
h e r in
Senartfc Preesufog
-fareien t Compute.
oRo modefyng - e
orohode
Ttan be adhiesed by-follouing
sub-ezpre&sions
sb aobal
Cornme)
ellennatfen
a
eltrleaBfen dead code

Corutart foldina
d) Coefeopaqadlon.
cormnen
Cub-expresio na
a e eaen ot lobal Coomer0
ernmer) sub-exprelstew
ub-exprekstens

Cod Can be Rmppved by linnading


he
t h e code o
CaUed a
Co mmoo
Sub expreis Pon. Tte
An Occusance a é
values n e
howe not honged we
Comfuted ?
w Prwioulg
LIC
LurE IMSURANCE CORPoRATION OF
INOIA
atfrwrtat fr

MEMBER
DIVISIONAL MANAGERS
FOR AQENTS

TT. T

tE 4, 01444661

R.Balaiah
Menber of the DMtslonal Mannger's Chub for Agents
Code No. 01444661
Om Sfl PRama Dhuthaya Namaha

t qaln.
Compukng
dan ANotd
optirda ed
sode -
t1 Li
x
tDa[tJ
t a(

tSEn
4s=0

-
Eimnaden o dand code t ts valua
k s Valuo
cannot
c o o n o t be
ed
ued

foo Pogtam t Called oas dead


a
*A Nasialle
Vaodalle coda
t h a thodt
Subs e a uent tte P om

Code.

e
(R-)
a-b+S
oecauge thfs
stotemard iA doad codo
Tabove
amglo,e

Cordllen
uU
neyen
aet se ted
Co
retardt folaire
ma evalnotero
Zt Compl
-he oe
alue
and udomtina the
Eraluaig t e expressien
af: (73 A), ae qeit TE, keraTe e, faf¢dz.
faere:Post&Mdl:Kondapak, Dist:Siddipet502 372
a: 90499 06004 email:[email protected]

Of:(73 A), Near Old Bus Stand, Hyderabad Road,Siddipet.


Hesi:Post &Mdl: Kondapak, Dist: Siddipet 502 372
Cell:99499 06004 email : [email protected]
can be Staplaad
ex a=3oluST
at.Sto

d) CoP POPrgakfon
ono Naofala Rntead
means LusTnA of
*
CoP P DpRgrlfn
Anottee vaotiabb.

= Pi

A * T*T
optRrised code
A Pf *
wth ezampla.
ezampla
techlajue
aerplafo the
Aoop optmfzakien

Aug optimsaton tooPs,eafec?al


Tha najor Sousce et coda

nneRoops.
u dpend more anione o noea loo fsSo hat
*The pogam
tha oumbeg Ot f neg
ooneR oop.
Con ba aduced by sadudrg
Theae n0 he technfa ueg
Cede noten

e alen rduzfion vasdable


n g t h Rduiten

Code molion oSmou 8 Loda n -tho


sed o decreae
Code notfon å

Loop To aoop by
sedueeg tto Oumbe & neuctioru
Code otien
out albeclng
oructiøns
outsda e the loP
moRA
Semantfa sb the progfasm
MA
LIC
UFE INSURANCE CORPORATION OF INOIA
rfarwtort

MEMBER
fora

DIVISIONAL MANAGERS
TOR AOENT

T. TTT

ete it, 01444661


R.Balaiah
Member of the Dvisional Manager's Ckib for Apents
Code No 01444661
Om Sh Rama D'uthaya Nanmaha

e wtb (Per r t -
Ates cod nat'on

a n-a;
okt (e=a)

p eimnallen o Rduelon vasRahler eelas


Nasfob b em
d Te
emfnadfon
*Tnduueten vasdable

ones looP
9n Aoop.
x Tt a n neduo mbex of addftons
pertormanee.
both Coda Space mun Sme
* T t mProves
l2 to; t )
fo (o,îro, kro;
a[+J b[kJ
coda becoma as
above
la elnineleo ,-he
Fnduien vasfab
Agbe

lo;?44)
fos (-o 9te

a [t]bt;

aT: (73 A), aR TRTE TE, keTae ie, frfde


TaT:Post&Mdl: Kondapak, Dist: Slddipet-502 372
E: 9949906004 email: [email protected]

Off:(73 A), Near Old Bus Stand, Hyderabad Road, Siddipet.


Resi:Post &Mdl: Kondapak, Dist:Siddipet-502 372
Cell:99499 06004 email: [email protected]
3)Sengh Teducioo
Ad o plogha
90plog oapens9ve opAohon

eduelo
Aangh
* a n gh

b t chenpex c e rouskpcaln»
So we
o
-than
Gontianl ?s choo(es
Addfle et o

odd? Ron
fthi JwoP
loo P.
usth an

epaa
muliieical&o
so we
Car
7oplno
Can erporertfoJ-
thon
á tho.aP a g
Mub'pS cal iorn f t JpoP.
u i Jop
a
cotion
muHPpR
LoPih
xporentPA
k k e l k (tzo)

S=At+?9

a[fJ- «[1
-f+
bRa Ceca
Coca u9d
us?U be C
Comne
om
5ha
aduetfon

Ata sargh
ta ilangh

s - 3f+ is

S-S
a[J-oT-23

S- St6

o optimizaton»
the poc? pla
Souceg

mut Pesle the Semaptfe s osfnal


Ane-Com@lea optirniaatien

can
proganD 9n shich a Compileg
Aso
umbea ob Oa
Thea tefunetten t comeates.
Proram
ithout chang
freoe
The Lechniajueu Ae
suberpsesien elimnakion
4) Comm
LIC
Lrt INSURANCE CORPoRATION 0F eDIA MEMBER
LMAMARS
ORMANTS
NTT, THT

e 40144461
R.Balaiah
Member of the DMslonal Marnagers Cub for Agent
Code No 01444061
On Sft Rarna Dhuthaya Namaha

)CoP Propogtkien
ellrinabtien
iy
33) Dead-pod
Reducon în targth
Constart tolding
) o o p bptimiaatiem

1) 4 4 Ans

.)1 4 Ars

3 1st Ans

Dnd Ans
s)1 Ars
m oTe
morTe
6)Koop olfnfsalien U SPerd
Prame
n
nnez LooPs
impves it e
espefally P*o{am ma be
bpe
*In loo ps, poram ma d.
untfora
a decreas
Rre The noea lsop
R n t u c i e n 9 an

Durnbea Prsaion.
optfrmisaion.

& called
as pop
Ts
ThRs Procen

a:(73 A), aT eTU E, tarere r, feftz,


rArH: Post& Mdl: Kondapak, Dist: 5iddpet 502 312
B:9949906004 email : [email protected]

Of:(73 A), Near Old Bus Stand, Hyderabad Road, Sidipet.


Resi:Post& Mdl:Kondapak,Dist:Siddipet 502 372
Cell :99499 06004 email rbalalah1444661 @gmail.com
>Dalto sttuetua
Progfoms.
9 rle abou Plow aralyse oh
Ans Cormprleg
Cormprle
roust
rouft

code 8enaaken
To Pesfom Cab eplimftaldn P it t eadh.
dRele?h ud
who Prram 9
Colec Snfownalon aboud

-elou a p h

Doa Flow
eawaion g

ou[s3 8en [STU (In (9-kilD))


Dutt [sJinb at
end st s

fob genesated bS
en TsJ
esytes t
a beg?non? ot SS
TI=?nfo

kRUT=
fofo kUed S
thet e u e r raah end oh te block)

Condas asam mas


Exps than 3trtt
3trrt
Stre>?darrtetiex = Expr |Stmt ; stmt|

else strod do Stmt usthiG exp


nepreaerdts Statemerd

ses erdf epsesser


Exps
block
* Greneal flo
SPunmy block

strmt

-- Dunma blxk
LIC
LUrt INBURANCE COnroRATION OF
bIA
MEMBER

aTT, THT

he R01444661
R.Balaiah
Member of the Dvislonal Manapers Club for Agents
Code No. 01444861
On Si Rama Dhufthaya Nanaha

9apresented by-
louo qiach 9s
Guenenal

Tdant = Czprexion

ext d: =e+a
ftoo r a p h ?e
Sre

DeF di=etg| o «
above opb
or
dala
low eajuadon
Tke
0
LkILL CotrmdT)
(INstntJ-ktLL Cstrnd)
OOT (ctrtJ= GeN (stmt
Strmd a93trrt
1) Strcd -
flow aaph ?«
The eneo

a.: (73 A), at eTe TE, EeTaTE TE, fafede.


TTe:Post &Mdl: Kondapak, Dist :Slddipet 502 372
da: 99499 06004 email: [email protected]

Off: (73 A), Near Old Bus Stand, Hyderabad Road, Siddipet.
Resi: Post& Mdl: Kondapak, Dist:Siddipet-502 372
Cell:99499 06004 email : rbalalah1444661 @gmail.com
The dada louw eajualiong Aa. kiLL Tetrrt oT)
GiED[trd o] U (tocn [etrd
sJ-
Se NetntJ-
(kILL Ceirk 1]-Gre NTetrk t)
- klLLTstrek Ju
kILL std J
Aetmdt TNttred 4
TNtmt sJ
oor [etrmlJ
Strk o

f éxpr -tkan rnt 4 elae


)&m
is
The enena -lo aph

f Expr goto ttrnk 4

E t1

eajuarien aa,
The dada Plou

ktlLL Ctmd 4O ELLGtrt


EILL r d T-
IOCtr1J=T(strtJ
oUTTHrd 7
oOT [strtJ = o o T (strmt 4JU
do strrt 1 usht Cap
u) Slrrk
The enesa

dda Plow
eauakene A
Tha
Gre N Cctmt
GiEN stmt J=
kLL stmd J - klLL t t t a
N [strd D Ges [3tml 4
NTetmt 1=
OUT Tted J ouT [ttmt 1J
LIC
LUPE INBURANCE COnpoRATION DT IHDIA
wfiwit fra

MEMBER
MGNTS

NTT. T

te H 01444661

R.Balaiah
Memtber of the Dweslonal Mannper's Chib lor Apents
Code No 01444661
Om St Rema Dhuthaya Namahn

Beclyabnad explatn
40a fo Uousg
DReachfng dehinftine

eve eslabe onalys?s


lo) Suêtabb exampk.
e l n e s wfth
ohal
o ha 9s lfveliness ? erplafo

* keachng dehiRtions ttaa i a


pofr f
dahRnstion d >jeaches hat
hat d» to P suth
oe Sa foUoufng
mmedlakey
Pord
Ralt ftocm hepa
d is net RUed alona

e
ftam
debfottbn kem
detînttfbn
soa?d ebe eachinq
each?nq
e e aboue
abose dajirtbn fs
T
block 8 2 .
»
block B
1 e Vos&bla
Analye 8 pofd f ::
d PP
to be
alfue
aliie at Pof
R Sald
(lt a) begionng
beg?on?ng at
AA vasfab l o
O & Plous aph
Flous aph
s L2ed
valua
- s Gurves
he pofc: P. tad pornt Pto
pofnt en
P t o end
-em
(let P)
eicts a pah
Thee

: (73 A), TE eTE TE, EKTaTE RTE, fafRT.


ReTE:Post &Mdl: Kondapak, Dist: Siddipet 502 372
B:9949906004 email:[email protected]

Off:(73 A), Near Old Bus Stand, Hyderabad Road, Siddipet.


Resi : Post &Mdl: Kondapak, Dist: Slddipet 502 372
Cell:99499 06004 email: [email protected]
safd to be in dendA tah
PoR(e),zthekustte
Cx

a15
B3

CS
b:-10

ratz

Lal =a+7|e
Uasiabla a s ve
a

kem above fque, that


Can
be nofeed
s kMued at Blok B
Blok B6
to Block e2and
Pe bbek B1
egletep
Aduantag8 Cada elkmraheo P
aed fn dead
uaeables ase
X Lve
allocao0.

nete a short notes en

Foundaora at data-floo onalysis fcasrauook


fkameuoosk

9 SexrLaice
3) Paodfa ordeg
dataPlow analu?s Fameuoork 8
Foundatiens e fE)
Tncudes (DS,A,
ameook
floo raly
A dada - dlsetien ushih can be efthes fonoand
eteg fonoand se

D-A
Aata- Plow
backuoad
LIC
LIFE INSURANCE CORPORATON OF INDa MEMBER
IONAL MANAGERS
FORAGENTS

RTT. T T

t0144851
R.Balaiah
Mlembero the Dhesional Manager's le brAperts
Cade Nc 01444861
On St Rama Dhuhaya Ramaha

Nalues
S A set ot called po
meet O aatto
fa or .
talled meet
opeatos A
A- A bras FSS.
funtfens
<an-fes
F Aset o

9 Sernlattice - suduu
n)
stuue (S, A)
as alaebraie
Can be dehined
.
A Sem? lottice Sand
a meet
opesvatos

atvalues
th s els
otert xnz=z

b)Comoutotive z n=

) Assocfadfve AgA a) =(x A}


)Paode oxder - on st
set s\s '4*
*d
bsda
sapreserts a Passkial
2
*A batien Pr
P oo
ppek
eiie
ess

fouinausfna
and a e s , t ssclstfes follo
a )Re-Plezive? * é x
e z
e =4
h a *=y
ze { ard
Amtisg enmehie
and 8e
-e z
?Th 24
c)eantive?

ai: (73A), TR ETE TE, ETaTE TT, FRRTE.


ATE: Post &Md: Kondapak, Dist:Siddipet-502 372
R:99499 06004 email:[email protected]

Of:73 A), Near Old Bus Sand, HyderabadRoad,Siddipet


Resi:Post&Mdl: Kondapak,
Cell :99499 06004
Dist:Siddipet-502 372
email : balaiah1444661 Ggmail.com
Explon Conwarrt pro pagafon uwth euampa
Aru Concarl paupnqafon
Halso

as
Contfo. foldrg
* Conrtant Popoqafen a l e d

tho Vae
* ezprosion and ubmiURng
Evaluadfog he

d b900

ed = atb

optimized Coda
rd a= l00
nd b= 9c0
Fct = loo+D0
ConstarkPofagaien
CameLoost
Dado-Ploo vaueg Fo
Appopadke for ore o vasc? bl,
A l Conetards
uth s atd lo a

Am udehined salue called UNDEF


Uasfable.
ualue calledd NAC. Lohan Heg Vauo doesnat
does nst
3Net-a-Constond Vooiobo .
Vasiot
then t mapped to a

an Conttart Valuo
tontafo any
Coetaro

-Propagtien Franeuook
Meet for Constard
Ualue s
valuea sfmpyto
x The sesnf latkfce o Aaa- o
SemLdfces mem ard L alll Ualuabla
Peodudk

N uwe hase O(9)2 m ( ) UNDEF

UNDEF =9 NAC AQ= NAC


for an Conrtort CACE
dfRnet Coratards
Por too Kgasad
C and C
CAC = NAC
NAC
LIC
LIFE INSURANCE CORPORATION OF INDIA MEMBER
DVISONAL MANAGERS
FOR AGENTS

3HTR. TAT

tz H.0144661
R. Balaiah
Member of the Disional Manager's Cub lor Agents
Code No. 01444661
Om Sri Rama Dhuthaya Namaha
thateminadng
obal Cornme)
Procedue
Cxplaio o deta the
8
SubexpoerRons.
Co elrmRrakes" Can be doro dt
Subexpregsen
epan hooRadundar
ven ProoM.
gobal luwe a
eliËrakon take a,
Subexprasien
common
A n algoiiho fos oba as inpdt and
oformalBen
expseisfen
etoo aph
oo oph usth aai able
a Duhpat.
a reRced fow iaph
Poducea

exConalee he folouoRng to giaph


t

y=it

satu epsester)
&uleexpreat for inided.
Gminated.

ernmen ue
he agom o
APta ethewn
henbalow below
ke oult e Hour saph

rot

tut
aT.: (73 A), aT TRIS YT, eRTATE TE, ferfRd.
ReTH: Post &Mdl: Kondapak, Dist: Siddipet-502 372
a:99499 06004 email : rbalalah1444661 @gmail.com 4sroft
Off:(73 A), Near Old Bus Stand, Hyderabad Road, Siddipet.
Resi: Post & Mdl: Kondapak, Dist: Siddipet-502 372
Cll:99499 06004 email: [email protected]
and Etuf axa alko Comme
I o he above (too qtaçh o t i
Subexpestiont. becoo
t . So hese O r p s a Poru h a s
*Replace t1 and tuy by
xpealen
&ukexpseslen
take
t olfeninate alobal co conen
roethod dompt les Praests
Anolhes
oto atcount t thal tte omtlex
-lact that
s o tako
otako
e termpora asüableg.
has o lauo
alaua
ecampb, SuPPose 4t 2
o b 1 and t .
e Sama
Canade nctead
valuanumbez
tks
umbex 9,, w
umbex 9 wee
se
Saro
Samo
vadse numbe,
valsa nurber,
gt he
a[tJan otu hst 1
The eapresPon
han
hon h st
eulkard

6 te value mbes 1
t.
bothb aTtJ and
rapreserds usiUu be
aph
uttart Plo
Tbe es

(g)=i+9
(a-)= a [ a J

ts=(1)

technfajues.
t echnaues.
elm
miin
naae
en
adundar ad
ezplaio technarues
olndnoson
udundony
hreTa Sube
Subexxpses bo:
prueei bo:

Global Comoen
elianaden o
h Arsi
MA
LIC
Urt INSURANCE CORPORATION OF INOIA MEMBER
DIVISIONAL MANAGERS
FOR AGENTS

TR. TGT

t t, 01444661
R. Balaiah
Mernber of the 0vislonal Manager's Cub for Agents
Code No. 01444661
Om Si Rama Dhuthaya Namaha

op ivasdon Cornpuatakfone
aso
expsesi
e x P r e u iens
s r u ?n
ConpakalBons
fovasdard
st Leop qmacb u m b e s oh
oumbes o
Samo Nalo
Valso Fndependert
rdependert
9nes u t Pn
a loo p hat
execcted.
times o loop dehfnadie
tde hfnadi sh4
a
&a
a o po
oJoop vasdart
Rovasdant
ai=btc
he
*The etaternert
Stnce ke Vole b+C
b+c umaîna
urmaing
b andc as
outsfoat op
thecop is execited.
te
Same each
fouasart Conpakaene s
Compakalone
n
elrRnakion eb kop
The
The sst step taerarts
t h o Progkam.
To o PogAarm
ovadot
Coda motten techrajue
techreajwe
to fnd loop o coda motien

datesming bop nvasiark tlademorks beore o


Att
Attea moufng
seh

elfminactes them b
telooP
3Pastal Radurdart efoniraoo8-

btBy
aT: (73 A), aT TETE TE, rraTE TIE, fAfET.
a r : Post&Mdl: Kondapak, Dist: Siddipet-502 372
B:9949906004 email: [email protected]

Off: (73 A), Near Old Bus Stand, Hyderabad Road, Siddipet.
Resi:Post& Mdl: Kondapak, Dist:Siddipet 502 372
Cell:99499 06004 email: rbalalah1444661 @gmail.com
Xhe sAionb+c tn block Bu ?s tadndort on Poch

but Pocth B BsBy


ee, not on

tho 91dundarey b placog o Coneatalfon ob


e can dfnfnado
b4c block B .

A AU resubls ot b+c ae ploced tenovaY JoiobG


o t
* U
blodck B aplaced usRth t .
and Colaulahon in

B1

t=btc B

det

and
non-teducibb Plo
-flo ophy with
aphy wth
teducabla
explaln
ezomple.
flou Goaphe and
and
AT PReducabe
uducabla
flouo aph f
safd to be
G i dsfolnt o urs.
oups.
A ou qaph to tuco disfofnd
Padteton
-the edaes
Cour
e
ooy and
eges.
backuood qe4
backuoood
fonad edge nodo
Thoya o h
huc h esey
ch eweaM
Fovm a n acHdie apb
Aaph
Fonoond edgs

be
achabla fen te rtfalrode.
Con thoce edga ushose beade
beads
edges Conlsle oh on
Backoooo
doinaea thtalla
LIC
LIFE INSURANCE CORPORATION OF INDIA
MEMBER
DIVISIONAL MANAGER'S
FOR AGENTS

TT. TGAT

stE .01444661
R. Balaiah
Member of the Divisional Manager's Club lor Agents
Code Na.01444661
Om Shi Rama Dhuthaya Namaha

ex

40)

8 >3
4, > 3 an
a s
aa S 3 , 14o-54,
4S3,
above raph
The
The back edgesn -tho a p b îc
amove ha badk edges
we
ben
1
hence ICETAE rudufblo.
Aycic and

: (73 A), TRIS TE, raTE Ts, fAfRNz.


ATE: Post &Mdl: Kondapak, Dist:Siddipet-502 372
R: 99499 06004 email : rbalaiah1444661 @gmail.com

Off:(73 A), Near Old Bus Stand, Hyderabad Road, Siddipet.


Resi:Post&Mdl:Kondapak, Dist:Siddipet-502 372
Cell : 99499 06004 email: [email protected]
Non-redueakla ow oph
2ThePloo 8aph oo-odultla
As hese AKO

ho back edges

ex

bove Kompo .

Po h o
fheo
no back edq es oo d'btesart ploo,
erttescd at
Can
be
A the CH ele 3 nan
woludbh.
Plow -faph fow tapb ~ ayd.
nodu s oand rode ow aph
Conelte
aduwabb 6tho
C o n be
Con be
030 VeHtare
eHaa de
Plouo 8aphe
Non-reducabb

hoo CoP8 Pogaqrebo Con be dee using daa


1 ) eçlain
Ptous e a u i e n
5.8 cOMPILER DESIGN (JNTU-HYDERAPA
In the above cquations CGEN[B] is aa set
set of.
AD)
Explain different principle source of code ot all
optimization. statements generated
in block B and CKILL[Bl is
set of copy
copy a

in t h a t are killed in B. Where Ubeing the


Answer statements
n
rolsa
the program. In
copy statements
Nov./Dec.-20(R16), Q8 in
set containing all
The vanous
prineipal sources of optimization techniques copy propagation
tve say that a statement s: x: =y is ki lo
and is n
are as follows,
if the definition of r ory
is changed not s
present in B
)Elinmination of common subexpressions Propagation Algorithm
The algorithm takes as input a flow graph with ud.ol
() Copy variable propagation It
and du-chain information. produces
a revised flow Ora
(1) Eimination of dead code aph as
an output.
iv) Loop optimizations. The algorithm consists of the following steps,

() Elimination of Common For the copy statements : a: =b, determine all the
Subexpressions uses
For answer refer ofa.
Unit-V, Q14, Topic: Elimination of
Global Common Subexpressions. For every use ofa found in step 1 determine whether
CBGN[B] and that a or bis not changed beforethe
Copy Propagation
use of a within B(a block containing particular use of
For answer refer Unit-V, a). If CBGN[B] includes s then it is the only definition
Q14, Topic: Copy / Variable
Propagation. of a that reaches B.

(iii) Elimination of Dead Code Ifs satisfies the above conditions then remove saand
substitute b for x in all of its uses found in step 1.
For answer refer Unit-V,
Dead Code.
Q14, Topic: Elimination of
Repeat these steps for each copy statement ofthe form
4.
S:a=b.
(iv) Loop Optimizations
Example
For answer refer Unit-V, Q15.
Consider the flow graph shown in figure.
Q17. Explain how copy propagation can be done
using data flow equation. a:bBlock B,
Answer : (Dec-17(R15), Q9 | March-16(R13), a9(b))
The intermediate code generator often creates the
copy statements such as s: *=y which involve temporary
variables that are local to one block. Such copy statements can
Block B, Bock B,
be eliminated by determining all places where x is used and
replacing its use by y in all these places. This can be done if
y:2+3
Cvery 7 of r satisty the following conditions. d a +2 Block B,
1. The definition of r that reaches it use u must be only
the statement s. This condition can be checked using
ud-chaining infomation of x.
The value ofy is not changed along every path from the
delinition of r to its use i.e.. from s to u. This condition Le=a j Block B,
can be checked by defining the sets BGN[B] and
END[B] The set BGN[B] is the set of copy statements Figure: Example Flow Graph
of the form s: x: = V, such that s is available along the In the above flow graph CGEN[B,] ={a:= b}
path from initial node to the beginning of B and along
CGENIB,] = {a :=c} and
this pathy is not redefined. The set END[B] is defined
similarlybut w.r.t the end of block B. CGEN for remaining blocks is f.
The data flow equations for copy propagation are, CKILL[B] ={a= b} since b is changed in B2
ENDIB] = CGEN[B]u(BGN[B]1-CKILL[B]) CKILL[B,] ={a:=b} and CKILL [B,] = {a:=b} since
END[P]if B is not the a is changed in corresponding blocks.
CKILL for remaining blocks is .
initial block)
BGNB] prvideee s From the data-flow
initial block.
equations, we get,
BGN[B,]-¢ if B is the BGN[B)= f

WARNING: Xerox/Photocopying of this


book is a
CRIMINAL act. Anyone found guilty is I lABIE
5 Machin
hine-Independent Optimization
expression for the flow graph is given
ilable as,

RGNIB.1- BGN[B,] =
END[B,] =
fa =b}
ENDIB1o

ENDIB,1= BGN[B,] END[B,]


= =
{a = c} and

BGNIB]- END[B.] n
ENDB,] =
it is possible
om the above
information not to replace
all
That is in this
b or c for finitions a:=bora=c.
defin
sofaby statement may be propagated. However we
ther copy
B but it is not an improvement in the code.
kaceaa by
ce in B, i
by ccin

You might also like