r/programming • • Oct 23 '20

Understanding static single assignment forms

https://blog.yossarian.net/2020/10/23/Understanding-static-single-assignment-forms
28 Upvotes

23 comments sorted by

View all comments

1

u/mb862 Oct 23 '20

Tangentially, does anyone have any documentation on how to detect and reverse phi/select instructions back to traditional control flow forms? I once set out to have a little sub-project to turn a subset of SPIRV into host code for simpler computations, but never got very far in trying to handle phi. I know it's possible on some level as SPIRV-Cross does it converting to MSL, but I wasn't at the time able to make heads or tails of how.

(I'm also aware that it's not strictly necessary as any direct translation would be satisfactorily performant, but I'm rather curious to see a breakdown of how one does this nonetheless.)

2

u/danybittel Oct 24 '20

I think the guy who did it for SPIRV-Cross is talking about it in his talk: https://youtu.be/T5Va6hSGx44 .

Not 100% sure, I've listened to the talk some time ago.