News for hackers. Stuff that matters.
Re:Swiftc – SIL and its not-so-basic blocks by DannyBee on Monday November 02, 2015 @06:17PM (#10496107)
A few issues:

One, passes have to special case BB arguments whether they are phi nodes or not ;)

IE this doesn't actually make something like constant propagation easier. You still have to perform the meet operations. You still have to go and look what arguments were passed to your basic block.

In the phi node case, they are right there. I assume they link the basic block parameters to things passing those parameters, in which case: they are essentially phi nodes.

Second. It's really easy to create phi nodes. Creating basic blocks is a heavyweight thing (maybe not in SIL, but in general).

For most compilers, creating basic blocks requires messing with the CFG, update dominator info, etc.

However, if want to put something in loop closed SSA form, i can just drop in a bunch of phi nodes without messing with the CFG. In their form, i'd have to add basic block arguments to a bunch of blocks.

Additionally, phi nodes have natural analogues, like in SSI form, etc.

It's harder to represent the splitting operating sigma nodes perform in a basic block form. ;-)

Re:Swiftc – SIL and its not-so-basic blocks by Rusky on Monday November 02, 2015 @08:03PM (#10496660)
I've seen another IR that replaced phi nodes with BB arguments, but they also replaced return with continuations, leading to a kind of best-of-both-worlds cross between SSA and CPS. They were able to implement a bunch of interesting optimizations on closures, in an imperative language.

http://compilers.cs.uni-saarland.de/papers/lkh15_cgo.pdf

Re:Swiftc – SIL and its not-so-basic blocks by l_dopa on Monday November 02, 2015 @05:57PM (#10495992)
People recognized ~20 years ago that, semantically, SSA is just reinventing lexical scope:

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.3...

Re:Swiftc – SIL and its not-so-basic blocks by DannyBee on Monday November 02, 2015 @06:18PM (#10496114)
IBM knew this when they invented it (note: Ken Zadeck was my officemate when i worked at IBM ;P)

The original pass was called RNN - right number of names.

Re:Swiftc – SIL and its not-so-basic blocks by gsg on Tuesday November 03, 2015 @12:26AM (#10497746)
Interesting. MLton did the basic-blocks-with-arguments thing too:

  http://mlton.org/pipermail/mlton/2007-February/029597.html
  http://mlton.org/pipermail/mlton/2003-January/023061.html
Re:Swiftc – SIL and its not-so-basic blocks by prestonbriggs on Monday November 02, 2015 @07:10PM (#10496420)
Reminds me of Steele's Rabbit compiler (as noted by Appel and probably others). Always made a lot of sense to me, though I never worked out the details. I thought in terms of every basic block taking arguments (in registers), and every branch passing some arguments. Lexical scoping gives us a way to express common arguments. This should be interesting to read and think about.