search
Log In

Recent questions tagged register-allocation

0 votes
0 answers
1
Show how to do the following statement c = a[2] + b[0] a) using register direct, imm, register indirect b) using register direct, imm, absolute addressing c) using register direct, imm, register indirect with displacement
asked Mar 13, 2019 in CO and Architecture manisha11 69 views
0 votes
1 answer
3
Consider the following expression and identify minimum number of registers required to implement the following expression : (a-b)+(e+(c-d))/f Can anyone please give the theory or notes of prerequisites -, how to solve these questions. The solution of the above problem is :- ... performed by adding R1 to the R2 and result is stored back into R1 since R1=R1+R2. Number of registers used is only 3.
asked Dec 26, 2018 in CO and Architecture Sandy Sharma 179 views
0 votes
1 answer
5
The following program uses six different variables p, q, r, s, t and u. The code is: p=6 q=7 t=p*q s=t+p u=8 u=s*p s=p+u r=r*q t=t+p return t Assume that all operations take their operands from registers, the minimum number of registers needed to ... _____________? Given answer is 5, but my answer is 4. I think that the step u=8 can be skipped since 'u' is being reinitialized in the next step.
asked Aug 23, 2018 in Compiler Design sumedha bhatia 188 views
0 votes
1 answer
6
Consider the evaluation of following expression tree on a machine in which memory can be accessed only through load and store instructions. The variable p, q, r, s, t and u are initially stored in memory. The binary operators used in the tree can be ... a register. What is the minimum number of registers needed to evaluate the expression if, no intermediate results can be stored in memory?
asked Jul 22, 2018 in CO and Architecture Na462 519 views
0 votes
1 answer
8
X= (a+b)*(c+d) variables are in the memory execute on a register -register cpu Then how many 2 address and 3 address instructions requare .. Explain please
asked Sep 13, 2017 in CO and Architecture air1ankit 119 views
43 votes
2 answers
9
Consider the expression $(a-1) * (((b+c)/3)+d)$. Let $X$ be the minimum number of registers required by an optimal code generation (without any register spill) algorithm for a load/store architecture, in which only load and store instructions can have memory operands and arithmetic instructions can have only register or immediate operands. The value of $X$ is _____________ .
asked Feb 14, 2017 in Compiler Design Arjun 9.7k views
8 votes
1 answer
10
How to draw register allocation interference graph ? Can anyone explain this along with " What is a live variable "? Explain with the example given below ? a = 1 b = 10 c = 20 d = a + b e = c + d f = c + e b = c + e e = b + f d = 5 + e return d + f
asked Nov 2, 2016 in Compiler Design Kapil 876 views
1 vote
0 answers
11
Do we have register interference graphs/ coloring in our syllabus and if so can someone please provide any online material for it.I am facing difficulty understanding how the graph is actually constructed.
asked Oct 21, 2016 in CO and Architecture Aakash Das 233 views
1 vote
1 answer
12
Could someone explain me register allocation algorithm in simple manner . I referred some text books but couldn't understand properly . Please help me
asked Dec 30, 2015 in Compiler Design pC 267 views
3 votes
2 answers
13
The arithmetic expression $(a+b) * c- d/e ** l$ is to be evaluated on a two address machine, where each operand is either a register or a memory location. With a minimum number of memory accesses of operands.the number of registers required to evaluate this expression is ______. The number of memory accesses of operands is ____________
asked Nov 14, 2015 in Compiler Design ibia 631 views
40 votes
7 answers
15
The program below uses six temporary variables $a, b, c, d, e, f$. a = 1 b = 10 c = 20 d = a + b e = c + d f = c + e b = c + e e = b + f d = 5 + e return d + f Assuming that all operations take their operands from registers, what is the minimum number of registers needed to execute this program without spilling? $2$ $3$ $4$ $6$
asked Sep 30, 2014 in Compiler Design jothee 8.1k views
19 votes
2 answers
16
The expression $( a * b) * c \; op \dots$ where ‘op’ is one of ‘$+$’, ‘$*$’ and ‘$\uparrow$’ (exponentiation) can be evaluated on a CPU with single register without storing the value of ($a * b$) if $\text{‘op’}$ is ‘$+$’ or ‘$*$’ $\text{‘op’}$ is ‘$\uparrow$’ or ‘$*$’ $\text{‘op’}$ is ‘$\uparrow$’ or ‘$+$’ not possible to evaluate without storing
asked Sep 29, 2014 in Compiler Design Kathleen 2k views
39 votes
5 answers
17
Consider evaluating the following expression tree on a machine with load-store architecture in which memory can be accessed only through load and store instructions. The variables $a, b, c, d,$ and $e$ are initially stored in memory. The binary operators used in this expression ... be stored in memory, what is the minimum number of registers needed to evaluate this expression? $2$ $9$ $5$ $3$
asked Sep 29, 2014 in Compiler Design jothee 6.3k views
To see more, click for the full list of questions or popular tags.
...