edited by
683 views
0 0 votes

Consider the following control flow graph

The live-variable analysis determines for each point $p$ in a program which variables are live at that point. A live variable v at point p is one where there exists a path from point p to another point q where v is used without v being redefined anywhere along that path.

The sets for the livevariable dataflow problem are:
use[b] = variables used in block b before any definition
def[b] = variables defined in block $b$ and not later killed in $b$
in $[\mathrm{b}]=$ variables live on entry to block $b$
out [b] = variables live on exit from block b
The dataflow equations for live variables are
in [b] = use[b] $\cup$ (out[b] $-\operatorname{def}[b])$
$\operatorname{out}[b]=U_{s \in \operatorname{Succ}[b]} \operatorname{in}[s]$

What will be the in and out set for basic block B2?

  1. in- $\{x, y\}$, out- $\{x, y\}$
  2. in- $\{x, y\}$, out- $\{y, z\}$
  3. in- $\{\mathrm{x}, \mathrm{y}\}$, out- $\{\mathrm{x}, \mathrm{y}, \mathrm{z}\}$
  4. in- $\{x, y, a, b\}$, out- $\{y, z\}$

1 Answer

Position:
Show:

Related questions

1 1 vote
1 1 answer
819
819 views
꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂ asked Oct 21, 2024
819 views
Given a SR ARQ No of bits for Sequence Number =4 which one of the following window size will not protocol failures<ol style="list-style-type:upper-alpha"><li Ws= 5 Wr= 9 ...
0 0 votes
1 answers 1 answer
511
511 views
Rajsukh Mohanty asked Nov 10, 2023
511 views
Is the simplification that I have encircled, done right? because according to negation law (r ∨ ¬ r) ≡ T.P2: $\begin{aligned} & {[(\mathbf{p} \rightarrow \mathbf{q}) \ve...
0 0 votes
1 answers 1 answer
1.2k
1.2k views
DAWID15 asked Dec 22, 2022
1,152 views
Options:10, 12,14, 16, 18, 2020, 18, 16, 14, 12, 1012, 10, 16, 14, 20, 18NONEGiven the following doubly linked list with the normal node definition.What is printed if the...
0 0 votes
2 answers 2 answers
1.5k
1.5k views
DAWID15 asked Dec 19, 2022
1,541 views
I’m getting 2 as the answer, but the correct one given by them is 5.Somebody please confirm.Consider the following snapshot of a system's states, with three processes and...