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

Assignment 5

The document contains 11 coding cases related to code optimization techniques. It also contains questions about code representations, memory layouts, and function calls.

Uploaded by

idreesghazi20
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)
37 views

Assignment 5

The document contains 11 coding cases related to code optimization techniques. It also contains questions about code representations, memory layouts, and function calls.

Uploaded by

idreesghazi20
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/ 15

QUESTION 01

Case 1 Dead code Elimination i 0

Case 2 Code Movement KYTE


forcintjo jen jtt
ali big

Case 3 Sub Shuxi


Comma
Etp Elim Delete

Casey Code hoisting t 2 oxo


Do I
Akagi txi
END DO
cons use of machine Idiom t
n NAM n n 1
case 6 use Nadine Idiom
of
MOV Ro index Val ofindex Ro
SHL RO double val in fo
MOV a 1203,6 const 6 sadness at Ro

case 7 Loop Unrolling i o

Colormapentis i

Étompentifitt
cased Algebric Simplification Reduction in strength

X X to X X I X X 1 X X
Case 9 Code movement t limit 2
while ist doing

case to online small functions


int main 1
cont cc The cube of 3 is CC 3 3 3 cc in

return 0 3
can 11 Strength Reduction B A A

QUESTION 02
i

Ata b c tcb c d
t
t

d
a
b lo
CI
d
d
b
c
b c

a f s
9 t a b c

b c

d d d
at at b e the

at a b c tcb c d
ti b c
ta a ti
tz a t tr
tu ti d
te e ts t d

QUESTION
Three Address Code P Code
a 2 3 4 5 a 2 3 4 5
TF 2 3 5 1 5 Idc 2 Idah ad
Tze Tith Idc 3 adi
adi ldcs
b 2 13 4 5 b 2 13 4 57
T1 htt Tz Tas 73 12 2 Idc 4 Idc 3 adi
Idc 5 adi
adi Idea

c axbtaxbtc a axbt at bye


Traxb Tz Tan tod a tod a lode
Tz axb Tu Tatts tod b tod b mpi
mpi mpi addi

QUESTION 04
3 Address Code P code
27 U 4
a
my 3 x n a
Ky 2 311 n

42 t 3 u Idan Stn Stn


N2 to Jett iday Idc mpi
my Idea Idan ddi
Stn
b alali b i 23 b a a lil blitz
i2 Idai lod add
traci act bli doz Sto sto
Sto Ida a
Idat tod t
Lodi add
Ida a Idab
lodi
adig
QUESTION 05

i
a ba Ctb A C

a 3 AC
tie tonite t3 unite ti tat tu
ta bit the bits a ts

b Anadruples
loc Op Agl 2 Result
Ag
o c ti
I b ti ta
2 I c ts
3 t
4 I I tu It
Triples
10C OP Arg Anga
o c

I b o
2 c

3 A b 2
I 3
4

c P cool storethe
Ida a mpi Idc y
od b mpi mpi
lode odb mpi
Idc 1 lode add

ii
a b ctd e

a 3 AC
a ty

n atb Ctd at btc

i
QUESTION 06
4
a b lil te Ci

ali bae bad


c

3
n
f yet 12

x t

4
n p t
by
5 as b K d t b lo d

O O

uminus ta

th uminus ty
QUESTION 07

3 Address code P code

QUESTION 08

3 Address Code pg493 P Code


QUESTION 09

a a

Global Static Area


ah
s
X I
fAhat Record
of main

t.mn ActivathRecord
of ff
te return address

P
IDirection
I free space
ofStackgrowth

b
A 9

Global Static Area

S hey
aco
j Activat Record
of main

g of s

c n'al
It address
Activat Record of g

Go
P
IDirection
I free space
ofStackgrowth
QUESTION 10

QUESTION 11

3rd 64
7.697 2 Call Ig
ty

QUESTION
12

You might also like