[PATCH] D25305: [OpenCL] Setting constant address space for array initializers

Alexey Sotkin via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 24 01:51:21 PDT 2016


AlexeySotkin added inline comments.


================
Comment at: lib/CodeGen/CGDecl.cpp:1272
+    if (getLangOpts().OpenCL) {
+      UA = llvm::GlobalValue::UnnamedAddr::None;
+      AS = CGM.getContext().getTargetAddressSpace(LangAS::opencl_constant);
----------------
Anastasia wrote:
> Why this change?
Without this change, global variables with unnamed address space are translated to SPIR-V as variables with "Function" storage class, which is wrong.
This should fix this issue: https://github.com/KhronosGroup/SPIRV-LLVM/issues/50


https://reviews.llvm.org/D25305





More information about the cfe-commits mailing list