[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-05 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > I think the point is there are two things going on here that people think of > as unqualified: > > 1. "Give me a pointer that's whatever `void *` is" > 2. "Give me a pointer in some address space just so I can put a global in > some metadata" > > The vast majority of the time

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-05 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx commented: > I don't think that assumption is currently true. I think it's also worth > clarifying what this thing is, and possibly renaming it, because > "unqualified" has C language level meaning that would contradict what it is > here. It's probably optimistic,

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-05 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx edited https://github.com/llvm/llvm-project/pull/94388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-05 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/94388 >From cdf95a804614950167d2d4df227d06a86a70d4bb Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 4 Jun 2024 19:52:28 +0100 Subject: [PATCH] Unqualified `ptr`s should be truly unqualified, and not AS0 ptrs. -

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-05 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx edited https://github.com/llvm/llvm-project/pull/94388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-06-05 Thread Alex Voicu via cfe-commits
@@ -1,4 +1,5 @@ ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s +; RUN: llc -O0 -mtriple=spirv64-amd-amdhsa %s -o - | FileCheck %s AlexVlx wrote: I've rolled back most of these, except for a couple of places where there is a substantive d

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-06-05 Thread Alex Voicu via cfe-commits
@@ -56,6 +56,10 @@ static std::string computeDataLayout(const Triple &TT) { if (Arch == Triple::spirv32) return "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-" "v96:128-v192:256-v256:256-v512:512-v1024:1024-G1"; + if (TT.getVendor() == Triple::VendorType::AMD

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-06 Thread Alex Voicu via cfe-commits
@@ -51,9 +51,11 @@ struct CodeGenTypeCache { llvm::IntegerType *PtrDiffTy; }; + /// unqualified void* + llvm::PointerType *UnqualPtrTy; AlexVlx wrote: I'm not opposed to this in principle; might have some additional benefits in that it forces people

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-06 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/94388 >From cdf95a804614950167d2d4df227d06a86a70d4bb Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 4 Jun 2024 19:52:28 +0100 Subject: [PATCH] Unqualified `ptr`s should be truly unqualified, and not AS0 ptrs. -

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-06 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/94388 >From cdf95a804614950167d2d4df227d06a86a70d4bb Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 4 Jun 2024 19:52:28 +0100 Subject: [PATCH 1/2] Unqualified `ptr`s should be truly unqualified, and not AS0 ptrs

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-06 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/94388 >From cdf95a804614950167d2d4df227d06a86a70d4bb Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 4 Jun 2024 19:52:28 +0100 Subject: [PATCH 1/2] Unqualified `ptr`s should be truly unqualified, and not AS0 ptrs

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-06-07 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx closed https://github.com/llvm/llvm-project/pull/89796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-06-07 Thread Alex Voicu via cfe-commits
AlexVlx wrote: Thank you everyone for the reviews! https://github.com/llvm/llvm-project/pull/89796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-07 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > And I still strongly urge renaming what this is, given it is _not_ the type > for an unqualified C `void *`, as one would normally expect given it's in > Clang. Perhaps DummyPtrTy? DummyPtrTy seems mnemonic / on point, but it might trigger antibodies from the LLVM side:) Perh

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-07 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > There are still quite a few references to UnqualPtrTy that you're not > changing yet are now wrong, no? > > ``` > $ git grep --count '\' origin/main clang > origin/main:clang/lib/CodeGen/CGAtomic.cpp:1 > origin/main:clang/lib/CodeGen/CGBlocks.cpp:1 > origin/main:clang/lib/CodeG

[clang] [llvm] [clang][Driver] Add HIPAMD Driver support for AMDGCN flavoured SPIR-V (PR #95061)

2024-06-10 Thread Alex Voicu via cfe-commits
@@ -128,12 +128,13 @@ enum class CudaArch { GFX12_GENERIC, GFX1200, GFX1201, + AMDGCNSPIRV, Generic, // A processor model named 'generic' if the target backend defines a // public one. LAST, CudaDefault = CudaArch::SM_52, - HIPDefault = CudaArch::

[clang] [llvm] [clang][Driver] Add HIPAMD Driver support for AMDGCN flavoured SPIR-V (PR #95061)

2024-06-10 Thread Alex Voicu via cfe-commits
@@ -128,12 +128,13 @@ enum class CudaArch { GFX12_GENERIC, GFX1200, GFX1201, + AMDGCNSPIRV, Generic, // A processor model named 'generic' if the target backend defines a // public one. LAST, CudaDefault = CudaArch::SM_52, - HIPDefault = CudaArch::

[clang] [llvm] [clang][Driver] Add HIPAMD Driver support for AMDGCN flavoured SPIR-V (PR #95061)

2024-06-12 Thread Alex Voicu via cfe-commits
@@ -128,12 +128,13 @@ enum class CudaArch { GFX12_GENERIC, GFX1200, GFX1201, + AMDGCNSPIRV, Generic, // A processor model named 'generic' if the target backend defines a // public one. LAST, CudaDefault = CudaArch::SM_52, - HIPDefault = CudaArch::

[clang] [clang][CodeGen] Add query for a target's flat address space (PR #95728)

2024-06-16 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx created https://github.com/llvm/llvm-project/pull/95728 Often, targets which are not address space agnostic expose a flat/generic address space, which acts as a shared, legal target for address space casts. Whilst today we accidentally (e.g. by using `PointerType::ge

[clang] [clang][CodeGen] Add query for a target's flat address space (PR #95728)

2024-06-16 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx edited https://github.com/llvm/llvm-project/pull/95728 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Add query for a target's flat address space (PR #95728)

2024-06-16 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/95728 >From 2b500ad9ef2baf27da29146b5a4123dcb75e Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Mon, 17 Jun 2024 02:15:00 +0100 Subject: [PATCH] Add interface for exposing a target's flat address space, if it exi

[clang] [clang][CodeGen] Add query for a target's flat address space (PR #95728)

2024-06-17 Thread Alex Voicu via cfe-commits
@@ -1764,6 +1764,13 @@ class TargetInfo : public TransferrableTargetInfo, return 0; } + /// \returns Target specific flat ptr address space; a flat ptr is a ptr that + /// can be casted to / from all other target address spaces. If the target + /// exposes no such add

[clang] [clang][CodeGen] Add query for a target's flat address space (PR #95728)

2024-06-17 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/95728 >From 2b500ad9ef2baf27da29146b5a4123dcb75e Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Mon, 17 Jun 2024 02:15:00 +0100 Subject: [PATCH 1/2] Add interface for exposing a target's flat address space, if it

[clang] [llvm] [clang][Driver] Add HIPAMD Driver support for AMDGCN flavoured SPIR-V (PR #95061)

2024-06-17 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx edited https://github.com/llvm/llvm-project/pull/95061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][Driver] Add HIPAMD Driver support for AMDGCN flavoured SPIR-V (PR #95061)

2024-06-17 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx commented: Gentle ping. https://github.com/llvm/llvm-project/pull/95061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Add query for a target's flat address space (PR #95728)

2024-06-17 Thread Alex Voicu via cfe-commits
@@ -1764,6 +1764,13 @@ class TargetInfo : public TransferrableTargetInfo, return 0; } + /// \returns Target specific flat ptr address space; a flat ptr is a ptr that + /// can be casted to / from all other target address spaces. If the target + /// exposes no such add

[clang] [clang][CodeGen] Add query for a target's flat address space (PR #95728)

2024-06-17 Thread Alex Voicu via cfe-commits
@@ -1764,6 +1764,13 @@ class TargetInfo : public TransferrableTargetInfo, return 0; } + /// \returns Target specific flat ptr address space; a flat ptr is a ptr that + /// can be casted to / from all other target address spaces. If the target + /// exposes no such add

[clang] [llvm] [clang][Driver] Add HIPAMD Driver support for AMDGCN flavoured SPIR-V (PR #95061)

2024-06-18 Thread Alex Voicu via cfe-commits
@@ -907,7 +907,8 @@ void CodeGenModule::Release() { if (Context.getTargetInfo().getTriple().isWasm()) EmitMainVoidAlias(); - if (getTriple().isAMDGPU()) { + if (getTriple().isAMDGPU() || + (getTriple().isSPIRV() && getTriple().getVendor() == llvm::Triple::AMD)) {

[clang] [llvm] [clang][Driver] Add HIPAMD Driver support for AMDGCN flavoured SPIR-V (PR #95061)

2024-06-18 Thread Alex Voicu via cfe-commits
@@ -907,7 +907,8 @@ void CodeGenModule::Release() { if (Context.getTargetInfo().getTriple().isWasm()) EmitMainVoidAlias(); - if (getTriple().isAMDGPU()) { + if (getTriple().isAMDGPU() || + (getTriple().isSPIRV() && getTriple().getVendor() == llvm::Triple::AMD)) {

[clang] [clang][CodeGen] Add query for a target's flat address space (PR #95728)

2024-06-19 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/95728 >From 2b500ad9ef2baf27da29146b5a4123dcb75e Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Mon, 17 Jun 2024 02:15:00 +0100 Subject: [PATCH 1/2] Add interface for exposing a target's flat address space, if it

[clang] [clang][CodeGen] Add query for a target's flat address space (PR #95728)

2024-06-19 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/95728 >From 2b500ad9ef2baf27da29146b5a4123dcb75e Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Mon, 17 Jun 2024 02:15:00 +0100 Subject: [PATCH 1/3] Add interface for exposing a target's flat address space, if it

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-28 Thread Alex Voicu via cfe-commits
@@ -368,7 +368,8 @@ CodeGenModule::CodeGenModule(ASTContext &C, IntTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getIntWidth()); IntPtrTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getMaxPointerWidth()); - Int8PtrTy = llvm::PointerType::get(LL

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-28 Thread Alex Voicu via cfe-commits
@@ -368,7 +368,8 @@ CodeGenModule::CodeGenModule(ASTContext &C, IntTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getIntWidth()); IntPtrTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getMaxPointerWidth()); - Int8PtrTy = llvm::PointerType::get(LL

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx edited https://github.com/llvm/llvm-project/pull/88182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-28 Thread Alex Voicu via cfe-commits
@@ -368,7 +368,8 @@ CodeGenModule::CodeGenModule(ASTContext &C, IntTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getIntWidth()); IntPtrTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getMaxPointerWidth()); - Int8PtrTy = llvm::PointerType::get(LL

[clang] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx created https://github.com/llvm/llvm-project/pull/93601 Currently we: - emit the elements of the `used` and `compiler.used` arrays as default pointers - assume that the payloads for global ctors/dtors reside in the default AS, and thus use a default pointer to access

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx edited https://github.com/llvm/llvm-project/pull/93601 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93601 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH] Fix `emitUsed` to place `used` globals in the Global AS. Update tes

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93601 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH 1/2] Fix `emitUsed` to place `used` globals in the Global AS. Update

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
@@ -2047,9 +2047,9 @@ void CodeGenModule::EmitCtorList(CtorList &Fns, const char *GlobalName) { llvm::Type *CtorPFTy = llvm::PointerType::get(CtorFTy, TheModule.getDataLayout().getProgramAddressSpace()); - // Get the type of a ctor entry, { i32, void ()*, i8* }. + /

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
@@ -2047,9 +2047,9 @@ void CodeGenModule::EmitCtorList(CtorList &Fns, const char *GlobalName) { llvm::Type *CtorPFTy = llvm::PointerType::get(CtorFTy, TheModule.getDataLayout().getProgramAddressSpace()); - // Get the type of a ctor entry, { i32, void ()*, i8* }. + /

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93601 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH 1/3] Fix `emitUsed` to place `used` globals in the Global AS. Update

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
@@ -2928,12 +2928,13 @@ static void emitUsed(CodeGenModule &CGM, StringRef Name, for (unsigned i = 0, e = List.size(); i != e; ++i) { UsedArray[i] = llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast( -cast(&*List[i]), CGM.Int8PtrTy); ---

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
@@ -2047,9 +2047,9 @@ void CodeGenModule::EmitCtorList(CtorList &Fns, const char *GlobalName) { llvm::Type *CtorPFTy = llvm::PointerType::get(CtorFTy, TheModule.getDataLayout().getProgramAddressSpace()); - // Get the type of a ctor entry, { i32, void ()*, i8* }.

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-30 Thread Alex Voicu via cfe-commits
@@ -2928,12 +2928,13 @@ static void emitUsed(CodeGenModule &CGM, StringRef Name, for (unsigned i = 0, e = List.size(); i != e; ++i) { UsedArray[i] = llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast( -cast(&*List[i]), CGM.Int8PtrTy); ---

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-30 Thread Alex Voicu via cfe-commits
@@ -2928,12 +2928,13 @@ static void emitUsed(CodeGenModule &CGM, StringRef Name, for (unsigned i = 0, e = List.size(); i != e; ++i) { UsedArray[i] = llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast( -cast(&*List[i]), CGM.Int8PtrTy); ---

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-05-30 Thread Alex Voicu via cfe-commits
@@ -1,4 +1,5 @@ ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s +; RUN: llc -O0 -mtriple=spirv64-amd-amdhsa %s -o - | FileCheck %s AlexVlx wrote: Yup, you are right; my thinking was to prevent anyone getting ideas and diverging the "flavo

[clang] [llvm] Global constructors/destructors are globals (PR #93914)

2024-05-30 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx created https://github.com/llvm/llvm-project/pull/93914 Currently the payload for global ctors/dtors is passed as an unqualified pointer, which relies on the target being reasonable regarding what AS 0 means, and also is overly conservative. This change correctly pla

[clang] [llvm] [clang][CodeGen] Global constructors/destructors are globals (PR #93914)

2024-05-30 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx edited https://github.com/llvm/llvm-project/pull/93914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-30 Thread Alex Voicu via cfe-commits
@@ -2047,9 +2047,9 @@ void CodeGenModule::EmitCtorList(CtorList &Fns, const char *GlobalName) { llvm::Type *CtorPFTy = llvm::PointerType::get(CtorFTy, TheModule.getDataLayout().getProgramAddressSpace()); - // Get the type of a ctor entry, { i32, void ()*, i8* }.

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-30 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93601 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH 1/4] Fix `emitUsed` to place `used` globals in the Global AS. Update

[clang] [llvm] [clang][CodeGen] Global constructors/destructors are globals (PR #93914)

2024-05-30 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93914 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH 1/8] Fix `emitUsed` to place `used` globals in the Global AS. Update

[clang] [llvm] [clang][CodeGen] Global constructors/destructors are globals (PR #93914)

2024-05-30 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93914 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH 1/8] Fix `emitUsed` to place `used` globals in the Global AS. Update

[clang] [llvm] [clang][CodeGen] Global constructors/destructors are globals (PR #93914)

2024-05-31 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > llvm datalayout defines > > P - program addr space for functions G - global addr space for global > variables > > https://llvm.org/docs/LangRef.html#langref-datalayout > > should we use P for llvm.global_ctors instead of G? > llvm datalayout defines > > P - program addr s

[clang] [llvm] [clang][CodeGen] Global constructors/destructors are globals (PR #93914)

2024-05-31 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > The third argument here is like for llvm.used, it's a way to associate the > entry with a global or function. If the corresponding global or function is > omitted from the output then the entry will be removed. It isn't used for > anything at run time. So I think there should

[clang] [llvm] [clang][CodeGen] Global constructors/destructors are globals (PR #93914)

2024-06-03 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93914 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH 1/8] Fix `emitUsed` to place `used` globals in the Global AS. Update

[clang] [llvm] [clang][CodeGen] Global constructors/destructors are globals (PR #93914)

2024-06-03 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93914 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH 1/9] Fix `emitUsed` to place `used` globals in the Global AS. Update

[clang] [llvm] [clang][CodeGen] Global constructors/destructors are globals (PR #93914)

2024-06-03 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93914 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH 01/10] Fix `emitUsed` to place `used` globals in the Global AS. Upda

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-06-03 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93601 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH 1/5] Fix `emitUsed` to place `used` globals in the Global AS. Update

[clang] [llvm] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-06-03 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93601 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH 1/6] Fix `emitUsed` to place `used` globals in the Global AS. Update

[clang] [llvm] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-06-03 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93601 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH 1/6] Fix `emitUsed` to place `used` globals in the Global AS. Update

[clang] [llvm] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-06-03 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93601 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH 1/7] Fix `emitUsed` to place `used` globals in the Global AS. Update

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-04 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx created https://github.com/llvm/llvm-project/pull/94388 At the moment we alias `UnqualPtrTy` with the other default AS pointer types, which means that for certain targets using it doesn't actually yield an unqualified pointer. This patch changes that so that it does

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-04 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/94388 >From cdf95a804614950167d2d4df227d06a86a70d4bb Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 4 Jun 2024 19:52:28 +0100 Subject: [PATCH] Unqualified `ptr`s should be truly unqualified, and not AS0 ptrs. -

[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. --- c

[clang] [llvm] [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 1/2] Add AS 1 for Globals in the SPIR & SPIRV datalayout strings. -

[clang] [llvm] [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 edited 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] [llvm] [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 commented: > Please also fix llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp Done. https://github.com/llvm/llvm-project/pull/88455 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [llvm] [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 1/3] Add AS 1 for Globals in the SPIR & SPIRV datalayout strings. -

[clang] [llvm] [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 edited 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] [llvm] [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 commented: > > 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] [llvm] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

2024-04-16 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx closed 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] [llvm] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

2024-04-16 Thread Alex Voicu via cfe-commits
AlexVlx wrote: Merged, thanks everyone for the reviews! 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] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-16 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/88182 >From 426e74cabb003eb5dc83adf347a5800d49bc87b7 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Mon, 18 Mar 2024 11:49:12 + Subject: [PATCH 1/7] Start migrating away from the embedded assumption that the defa

[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-16 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/88182 >From 426e74cabb003eb5dc83adf347a5800d49bc87b7 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Mon, 18 Mar 2024 11:49:12 + Subject: [PATCH 1/8] Start migrating away from the embedded assumption that the defa

[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-16 Thread Alex Voicu via cfe-commits
@@ -3581,8 +3582,10 @@ ConstantAddress CodeGenModule::GetAddrOfTemplateParamObject( isExternallyVisible(TPO->getLinkageAndVisibility().getLinkage()) ? llvm::GlobalValue::LinkOnceODRLinkage : llvm::GlobalValue::InternalLinkage; - auto *GV = new llvm::

[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-16 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/88182 >From 426e74cabb003eb5dc83adf347a5800d49bc87b7 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Mon, 18 Mar 2024 11:49:12 + Subject: [PATCH 1/8] Start migrating away from the embedded assumption that the defa

[clang] [clang][SPIR-V] Set AS for the SPIR-V logical triple (PR #88939)

2024-04-16 Thread Alex Voicu via cfe-commits
AlexVlx wrote: a) Thanks!; b) apologies for the noise; c) this was actually done on purpose, I actively eschewed changing Logical SPIRV because it wasn't actually clear to me if in the long run it'd have the same AS map / would use numerical 1 for globals. If Logical SPIRV is going to go with

[clang] [clang][SPIR-V] Set AS for the SPIR-V logical triple (PR #88939)

2024-04-16 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx approved this pull request. LGTM, please have a peek at the comment if possible. https://github.com/llvm/llvm-project/pull/88939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-23 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx created https://github.com/llvm/llvm-project/pull/89796 This change seeks to add support for vendor flavoured SPIRV - more specifically, AMDGCN flavoured SPIRV. The aim is to generate SPIRV that carries some extra bits of information that are only usable by AMDGCN ta

[clang] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-23 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/89796 >From 662f160418c704f45e57e751168903d774b74303 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 23 Apr 2024 17:41:25 +0100 Subject: [PATCH 1/2] Add initial support for AMDGCN flavoured SPIRV. --- clang/lib/

[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-23 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/88182 >From 426e74cabb003eb5dc83adf347a5800d49bc87b7 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Mon, 18 Mar 2024 11:49:12 + Subject: [PATCH 1/8] Start migrating away from the embedded assumption that the defa

[clang] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-23 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > How much of this is actually different from the existing target info for > AMDGCN? Seems like we're doing a lot of redundant stuff like defining macros > or features. That's part of the point, it's not actually supposed to differ in those particular regards, up to the point w

[clang] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-23 Thread Alex Voicu via cfe-commits
@@ -54,3 +56,289 @@ void SPIRV64TargetInfo::getTargetDefines(const LangOptions &Opts, BaseSPIRVTargetInfo::getTargetDefines(Opts, Builder); DefineStd(Builder, "SPIRV64", Opts); } + +static constexpr Builtin::Info BuiltinInfo[] = { +#define BUILTIN(ID, TYPE, ATTRS)

[clang] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-23 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > > > How much of this is actually different from the existing target info for > > > AMDGCN? Seems like we're doing a lot of redundant stuff like defining > > > macros or features. > > > > > > That's part of the point, it's not actually supposed to differ in those > > particul

[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-23 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/88182 >From 426e74cabb003eb5dc83adf347a5800d49bc87b7 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Mon, 18 Mar 2024 11:49:12 + Subject: [PATCH 1/8] Start migrating away from the embedded assumption that the defa

[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-23 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/88182 >From 426e74cabb003eb5dc83adf347a5800d49bc87b7 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Mon, 18 Mar 2024 11:49:12 + Subject: [PATCH 1/9] Start migrating away from the embedded assumption that the defa

[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-23 Thread Alex Voicu via cfe-commits
@@ -2216,7 +2216,7 @@ static llvm::Value *EmitTypeidFromVTable(CodeGenFunction &CGF, const Expr *E, } llvm::Value *CodeGenFunction::EmitCXXTypeidExpr(const CXXTypeidExpr *E) { - llvm::Type *PtrTy = llvm::PointerType::getUnqual(getLLVMContext()); + llvm::Type *PtrTy = Int8Pt

[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-24 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/88182 >From 426e74cabb003eb5dc83adf347a5800d49bc87b7 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Mon, 18 Mar 2024 11:49:12 + Subject: [PATCH 01/10] Start migrating away from the embedded assumption that the de

[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-24 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx commented: > This adds a third copy of the same test, can we just merge them add add three > RUN lines with different CHECK prefixes? I've merged the address-space related ones, but I've left the basic one in place. https://github.com/llvm/llvm-project/pull/88182 _

[clang] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-24 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx edited https://github.com/llvm/llvm-project/pull/88182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-24 Thread Alex Voicu via cfe-commits
@@ -2216,7 +2216,7 @@ static llvm::Value *EmitTypeidFromVTable(CodeGenFunction &CGF, const Expr *E, } llvm::Value *CodeGenFunction::EmitCXXTypeidExpr(const CXXTypeidExpr *E) { - llvm::Type *PtrTy = llvm::PointerType::getUnqual(getLLVMContext()); + llvm::Type *PtrTy = Int8Pt

[clang] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-24 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/89796 >From 662f160418c704f45e57e751168903d774b74303 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 23 Apr 2024 17:41:25 +0100 Subject: [PATCH 1/2] Add initial support for AMDGCN flavoured SPIRV. --- clang/lib/

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-24 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/89796 >From 662f160418c704f45e57e751168903d774b74303 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 23 Apr 2024 17:41:25 +0100 Subject: [PATCH 1/3] Add initial support for AMDGCN flavoured SPIRV. --- clang/lib/

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-24 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/89796 >From 662f160418c704f45e57e751168903d774b74303 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 23 Apr 2024 17:41:25 +0100 Subject: [PATCH 1/4] Add initial support for AMDGCN flavoured SPIRV. --- clang/lib/

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-25 Thread Alex Voicu via cfe-commits
@@ -0,0 +1,294 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// RUN: %clang_cc1 -triple spirv64-amd-amdhsa -x hip \ +// RUN: -aux-triple x86_64-unknown-linux-gnu -fcuda-is-device -emit-llvm %s \ +// RUN: -o - | FileCheck %s + +// RUN: %clang_

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/89796 >From 662f160418c704f45e57e751168903d774b74303 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 23 Apr 2024 17:41:25 +0100 Subject: [PATCH 1/4] Add initial support for AMDGCN flavoured SPIRV. --- clang/lib/

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/89796 >From 662f160418c704f45e57e751168903d774b74303 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 23 Apr 2024 17:41:25 +0100 Subject: [PATCH 1/5] Add initial support for AMDGCN flavoured SPIRV. --- clang/lib/

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Alex Voicu via cfe-commits
@@ -54,3 +56,77 @@ void SPIRV64TargetInfo::getTargetDefines(const LangOptions &Opts, BaseSPIRVTargetInfo::getTargetDefines(Opts, Builder); DefineStd(Builder, "SPIRV64", Opts); } + +namespace { +const AMDGPUTargetInfo AMDGPUTI(llvm::Triple("amdgcn-amd-amdhsa"), {}); + +} //

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/89796 >From 662f160418c704f45e57e751168903d774b74303 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 23 Apr 2024 17:41:25 +0100 Subject: [PATCH 1/6] Add initial support for AMDGCN flavoured SPIRV. --- clang/lib/

<    1   2   3   4   5   6   7   >