@@ -5362,6 +5362,23 @@ LangAS CodeGenModule::GetGlobalVarAddressSpace(const
VarDecl *D) {
if (OpenMPRuntime->hasAllocateAttributeForGlobalVar(D, AS))
return AS;
}
+
+ if (LangOpts.HLSL) {
+if (D == nullptr)
+ return LangAS::hlsl_private;
+
+// Except
@@ -1468,9 +1468,14 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) {
// Set specific Vulkan version if applicable.
if (const Arg *A = Args.getLastArg(options::OPT_fspv_target_env_EQ)) {
- const llvm::StringSet<> ValidValues = {"vulkan1.2",
https://github.com/Keenuts created
https://github.com/llvm/llvm-project/pull/122103
In SPIR-V, private global variables have the `Private` storage class. This PR
adds a new address space which allows frontend to emit variable with this
storage class.
Before this change, global variable were e
@@ -58,6 +58,7 @@ enum class LangAS : unsigned {
// HLSL specific address spaces.
hlsl_groupshared,
+ hlsl_private,
Keenuts wrote:
Hi again! It's been a while, but this now went through an HLSL proposal.
https://github.com/llvm/wg-hlsl/commit/4c9e11aa507
Keenuts wrote:
Hi all!
This PR was dormant for a while because proposals had to be made & merged.
The HLSL proposal which covers `hlsl_private` is now merged:
https://github.com/llvm/wg-hlsl/commit/4c9e11aa50727c53b10d232195fb88fd5376f19c
https://github.com/llvm/llvm-project/pull/122103
__
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/122103
From c11ace708fab316f422e12cf9785a5a362d7250c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Thu, 28 Nov 2024 15:00:56 +0100
Subject: [PATCH 1/2] [SPIR-V] Add hlsl_private address space for
@@ -0,0 +1,501 @@
+//===- LowerGPUIntrinsic.cpp
--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
https://github.com/Keenuts approved this pull request.
https://github.com/llvm/llvm-project/pull/130672
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -57,22 +58,37 @@ void main(unsigned GI : SV_GroupIndex) {
// CHECK: define void @main()
// CHECK-NEXT: entry:
// Verify destructor is emitted
-// NOINLINE-NEXT: call void @_GLOBAL__sub_I_GlobalDestructors.hlsl()
-// NOINLINE-NEXT: %0 = call i32 @llvm.dx.flattened.th
https://github.com/Keenuts edited
https://github.com/llvm/llvm-project/pull/133468
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5386,6 +5386,23 @@ LangAS CodeGenModule::GetGlobalVarAddressSpace(const
VarDecl *D) {
if (OpenMPRuntime->hasAllocateAttributeForGlobalVar(D, AS))
return AS;
}
+
+ if (LangOpts.HLSL) {
+if (D == nullptr)
+ return LangAS::hlsl_private;
+
+// Except
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -std=hlsl202x
-emit-llvm -o - -disable-llvm-passes %s | FileCheck %s --check-prefixes=CHECK
+// RUN: %clang_cc1 -triple spirv-pc-vulkan1.3-compute -std=hlsl202x -emit-llvm
-o - -disable-llvm-passes %s |
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/122103
From c11ace708fab316f422e12cf9785a5a362d7250c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Thu, 28 Nov 2024 15:00:56 +0100
Subject: [PATCH 1/3] [SPIR-V] Add hlsl_private address space for
https://github.com/Keenuts created
https://github.com/llvm/llvm-project/pull/133469
Destructor calls were emitted without convergence
intrinsics when building for SPIR-V, which means invalid IR since we mixed
controlled and non-controlled convergence.
From 339d410e981b5172c57d9802e0a0fcc117575
https://github.com/Keenuts edited
https://github.com/llvm/llvm-project/pull/133464
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Keenuts approved this pull request.
minor comments, otherwise OK
https://github.com/llvm/llvm-project/pull/133468
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -386,13 +386,22 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getHLSLType(
if (ContainedTy.isNull())
return nullptr;
-assert(!ResAttrs.RawBuffer &&
- "Raw buffers handles are not implemented for SPIR-V yet");
assert(!ResAttrs.IsROV &&
https://github.com/Keenuts created
https://github.com/llvm/llvm-project/pull/133464
In SPIR-V, private global variables have the Private storage class. This PR
adds a new address space which allows frontend to emit variable with this
storage class when targeting this backend.
This is covered
Keenuts wrote:
> Is there a reason we can't do this in Sema? It would probably be ideal to
> have the AST represent the address spaces of values accurately.
Hello! So I didn't recalled the details on why, so I made another PR which
implements this in sema (https://github.com/llvm/llvm-project/
https://github.com/Keenuts edited
https://github.com/llvm/llvm-project/pull/133464
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -711,13 +711,14 @@
BuiltinTypeDeclBuilder::addHandleAccessFunction(DeclarationName &Name,
using PH = BuiltinTypeMethodBuilder::PlaceHolder;
QualType ElemTy = getHandleElementType();
- // TODO: Map to an hlsl_device address space.
- QualType ElemPtrTy = AST.getPointer
@@ -386,13 +386,29 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getHLSLType(
if (ContainedTy.isNull())
return nullptr;
-assert(!ResAttrs.RawBuffer &&
- "Raw buffers handles are not implemented for SPIR-V yet");
assert(!ResAttrs.IsROV &&
@@ -386,13 +386,22 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getHLSLType(
if (ContainedTy.isNull())
return nullptr;
-assert(!ResAttrs.RawBuffer &&
- "Raw buffers handles are not implemented for SPIR-V yet");
assert(!ResAttrs.IsROV &&
201 - 223 of 223 matches
Mail list logo