[clang] [llvm] [clang][OpenMP][SPIR-V] Fix addrspace of global constants (PR #134399)
sarnex wrote: This will be fixed by my existing PR https://github.com/llvm/llvm-project/pull/135251 I will add that test case and add you guys as reviewers, thanks and sorry for the trouble. https://github.com/llvm/llvm-project/pull/134399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][OpenMP][SPIR-V] Fix addrspace of global constants (PR #134399)
sarnex wrote: Investigating now, thanks! https://github.com/llvm/llvm-project/pull/134399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][OpenMP][SPIR-V] Fix addrspace of global constants (PR #134399)
ShangwuYao wrote: This test reproduces the issue above: ``` // RUN: %clang_cc1 -fcuda-is-device -triple spirv32 -o - -emit-llvm -x cuda %s | FileCheck %s // RUN: %clang_cc1 -fcuda-is-device -triple spirv64 -o - -emit-llvm -x cuda %s | FileCheck %s // CHECK: @.str = private unnamed_addr addrspace(4) constant [13 x i8] c"Hello World\0A\00", align 1 extern "C" __attribute__((device)) int printf(const char* format, ...); __attribute__((global)) void printf_kernel() { printf("Hello World\n"); } ``` Could you also add the test case as test/CodeGenCUDASPIRV/printf.cu or something? Thanks!! https://github.com/llvm/llvm-project/pull/134399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][OpenMP][SPIR-V] Fix addrspace of global constants (PR #134399)
sarnex wrote: @alexfh FYI I expect the problem is in LLVM and not the translator, but it's not that this change is totally wrong it's just a missed case as the goal of this commit was to add the address space, not remove it. https://github.com/llvm/llvm-project/pull/134399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][OpenMP][SPIR-V] Fix addrspace of global constants (PR #134399)
alexfh wrote: This is being looked into. If this turns out to be a problem in LLVM rather than in the SPIRV-LLVM-Translator, I'll let you know here. https://github.com/llvm/llvm-project/pull/134399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][OpenMP][SPIR-V] Fix addrspace of global constants (PR #134399)
sarnex wrote: No, tbe string should have an address space. Do you have a reproduction? https://github.com/llvm/llvm-project/pull/134399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][OpenMP][SPIR-V] Fix addrspace of global constants (PR #134399)
alexfh wrote: We've started seeing errors similar to this one after this commit: ``` Can't translate llvm instruction: Global variable can not have Function storage class. Consider setting a proper address space. Original LLVM value: @.str.2 = private unnamed_addr constant [19 x i8] c"%s at %s:%d in %s\0A\00", align 1 ``` Is this the expected effect of the change? https://github.com/llvm/llvm-project/pull/134399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][OpenMP][SPIR-V] Fix addrspace of global constants (PR #134399)
https://github.com/sarnex closed https://github.com/llvm/llvm-project/pull/134399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][OpenMP][SPIR-V] Fix addrspace of global constants (PR #134399)
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/134399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][OpenMP][SPIR-V] Fix addrspace of global constants (PR #134399)
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/134399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits