[clang] [HLSL][NFC] Add assert to verify implicit binding resource attribute exists (PR #156094)

2025-08-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/156094 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Add assert to verify implicit binding resource attribute exists (PR #156094)

2025-08-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/156094 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Global resource arrays element access (PR #152454)

2025-08-29 Thread Helena Kotas via cfe-commits
@@ -84,6 +85,111 @@ void addRootSignature(llvm::dxbc::RootSignatureVersion RootSigVer, RootSignatureValMD->addOperand(MDVals); } +// Find array variable declaration from nested array subscript AST nodes +static const ValueDecl *getArrayDecl(const ArraySubscriptExpr *ASE) {

[clang] [HLSL][NFC] Add assert to verify the implicit binding resource attribute exists (PR #156094)

2025-08-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/156094 None >From 8823f63a2ea5dbb471de9d0535585cb4f923f45a Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 29 Aug 2025 13:10:18 -0700 Subject: [PATCH] [HLSL] Add assert to verify the resource binding attr exists

[clang] [HLSL] Codegen for indexing of sub-arrays of multi-dimensional resource arrays (PR #154248)

2025-08-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/154248 >From 75a7511da94a609d7b2c944d3719a60057f9fa53 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 14 Aug 2025 23:32:05 -0700 Subject: [PATCH 1/3] [HLSL] Codegen for indexing of sub-arrays of multi-dimensiona

[clang] [HLSL] Codegen for indexing of sub-arrays of multi-dimensional resource arrays (PR #154248)

2025-08-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/154248 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Codegen for indexing of sub-arrays of multi-dimensional resource arrays (PR #154248)

2025-08-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/154248 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Codegen for indexing of sub-arrays of multi-dimensional resource arrays (PR #154248)

2025-08-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/154248 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Codegen for indexing of sub-arrays of multi-dimensional resource arrays (PR #154248)

2025-08-29 Thread Helena Kotas via cfe-commits
@@ -802,16 +869,14 @@ std::optional CGHLSLRuntime::emitResourceArraySubscriptExpr( ArraySubsExpr->getType()->isHLSLResourceRecordArray() && "expected resource array subscript expression"); - // let clang codegen handle local resource array subscripts -

[clang] [HLSL] Codegen for indexing of sub-arrays of multi-dimensional resource arrays (PR #154248)

2025-08-29 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,102 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-compute -finclude-default-header \ +// RUN: -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s + +// CHECK: @[[BufA:.*]] = private unnamed_addr constant [2 x i8] c"A\00", align 1 + +RWBuffer A[5][4][3][2]

[clang] [HLSL] Codegen for indexing of sub-arrays of multi-dimensional resource arrays (PR #154248)

2025-08-29 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,102 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-compute -finclude-default-header \ +// RUN: -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s + +// CHECK: @[[BufA:.*]] = private unnamed_addr constant [2 x i8] c"A\00", align 1 + +RWBuffer A[5][4][3][2]

[clang] [HLSL] Codegen for indexing of sub-arrays of multi-dimensional resource arrays (PR #154248)

2025-08-29 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,62 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-compute -finclude-default-header \ +// RUN: -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s + +// CHECK: @[[BufA:.*]] = private unnamed_addr constant [2 x i8] c"A\00", align 1 + +RWBuffer A[4][2] : regi

[clang] [llvm] [DirectX] Make dx.RawBuffer an op that can't be replaced (PR #154620)

2025-08-29 Thread Helena Kotas via cfe-commits
hekota wrote: > @hekota does this sound right to you? Sounds good! https://github.com/llvm/llvm-project/pull/154620 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Reorder arguments of __builtin_hlsl_resource_handlefromimplicitbinding (PR #155861)

2025-08-28 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/155861 Reorder the arguments of `__builtin_hlsl_resource_handlefromimplicitbinding` builtins to match the order of the `llvm.dx.resource.handlefromimplicitbinding` intrinsics, and also to match the arguments on the sta

[clang] [llvm] [HLSL][DirectX] Remove uniformity bit from resource initialization intrinsics (PR #155332)

2025-08-27 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/155332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Codegen for indexing of sub-arrays of multi-dimensional resource arrays (PR #154248)

2025-08-25 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/154248 >From 75a7511da94a609d7b2c944d3719a60057f9fa53 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 14 Aug 2025 23:32:05 -0700 Subject: [PATCH 1/2] [HLSL] Codegen for indexing of sub-arrays of multi-dimensiona

[clang] [HLSL] Add implicit binding attribute to resource arrays (PR #152452)

2025-08-25 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/152452 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add implicit binding attribute to resource arrays (PR #152452)

2025-08-25 Thread Helena Kotas via cfe-commits
@@ -3640,6 +3654,24 @@ void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) { // process explicit bindings processExplicitBindingsOnDecl(VD); + +if (VD->getType()->isHLSLResourceRecordArray()) { + // If the resource array does not have an explicit binding attri

[clang] [HLSL] Global resource arrays element access (PR #152454)

2025-08-25 Thread Helena Kotas via cfe-commits
@@ -84,6 +85,111 @@ void addRootSignature(llvm::dxbc::RootSignatureVersion RootSigVer, RootSignatureValMD->addOperand(MDVals); } +// Find array variable declaration from nested array subscript AST nodes +static const ValueDecl *getArrayDecl(const ArraySubscriptExpr *ASE) {

[clang] [HLSL] Global resource arrays element access (PR #152454)

2025-08-25 Thread Helena Kotas via cfe-commits
@@ -84,6 +85,111 @@ void addRootSignature(llvm::dxbc::RootSignatureVersion RootSigVer, RootSignatureValMD->addOperand(MDVals); } +// Find array variable declaration from nested array subscript AST nodes +static const ValueDecl *getArrayDecl(const ArraySubscriptExpr *ASE) {

[clang] [HLSL] Tests for local resource arrays (PR #153257)

2025-08-19 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/153257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Codegen for indexing of sub-arrays of multi-dimensional resource arrays (PR #154248)

2025-08-18 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/154248 Adds support for accessing sub-arrays from fixed-size multi-dimensional global resource arrays. Enables indexing into globally scoped, fixed-size resource arrays that have multiple dimensions when the result is

[clang] [HLSL] Codegen for indexing of sub-arrays of multi-dimensional resource arrays (PR #154248)

2025-08-18 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/154248 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Global resource arrays element access (PR #152454)

2025-08-18 Thread Helena Kotas via cfe-commits
@@ -700,3 +795,90 @@ void CGHLSLRuntime::emitInitListOpaqueValues(CodeGenFunction &CGF, } } } + +std::optional CGHLSLRuntime::emitResourceArraySubscriptExpr( +const ArraySubscriptExpr *ArraySubsExpr, CodeGenFunction &CGF) { + assert(ArraySubsExpr->getType()->isHLSLR

[clang] [HLSL] Global resource arrays element access (PR #152454)

2025-08-15 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/152454 >From 10a06e36e875cbc0259d0d95700e5c4ec9721f1a Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 7 Aug 2025 00:03:37 -0700 Subject: [PATCH 01/13] [HLSL] Add `isHLSLResourceRecordArray` method to `clang::Typ

[clang] [HLSL] Fix deprecation warnings in HLSL (PR #153310)

2025-08-13 Thread Helena Kotas via cfe-commits
https://github.com/hekota approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/153310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Global resource arrays element access (PR #152454)

2025-08-13 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/152454 >From 10a06e36e875cbc0259d0d95700e5c4ec9721f1a Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 7 Aug 2025 00:03:37 -0700 Subject: [PATCH 01/12] [HLSL] Add `isHLSLResourceRecordArray` method to `clang::Typ

[clang] [HLSL] Add implicit binding attribute to resource arrays (PR #152452)

2025-08-07 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/152452 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add implicit binding attribute to resource arrays (PR #152452)

2025-08-07 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/152452 >From 10a06e36e875cbc0259d0d95700e5c4ec9721f1a Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 7 Aug 2025 00:03:37 -0700 Subject: [PATCH 1/5] [HLSL] Add `isHLSLResourceRecordArray` method to `clang::Type`

[clang] [HLSL] Add `isHLSLResourceRecordArray` method to `clang::Type` (PR #152450)

2025-08-07 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/152450 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add `isHLSLResourceRecordArray` method to `clang::Type` (PR #152450)

2025-08-07 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/152450 >From 10a06e36e875cbc0259d0d95700e5c4ec9721f1a Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 7 Aug 2025 00:03:37 -0700 Subject: [PATCH 1/2] [HLSL] Add `isHLSLResourceRecordArray` method to `clang::Type`

[clang] [HLSL] Add `isHLSLResourceRecordArray` method to `clang::Type` (PR #152450)

2025-08-07 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/152450 None >From 10a06e36e875cbc0259d0d95700e5c4ec9721f1a Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 7 Aug 2025 00:03:37 -0700 Subject: [PATCH] [HLSL] Add `isHLSLResourceRecordArray` method to `clang::Typ

[clang] [HLSL] Add support for fixed-size global resource arrays (PR #152209)

2025-08-05 Thread Helena Kotas via cfe-commits
hekota wrote: Making this a draft for now because it only supports `register` binding and it will have conflicts with the change that adds `[[vk:binding]]` attribute (#150957). Once that gets merged, I will update this PR to resolve the conflicts and add `[[vk:binding]]` support for arrays as

[clang] [HLSL] Add support for fixed-size global resource arrays (PR #152209)

2025-08-05 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/152209 Adds support for fixed-size resource arrays declared at the global scope. When a global resource array is indexed to access an individual resource, codegen will translate the `ArraySubscriptExpr` into a construc

[clang] [HLSL][NFC] Move all resource tests under CodeGenHLSL\resources (PR #152035)

2025-08-05 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/152035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Move all resource tests under CodeGenHLSL\resources (PR #152035)

2025-08-04 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/152035 Also removes an outdated test buffer-array-operator.hlsl. Array operator on resources is tested in StructuredBuffers-subscripts.hlsl and RWBuffer-subscript.hlsl. >From 08da927a2831c304478d3aa2bbefe882c11c61f5 M

[clang] [HLSL][SPIRV] Add vk::binding attribute (PR #150957)

2025-08-04 Thread Helena Kotas via cfe-commits
https://github.com/hekota approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/150957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Add vk::binding attribute (PR #150957)

2025-08-04 Thread Helena Kotas via cfe-commits
@@ -593,6 +597,31 @@ static void initializeBuffer(CodeGenModule &CGM, llvm::GlobalVariable *GV, CGM.AddCXXGlobalInit(InitResFunc); } +static Value *buildNameForResource(llvm::StringRef BaseName, + CodeGenModule &CGM) { + std::string Str(Ba

[clang] [HLSL][SPIRV] Add vk::binding attribute (PR #150957)

2025-08-04 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/150957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implicit resource binding for cbuffers (PR #139022)

2025-07-06 Thread Helena Kotas via cfe-commits
@@ -539,19 +537,29 @@ static void initializeBuffer(CodeGenModule &CGM, llvm::GlobalVariable *GV, } static void initializeBufferFromBinding(CodeGenModule &CGM, -llvm::GlobalVariable *GV, unsigned Slot, -

[clang] [NFC][HLSL] Move Sema work from `ParseMicrosoftRootSignatureAttributeArgs` (PR #143184)

2025-06-06 Thread Helena Kotas via cfe-commits
@@ -3619,6 +3619,19 @@ class Sema final : public SemaBase { SourceLocation NameLoc, bool IsTemplateTypeArg); + /// Computes the unique Root Signature identifier from the given signature, -

[clang] [NFC][HLSL] Move Sema work from `ParseMicrosoftRootSignatureAttributeArgs` (PR #143184)

2025-06-06 Thread Helena Kotas via cfe-commits
@@ -3619,6 +3619,19 @@ class Sema final : public SemaBase { SourceLocation NameLoc, bool IsTemplateTypeArg); + /// Computes the unique Root Signature identifier from the given signature, + /// then l

[clang] [NFC][HLSL] Move Sema work from `ParseMicrosoftRootSignatureAttributeArgs` (PR #143184)

2025-06-06 Thread Helena Kotas via cfe-commits
@@ -4942,18 +4942,13 @@ void Parser::ParseMicrosoftRootSignatureAttributeArgs(ParsedAttributes &Attrs) { // Construct our identifier hekota wrote: Not really related to this change, I just noticed the `ParseMicrosoftRootSignatureAttributeArgs` name. Would

[clang] [HLSL] Make implicit binding warning off by default (PR #141879)

2025-05-29 Thread Helena Kotas via cfe-commits
hekota wrote: > We don't technically need to remove the `-Wno-implicit-binding` from the > tests, but I suppose you did the work anyway and it doesn't hurt. It will reduce the enlistment size by about 2.5kB ;). https://github.com/llvm/llvm-project/pull/141879 __

[clang] [HLSL] Make implicit binding warning off by default (PR #141879)

2025-05-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/141879 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Diagnose overlapping resource bindings (PR #140982)

2025-05-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/140982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Make implicit binding warning off by default (PR #141879)

2025-05-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/141879 >From 4ee791419132d8e3717a81418fe34a3e0bc4e727 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 28 May 2025 16:29:17 -0700 Subject: [PATCH] [HLSL] Make implicit binding warning off by default --- .../clan

[clang] [llvm] [DirectX] Update resource type names in DXIL metadata to include element type (PR #140937)

2025-05-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/140937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Use resource names when generating DXIL metadata (PR #140635)

2025-05-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/140635 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Detect resources with identical overlapping binding (PR #140645)

2025-05-28 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/140645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Use resource names when generating DXIL metadata (PR #140635)

2025-05-28 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/140635 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Use resource names when generating DXIL metadata (PR #140635)

2025-05-28 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/140635 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Gather resource names in DXIL resource analysis (PR #140633)

2025-05-28 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/140633 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Gather resource names in DXIL resource analysis (PR #140633)

2025-05-27 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/140633 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Add resource name argument to llvm.dx.handlefrom[implicit]binding intrinsics (PR #139991)

2025-05-27 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/139991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Add resource name argument to llvm.dx.handlefrom[implicit]binding intrinsics (PR #139991)

2025-05-27 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/139991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add resource name argument to resource class constructors (PR #139985)

2025-05-27 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/139985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Update Sema Checking Diagnostics for builtins (PR #138429)

2025-05-20 Thread Helena Kotas via cfe-commits
https://github.com/hekota approved this pull request. https://github.com/llvm/llvm-project/pull/138429 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add resource name argument to resource class constructors (PR #139985)

2025-05-19 Thread Helena Kotas via cfe-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/139985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add resource name argument to resource class constructors (PR #139985)

2025-05-19 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/139985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add resource name argument to resource class constructors (PR #139985)

2025-05-19 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/139985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add resource name argument to resource class constructors (PR #139985)

2025-05-16 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/139985 >From 8776c02d4f296f13f356c34707f4052f057c4538 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 14 May 2025 17:26:10 -0700 Subject: [PATCH] [HLSL] Add resource name argument to resource class constructors

[clang] [llvm] [HLSL] Add resource name argument to resource class constructors (PR #139985)

2025-05-16 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/139985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implicit resource binding for cbuffers (PR #139022)

2025-05-15 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/139022 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implicit resource binding for cbuffers (PR #139022)

2025-05-15 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/139022 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Add resource constructor with implicit binding for global resources (PR #138976)

2025-05-14 Thread Helena Kotas via cfe-commits
@@ -55,11 +55,33 @@ export void foo() { // CHECK-SAME: i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) // CHECK-NEXT: ret void -// Buf2 initialization part 1 - FIXME: constructor with implicit binding does not exist yet; -// the global init function currently

[clang] [llvm] [HLSL] Add resource constructor with implicit binding for global resources (PR #138976)

2025-05-14 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/138976 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-se

[clang] [HLSL][NFC] Simplify resource constructors codegen tests (PR #139842)

2025-05-14 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/139842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Simplify resource constructors codegen tests (PR #139842)

2025-05-14 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/139842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Simplify resource constructors codegen tests (PR #139842)

2025-05-13 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/139842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Simplify resource constructors codegen tests (PR #139842)

2025-05-13 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/139842 None Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,s

[clang] [llvm] [HLSL] Add resource constructor with implicit binding for global resources (PR #138976)

2025-05-13 Thread Helena Kotas via cfe-commits
@@ -55,11 +55,33 @@ export void foo() { // CHECK-SAME: i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) // CHECK-NEXT: ret void -// Buf2 initialization part 1 - FIXME: constructor with implicit binding does not exist yet; -// the global init function currently

[clang] [llvm] [HLSL] Add resource constructor with implicit binding for global resources (PR #138976)

2025-05-13 Thread Helena Kotas via cfe-commits
@@ -668,6 +668,26 @@ BuiltinTypeDeclBuilder::addHandleConstructorFromBinding() { .finalize(); } +BuiltinTypeDeclBuilder & +BuiltinTypeDeclBuilder::addHandleConstructorFromImplicitBinding() { + if (Record->isCompleteDefinition()) hekota wrote: If I reca

[clang] [llvm] [HLSL] Add resource constructor with implicit binding for global resources (PR #138976)

2025-05-13 Thread Helena Kotas via cfe-commits
@@ -3269,27 +3285,42 @@ static bool initVarDeclWithCtor(Sema &S, VarDecl *VD, return true; } -static bool initGlobalResourceDecl(Sema &S, VarDecl *VD) { +bool SemaHLSL::initGlobalResourceDecl(VarDecl *VD) { + std::optional RegisterSlot; + uint32_t SpaceNo = 0; HLSLResou

[clang] [llvm] [HLSL] Add resource constructor with implicit binding for global resources (PR #138976)

2025-05-12 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/138976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Add resource constructor with implicit binding for global resources (PR #138976)

2025-05-12 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/138976 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-se

[clang] [llvm] [HLSL] Add resource constructor with implicit binding for global resources (PR #138976)

2025-05-12 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/138976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Test cleanup - remove function attributes (PR #139302)

2025-05-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/139302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Update Sema Checking Diagnostics for builtins (PR #138429)

2025-05-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/138429 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Update Sema Checking Diagnostics for builtins (PR #138429)

2025-05-09 Thread Helena Kotas via cfe-commits
@@ -2164,30 +2085,49 @@ static bool CheckModifiableLValue(Sema *S, CallExpr *TheCall, return true; } -static bool CheckNoDoubleVectors(Sema *S, CallExpr *TheCall) { - auto checkDoubleVector = [](clang::QualType PassedType) -> bool { -if (const auto *VecTy = PassedType-

[clang] [HLSL] Update Sema Checking Diagnostics for builtins (PR #138429)

2025-05-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota commented: Look good! One suggestion and a one question why the diag message uses has `double` when the argument is `float`. https://github.com/llvm/llvm-project/pull/138429 ___ cfe-commits mailing list cfe-commits@lists.llvm

[clang] [HLSL] Update Sema Checking Diagnostics for builtins (PR #138429)

2025-05-09 Thread Helena Kotas via cfe-commits
@@ -42,47 +42,47 @@ float2 test_mad_element_type_mismatch(half2 p0, float2 p1) { float2 test_builtin_mad_float2_splat(float p0, float2 p1) { return __builtin_hlsl_mad(p0, p1, p1); - // expected-error@-1 {{all arguments to '__builtin_hlsl_mad' must be vectors}} + // expect

[clang] [HLSL] Update Sema Checking Diagnostics for builtins (PR #138429)

2025-05-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/138429 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Test cleanup - remove function attributes (PR #139302)

2025-05-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/139302 The function attribute numbers are not stable. They are not part of the test and can be removed. >From 14eda614ef4d2f3d5617dcedd935adfe97ec9c1a Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 9 May 2025

[clang] [HLSL][NFC] Rename isImplicit() to hasRegisterStot() on HLSLResourceBindingAttr (PR #138964)

2025-05-08 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/138964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Rename isImplicit() to hasRegisterStot() on HLSLResourceBindingAttr (PR #138964)

2025-05-07 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/138964 Renaming because the name `isImplicit` is ambiguous. It can mean implicit attribute or implicit binding. >From 989c75d4376eaedfb8756bc564f81aee6199756a Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 7 M

[clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

2025-04-30 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/135287 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

2025-04-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/135287 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Treat classes and structs as packed by default (PR #137391)

2025-04-28 Thread Helena Kotas via cfe-commits
https://github.com/hekota approved this pull request. LGTM! One small nit. https://github.com/llvm/llvm-project/pull/137391 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Treat classes and structs as packed by default (PR #137391)

2025-04-28 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -ast-dump %s | FileCheck %s hekota wrote: This test should probably be in `clang/test/AST/HLSL`. https://github.com/llvm/llvm-project/pull/137391 ___

[clang] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-04-21 Thread Helena Kotas via cfe-commits
@@ -89,12 +89,12 @@ RESOURCE Buffer; // CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// CHECK-SUBSCRIPT: CXXMethodDecl {{.*}} operator[] 'const element_type &(unsigned int) const' +// CHECK-SUBSCRIPT: CXXMethodDecl

[clang] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-04-21 Thread Helena Kotas via cfe-commits
@@ -121,15 +121,15 @@ RESOURCE Buffer; // CHECK-SUBSCRIPT-NEXT: DeclRefExpr {{.*}} 'unsigned int' ParmVar {{.*}} 'Index' 'unsigned int' // CHECK-SUBSCRIPT-NEXT: AlwaysInlineAttr {{.*}} Implicit always_inline -// CHECK-NOSUBSCRIPT-NOT: CXXMethodDecl {{.*}} operator[] 'const el

[clang] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-04-21 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/127675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-04-21 Thread Helena Kotas via cfe-commits
https://github.com/hekota approved this pull request. LGTM! Just a couple of nits. Apologies for the delay, I was on vacation last week. :) https://github.com/llvm/llvm-project/pull/127675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/135120 >From 85001dcbc184491dfb24e9d2a39df46fd4c9a363 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 9 Apr 2025 18:17:26 -0700 Subject: [PATCH 1/5] Initialize resources by constructors - add resource record con

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Helena Kotas via cfe-commits
@@ -1,34 +1,117 @@ // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-DXIL +// FIXME: SPIR-V codegen of llvm.spv.resource.handlefrombinding and resource types is not yet implement

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Helena Kotas via cfe-commits
@@ -287,6 +287,24 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, RetTy, CGM.getHLSLRuntime().getCreateResourceGetPointerIntrinsic(), ArrayRef{HandleOp, IndexOp}); } + case Builtin::BI__builtin_hlsl_resource_createpoisonhandle: { +llvm

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/135120 >From 85001dcbc184491dfb24e9d2a39df46fd4c9a363 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 9 Apr 2025 18:17:26 -0700 Subject: [PATCH 1/4] Initialize resources by constructors - add resource record con

[clang] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-04-10 Thread Helena Kotas via cfe-commits
@@ -751,13 +751,14 @@ BuiltinTypeDeclBuilder::addHandleAccessFunction(DeclarationName &Name, using PH = BuiltinTypeMethodBuilder::PlaceHolder; QualType ElemTy = getHandleElementType(); - // TODO: Map to an hlsl_device address space. - QualType ElemPtrTy = AST.getPointer

  1   2   3   4   5   6   7   8   9   10   >