Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spirv] opphi generation #65

Closed
sylware opened this issue Aug 30, 2015 · 4 comments
Closed

[spirv] opphi generation #65

sylware opened this issue Aug 30, 2015 · 4 comments

Comments

@sylware
Copy link

sylware commented Aug 30, 2015

Is there a way to make glslang generate some basic spirv using intermediate
object ids which would be used in an opphi instruction (which can use only intermediate object id).
It seems the variable/opstore/opload work around is always used.

@johnkslang
Copy link
Member

Generally eliminating a bunch of load/stores ("mem -> reg") is future work. It does make an OpPhi for a do-while loop to handle continue, though that very special case might go away with an upcoming control-flow change to SPIR-V.

@sylware
Copy link
Author

sylware commented Sep 11, 2015 via email

@johnkslang
Copy link
Member

No, not significantly. Still the same CFG with the same concept of annotating nested structure on top of it. I shouldn't have made a future-looking statement.

The minor point is the current OpPhi generated is pretty special case and might change, and the major point is how/when/should glslang generally generate "in register" form of data flow, which would involve OpPhi in general when control flow is present. I don't have answers right now.

@johnkslang
Copy link
Member

Update: The recent change (7c1aa10) to handle && and || short circuiting was done using OpPhi, so it is now pretty easy to get OpPhi to show up (use a non-trivial right operand to && or ||).

Example pseudo code:

r1 <- left operand
if (r1)
    r2 <- right operand
r3 = phi(r1, r2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants