6
$\begingroup$

I have read somewhere about an alternative SSA representation that doesn't use phi nodes but instead uses parameterized basic blocks.

Something like this in an SSA with phi:

block_a:
    value_a = ...
    jump block_c
block_b:
    value_b = ...
    jump block_c
block_c:
    value_c = phi (block_a: value_a), (block_b: value_b)
    ...

Would look like this in SSA with parameterized basic blocks:

block_a:
    value_a = ...
    jump block_c(value_a)
block_b:
    value_b = ...
    jump block_c(value_b)
block_c(value_c):
    ...

My two questions are:

  1. What is this called?
  2. What other alternatives to phi nodes exists in SSA?
$\endgroup$
2
  • 1
    $\begingroup$ If you look at the connections between ANF/CPS and SSA, how $\varphi$ nodes are represented on the ANF/CPS side is similar to this. I believe Clang or the Swift compiler uses something like what you are talking about. $\endgroup$ Commented Sep 21, 2018 at 20:43
  • $\begingroup$ Block parameters, as used in Swift's Intermediate Language, are basically what I want. $\endgroup$
    – oconnor0
    Commented Sep 23, 2018 at 22:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.