[swift-dev] SIL proposal: remove multiple results from SILValue

Erik Eckstein eeckstein at apple.com
Fri Dec 4 11:06:40 CST 2015


currently some instructions, like alloc_stack and alloc_box (I think they are the only ones) return 2 values. For this we have the "result number" in SILValue, e.g. %3#0, %3#1

We could represent the same by using a projection instruction, e.g.

 %3 = alloc_stack $Type  // == the old %3#0
 %4 = project_stack %1   // == the old %3#1

And actually we already have the project_box instruction.

This would simplify SILValues and many places in optimization passes/analysis. Yesterday I spent several hours to debug a problem where in some pass the wrong result number was used.

What do you think?


More information about the swift-dev mailing list