🎲 Very-busy expression analysis
reasoning.page·2h

Post is in these categories:

An expression e is very busy at a point p if for every path from p, the expression is used before any of the constituent parts of e are redefined. For example:

a = 0
b = 0
t = a + b // a + b is very busy, because it is used on the only path (to the definition of w) without being redefined
u = a - b
v = a * b
w = (a + b) * 2

a = 0
b = 0
t = a + b // a + b is not very busy, because we redefine a (= 0) before we use the value
u = a - b
v = a * b
a = 0
w = (a + b) * 2

How can this be computed as a dataflow analysis? We start at the use-sites, and propagate this information backwards through the control-flow graph. Consider a single node in the control-flow graph. There are two cases that we can consider

  1. The base case: if we def…

Similar Posts

Loading similar posts...