Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Hi, what is the rationale here? This reuses the logic that was written for OpenCL mode, but in OpenCL mode, it was made an error with the idea that a new keyword addrspace_cast could be used in those cases where the user actually wants an address space cast. Here, in SYCL mode, it's just made an error with no way out for the user that I can see if they actually want this. Is this really correct?
Edit: apologies, I misread what was done with addrspace_cast, that new operator only allows conversions that are otherwise also allowed. Based on that, this change does actually align with what was done for OpenCL mode, it does not restrict anything that is allowed in OpenCL mode. It does make sense, then. A slightly more verbose commit message might have helped though :)
Even better, some comments in the code explaining the "why" would have helped. The commit messages disappear while the comments are right there when the code is read/reviewed.
I misread what was done with addrspace_cast, that new operator only allows conversions that are otherwise also allowed. Based on that, this change does actually align with what was done for OpenCL mode, it does not restrict anything that is allowed in OpenCL mode. It does make sense, then. A slightly more verbose commit message might have helped though :)
Right, the intention of this change is to re-use OpenCL mode logic. There is no connection between addrspace_cast operator and this change. In fact, there is no such operator in SYCL.
Even better, some comments in the code explaining the "why" would have helped.
I was under impression that the change is small and therefore easy to understand. Would some comment like "SYCL re-uses OpenCL mode diagnostics to emit errors in case the cast happens between disjoint address spaces" help?
Speaking only for myself, but it was clear to me that that's what it did. What wasn't clear to me was why that's okay, and that was because I was under the impression that there were ways around this in OpenCL that are unavailable in SYCL. What might have helped me was a comment not saying that the cast is also an error is OpenCL mode, but that there is no way at all to express the conversion in OpenCL mode. This is all in hindsight though, I am not sure to what extent my confusion was foreseeable.