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

TornadoVM does not fully respect the SSA form during LIR building #74

Closed
gigiblender opened this issue Mar 28, 2021 · 3 comments
Closed
Assignees

Comments

@gigiblender
Copy link
Member

In case of if conditions we respect the SSA:

z_295  =  i_159 == i_4;
  if(z_295)
  {
    ....

In case of for loops, I am not sure we do:

i_4  =  i_3;
  for(;i_4 < 8;)  {
    ....
    i_15  =  i_14 + i_4;
    i_4  =  i_15;
  }

I am not sure this is an actual problem and open this issue for discussion.

@jjfumero
Copy link
Member

Thanks for the report @gigiblender. We will need all in SSA for the SPIRV backend, .

Maybe an assignment is missing:

OCLLIRStmt.AssignStmt(result, value)

So, when we process the order of the loop:

https://github.com/mikepapadim/TornadoVM/blob/master/drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompilationResultBuilder.java#L203-L243

We would need to add this instruction before evaluating the condition and pass the result value of the assignment to the loop-condition. Would that solve the problem?

@jjfumero
Copy link
Member

This was not an issue for the SPIR-V backend. Shall we close this issue, @gigiblender ?

@jjfumero
Copy link
Member

jjfumero commented Dec 7, 2021

@gigiblender , this does seem to be an issue with the SPIRV, which respects the SSA representation. I will close this issue.

@jjfumero jjfumero closed this as completed Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants