-
Notifications
You must be signed in to change notification settings - Fork 116
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
Fixed invalid register/variable swaps. #541
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ISSUE: It looks like the new BasicLoop unit tests are failing on OpenCL.
The generated code fails to compile, complaining about undeclared variables. My guess is that the intermediate phi nodes are not being declared.
@MoFtZ This was my bad as this PR was intended to be an initial draft, since the OpenCL version does not work at the moment 😃 |
87a7346
to
3584148
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ISSUE: The new BasicLoop unit tests are failing on OpenCL for O2.
Looks like an existing issue with CLCodeGenerator.GenerateCode(AddressSpaceCast value)
.
39e8e28
to
43d3123
Compare
@MoFtZ In fact, this patch caused another issue that was already present in the code generation parts related to |
This PR fixes a critical problem in the current
OpenCL
andPTX
backends. When swapping views inside loops and then accessing them, it could happen that the actual swap operations were not compiled correctly. Although the IR itself represented the operations in a legal way, the backends swapped the registers/variables involved without introducing temporary swap targets. This PR fixes this critical problem by introducing "Phi intermediate values". This concept allows us to reason about Phi values that need to be stored in temporary locations without overwriting their values.