2 ms·
As I explained in my footnote, you can do the same thing with SSA form: if (x == 0) jump B1 else jump B2 B1: x1 = phi(x) y1 = 2 * x1 jump joi
by jcranmer 6y ago
As I explained in my footnote, you can do the same thing with SSA form:
if (x == 0) jump B1 else jump B2
B1:
x1 = phi(x)
y1 = 2 * x1
jump join
B2:
x2 = phi(x)
y2 = 3 * x2
jump join
join:
y = phi(y1, y2)
And then you can do the same propagation of the x == 0 to the phi in B1 pretty easily. It is somewhat harder than the basic-block argument case, but that's because basic block arguments rely on the data binding being put in the head of the edge and we're pushing data from the head into the edge. The next step of checking if all incoming edges are identically 0 would be easier in the phi-form, since the data binding is in the tail node, and we're pulling data from the edge into the tail.