[clang] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

2024-04-15 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/88455 >From 6d9e979f09802b94310017901b5b6b58bfa05c1c Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Fri, 12 Apr 2024 00:21:02 +0100 Subject: [PATCH] Add AS 1 for Globals in the SPIR & SPIRV datalayout strings. ---

[clang] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

2024-04-15 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Please also fix llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp https://github.com/llvm/llvm-project/pull/88455 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

2024-04-15 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts approved this pull request. https://github.com/llvm/llvm-project/pull/88455 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

2024-04-15 Thread Michal Paszkowski via cfe-commits
https://github.com/michalpaszkowski approved this pull request. LGTM (from the SPIR-V backend side)! https://github.com/llvm/llvm-project/pull/88455 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

2024-04-14 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > Thanks @AlexVlx for this change. This should work fine for > SPIRV-LLVM-Translator (and SPIR-V backend). Adding @michalpaszkowski for > input from SPIR-V backend side. Recently, this restriction on LLVM IR input > to our translator was docuemnted: >

[clang] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

2024-04-14 Thread Arvind Sudarsanam via cfe-commits
asudarsa wrote: Thanks @AlexVlx for this change. This should work fine for SPIRV-LLVM-Translator (and SPIR-V backend). Adding @michalpaszkowski for input from SPIR-V backend side. Recently, this restriction on LLVM IR input to our translator was docuemnted:

[clang] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

2024-04-12 Thread Alexey Bader via cfe-commits
https://github.com/bader commented: > I'll emphasise that this is only a problem for things such as implicitly > generated globals (e.g. VTables or typeinfo for classes etc.) I suppose usage of VTables and typeinfo is kind of restricted in GPU programming models. Right? Anyway, I think it's

[clang] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

2024-04-12 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > The change seems reasonable. > > > CodeGen/LLVM will default to AS0 in this case, which produces Globals that > > end up in the private address space for e.g. OCL, HIPSPV or SYCL. > > Can we add a test checking LLVM address space for globals emitted from > OCL/HIPSPV/SYCL,

[clang] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

2024-04-12 Thread Alexey Bader via cfe-commits
bader wrote: The change seems reasonable. > CodeGen/LLVM will default to AS0 in this case, which produces Globals that > end up in the private address space for e.g. OCL, HIPSPV or SYCL. Can we add a test checking LLVM address space for globals emitted from OCL/HIPSPV/SYCL, please? It's

[clang] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

2024-04-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Alex Voicu (AlexVlx) Changes Currently neither the SPIR nor the SPIRV targets specify the AS for globals in their datalayout strings. This is problematic because CodeGen/LLVM will default to AS0 in this case, which produces Globals that

[clang] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

2024-04-11 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx created https://github.com/llvm/llvm-project/pull/88455 Currently neither the SPIR nor the SPIRV targets specify the AS for globals in their datalayout strings. This is problematic because CodeGen/LLVM will default to AS0 in this case, which produces Globals that