[clang] [Clang] Allow all address spaces to be converted to the default (PR #112248)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 14 13:15:10 PDT 2024


================
@@ -721,7 +721,9 @@ class Qualifiers {
            // to implicitly cast into the default address space.
            (A == LangAS::Default &&
             (B == LangAS::cuda_constant || B == LangAS::cuda_device ||
-             B == LangAS::cuda_shared));
+             B == LangAS::cuda_shared)) ||
+           // Otherwise, assume the default address space is compatible.
+           (A == LangAS::Default);
----------------
jhuber6 wrote:

Yeah I noted  there's actually a case where OpenCL touches this for function pointers. I might just have the OpenCL language call a different version of this. Overall the other targets just allow any AS to decay to default and that's likely the behavior we want when not bound by OpenCL semantics.

https://github.com/llvm/llvm-project/pull/112248


More information about the cfe-commits mailing list