[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

2024-10-31 Thread Helena Kotas via cfe-commits
@@ -359,6 +356,176 @@ struct TemplateParameterListBuilder { return Builder; } }; + +// Builder for methods of builtin types. Allows adding methods to builtin types +// using the builder pattern like this: +// +// BuiltinTypeMethodBuilder(Sema, RecordBuilder, "MethodName

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

2024-10-31 Thread Helena Kotas via cfe-commits
@@ -359,6 +356,176 @@ struct TemplateParameterListBuilder { return Builder; } }; + +// Builder for methods of builtin types. Allows adding methods to builtin types +// using the builder pattern like this: +// +// BuiltinTypeMethodBuilder(Sema, RecordBuilder, "MethodName

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

2024-11-10 Thread Helena Kotas via cfe-commits
@@ -343,27 +336,224 @@ struct TemplateParameterListBuilder { Params.clear(); QualType T = Builder.Template->getInjectedClassNameSpecialization(); -T = S.Context.getInjectedClassNameType(Builder.Record, T); +T = AST.getInjectedClassNameType(Builder.Record, T);

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

2024-11-08 Thread Helena Kotas via cfe-commits
@@ -109,22 +116,16 @@ struct BuiltinTypeDeclBuilder { } BuiltinTypeDeclBuilder & - addHandleMember(Sema &S, ResourceClass RC, ResourceKind RK, bool IsROV, - bool RawBuffer, + addHandleMember(ResourceClass RC, ResourceKind RK, bool IsROV, bool RawBuffer,

[clang] [HLSL][NFC] Remove RegisterBindingFlags struct (PR #108924)

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

[clang] [llvm] [HLSL] Remove `__builtin_hlsl_create_handle` (PR #109910)

2024-09-25 Thread Helena Kotas via cfe-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/109910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Allow resource type attributes only on __hlsl_resource_t (PR #110079)

2024-09-25 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/110079 Resource type attributes should only ever be used on the intangible type `__hlsl_resource_t`. This is a draft that also includes changes from PR llvm/llvm-project#109910. >From 970aab0a930e38dfd266c01065112602b

[clang] [llvm] [HLSL] Allow resource type attributes only on __hlsl_resource_t (PR #110079)

2024-09-25 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/110079 >From 970aab0a930e38dfd266c01065112602bb274a5e Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 25 Sep 2024 15:48:18 -0700 Subject: [PATCH 1/3] [HLSL] Allow resource type attributes only on __hlsl_resource

[clang] [llvm] [HLSL] Remove `__builtin_hlsl_create_handle` (PR #109910)

2024-09-25 Thread Helena Kotas via cfe-commits
https://github.com/hekota reopened https://github.com/llvm/llvm-project/pull/109910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Remove `__builtin_hlsl_create_handle` (PR #109910)

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

[clang] [llvm] [HLSL] Remove `__builtin_hlsl_create_handle` (PR #109910)

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

[clang] [llvm] [HLSL] Allow resource type attributes only on __hlsl_resource_t (PR #110079)

2024-09-26 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/110079 >From 970aab0a930e38dfd266c01065112602bb274a5e Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 25 Sep 2024 15:48:18 -0700 Subject: [PATCH 1/4] [HLSL] Allow resource type attributes only on __hlsl_resource

[clang] [llvm] [HLSL] Allow resource type attributes only on __hlsl_resource_t (PR #110079)

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

[clang] [llvm] [HLSL] Allow resource type attributes only on __hlsl_resource_t (PR #110079)

2024-09-26 Thread Helena Kotas via cfe-commits
@@ -6191,7 +6191,9 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode { HLSLAttributedResourceType(QualType Canon, QualType Wrapped, QualType Contained, const Attributes &Attrs) - : Type(HLSLAttributedResource, C

[clang] [llvm] [HLSL] Allow resource type attributes only on __hlsl_resource_t (PR #110079)

2024-09-26 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/110079 >From 970aab0a930e38dfd266c01065112602bb274a5e Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 25 Sep 2024 15:48:18 -0700 Subject: [PATCH 1/5] [HLSL] Allow resource type attributes only on __hlsl_resource

[clang] [llvm] [HLSL] Allow resource type attributes only on __hlsl_resource_t (PR #110079)

2024-09-26 Thread Helena Kotas via cfe-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/110079 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Replace element_type* handles in HLSLExternalSemaSource with __hlsl_resource_t builtin type (PR #110079)

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

[clang] [HLSL] Allow resource type attributes only on __hlsl_resource_t (PR #110143)

2024-09-26 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/110143 Resource type attributes should only ever be used on the intangible type `__hlsl_resource_t`. >From a6dbeeb3fe963563c3a876cafb60fee919cd2612 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 26 Sep 2024 09

[clang] [llvm] [HLSL] Replace `element_type*` handles in HLSLExternalSemaSource with `__hlsl_resource_t` builtin type (PR #110079)

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

[clang] [HLSL] Allow resource type attributes only on `__hlsl_resource_t` (PR #110143)

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

[clang] [llvm] [HLSL] Allow resource type attributes only on __hlsl_resource_t (PR #110079)

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

[clang] [llvm] [HLSL] Replace `element_type*` handles in HLSLExternalSemaSource with `__hlsl_resource_t` builtin type (PR #110079)

2024-09-26 Thread Helena Kotas via cfe-commits
@@ -2272,8 +2272,8 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const { #include "clang/Basic/AMDGPUTypes.def" #define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) case BuiltinType::Id: #include "clang/Basic/HLSLIntangibleTypes.def" - Width = 0; - Align = 8;

[clang] [llvm] [HLSL] Replace `element_type*` handles in HLSLExternalSemaSource with `__hlsl_resource_t` builtin type (PR #110079)

2024-09-26 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/110079 >From 970aab0a930e38dfd266c01065112602bb274a5e Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 25 Sep 2024 15:48:18 -0700 Subject: [PATCH 1/5] [HLSL] Allow resource type attributes only on __hlsl_resource

[clang] [llvm] [HLSL] Replace `element_type*` handles in HLSLExternalSemaSource with `__hlsl_resource_t` builtin type (PR #110079)

2024-09-26 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/110079 >From 970aab0a930e38dfd266c01065112602bb274a5e Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 25 Sep 2024 15:48:18 -0700 Subject: [PATCH 1/5] [HLSL] Allow resource type attributes only on __hlsl_resource

[clang] [HLSL] Allow resource type attributes only on `__hlsl_resource_t` (PR #110143)

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

[clang] [llvm] [HLSL] Replace `element_type*` handles in HLSLExternalSemaSource with `__hlsl_resource_t` builtin type (PR #110079)

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

[clang] [llvm] [HLSL] Remove `__builtin_hlsl_create_handle` (PR #109910)

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

[clang] [llvm] [HLSL] Remove `__builtin_hlsl_create_handle` (PR #109910)

2024-09-26 Thread Helena Kotas via cfe-commits
hekota wrote: > LGTM > > It's a shame we don't have a better way to review changes like this, so I'm a > little uncomfortable about a commit leaving things in a transitional state, > but I think my appreciation of being able to review this separately from the > next step outweighs that. Yeah

[clang] [llvm] [HLSL] Replace `element_type*` handles in HLSLExternalSemaSource with `__hlsl_resource_t` builtin type (PR #110079)

2024-09-26 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/110079 >From 970aab0a930e38dfd266c01065112602bb274a5e Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 25 Sep 2024 15:48:18 -0700 Subject: [PATCH 1/5] [HLSL] Allow resource type attributes only on __hlsl_resource

[clang] [HLSL] Make HLSLAttributesResourceType cannonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-09-27 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/110327 Translates `RWBuffer` and `StructuredBuffer` resources to DirectX target types `dx.TypedBuffer` and `dx.RawBuffer`. Includes a change of `HLSLAttributesResourceType` from 'sugar' type to full canonical type. Th

[clang] [HLSL] Make HLSLAttributesResourceType cannonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

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

[clang] [HLSL] Make HLSLAttributesResourceType cannonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

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

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

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

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-09-27 Thread Helena Kotas via cfe-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/110327 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Replace `element_type*` handles in HLSLExternalSemaSource with `__hlsl_resource_t` builtin type (PR #110079)

2024-09-27 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/110079 >From 970aab0a930e38dfd266c01065112602bb274a5e Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 25 Sep 2024 15:48:18 -0700 Subject: [PATCH 1/5] [HLSL] Allow resource type attributes only on __hlsl_resource

[clang] [llvm] [DirectX] Remove trivially dead functions at linkage finalize (PR #106146)

2024-09-20 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,80 @@ +; RUN: opt -S -dxil-finalize-linkage -mtriple=dxil-unknown-shadermodel6.5-compute %s | FileCheck %s +; RUN: llc %s --filetype=asm -o - | FileCheck %s + +target triple = "dxilv1.5-pc-shadermodel6.5-compute" + +; Confirm that DXILFinalizeLinkage will remove functi

[clang] [llvm] [DirectX] Remove trivially dead functions at linkage finalize (PR #106146)

2024-09-20 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,80 @@ +; RUN: opt -S -dxil-finalize-linkage -mtriple=dxil-unknown-shadermodel6.5-compute %s | FileCheck %s +; RUN: llc %s --filetype=asm -o - | FileCheck %s + +target triple = "dxilv1.5-pc-shadermodel6.5-compute" + +; Confirm that DXILFinalizeLinkage will remove functi

[clang] [llvm] [DirectX] Remove trivially dead functions at linkage finalize (PR #106146)

2024-09-20 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,80 @@ +; RUN: opt -S -dxil-finalize-linkage -mtriple=dxil-unknown-shadermodel6.5-compute %s | FileCheck %s +; RUN: llc %s --filetype=asm -o - | FileCheck %s + +target triple = "dxilv1.5-pc-shadermodel6.5-compute" + +; Confirm that DXILFinalizeLinkage will remove functi

[clang] [llvm] [DirectX] Remove trivially dead functions at linkage finalize (PR #106146)

2024-09-20 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,80 @@ +; RUN: opt -S -dxil-finalize-linkage -mtriple=dxil-unknown-shadermodel6.5-compute %s | FileCheck %s +; RUN: llc %s --filetype=asm -o - | FileCheck %s + +target triple = "dxilv1.5-pc-shadermodel6.5-compute" + +; Confirm that DXILFinalizeLinkage will remove functi

[clang] [llvm] [DirectX] Remove trivially dead functions at linkage finalize (PR #106146)

2024-09-20 Thread Helena Kotas via cfe-commits
@@ -19,20 +19,20 @@ using namespace llvm; static bool finalizeLinkage(Module &M) { - SmallPtrSet EntriesAndExports; + SmallPtrSet Funcs; // Find all entry points and export functions for (Function &EF : M.functions()) { -if (!EF.hasFnAttribute("hlsl.shader") && !

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-10-01 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/110327 >From 4f235c0e9c539cdaa2bab9a7f8228f33c0fea2b8 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 26 Sep 2024 14:34:16 -0700 Subject: [PATCH 1/4] Add codegen for existing resource types and make HLSLAttribut

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-09-30 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/110327 >From 4f235c0e9c539cdaa2bab9a7f8228f33c0fea2b8 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 26 Sep 2024 14:34:16 -0700 Subject: [PATCH 1/2] Add codegen for existing resource types and make HLSLAttribut

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-09-30 Thread Helena Kotas via cfe-commits
@@ -4488,6 +4488,30 @@ void CXXNameMangler::mangleType(const ArrayParameterType *T) { mangleType(cast(T)); } +void CXXNameMangler::mangleType(const HLSLAttributedResourceType *T) { + mangleType(T->getWrappedType()); + const HLSLAttributedResourceType::Attributes &Attrs =

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-09-30 Thread Helena Kotas via cfe-commits
@@ -4488,6 +4488,30 @@ void CXXNameMangler::mangleType(const ArrayParameterType *T) { mangleType(cast(T)); } +void CXXNameMangler::mangleType(const HLSLAttributedResourceType *T) { + mangleType(T->getWrappedType()); + const HLSLAttributedResourceType::Attributes &Attrs =

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-09-30 Thread Helena Kotas via cfe-commits
@@ -29,19 +29,48 @@ class DirectXTargetCodeGenInfo : public TargetCodeGenInfo { llvm::Type *DirectXTargetCodeGenInfo::getHLSLType(CodeGenModule &CGM, const Type *Ty) const { - auto *BuiltinTy = dyn_cast(Ty); - if (!BuiltinTy

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-09-30 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/110327 >From 4f235c0e9c539cdaa2bab9a7f8228f33c0fea2b8 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 26 Sep 2024 14:34:16 -0700 Subject: [PATCH 1/3] Add codegen for existing resource types and make HLSLAttribut

[clang] [HLSL][NFC] Update resource attribute tests (PR #108919)

2024-09-19 Thread Helena Kotas via cfe-commits
@@ -29,15 +29,21 @@ RWBuffer Buffer; // CHECK-NEXT: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <> implicit class RWBuffer definition // CHECK: FinalAttr 0x{{[0-9A-Fa-f]+}} <> Implicit final -// CHECK-NEXT: implicit h 'element_type * {{\[\[}}hlsl::resource_class(UAV)]] {{\[\[}}hlsl::co

[clang] [HLSL][NFC] Update resource attribute tests (PR #108919)

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

[clang] [llvm] [HLSL] Remove `__builtin_hlsl_create_handle` (PR #109910)

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

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-10-02 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/110327 >From 4f235c0e9c539cdaa2bab9a7f8228f33c0fea2b8 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 26 Sep 2024 14:34:16 -0700 Subject: [PATCH 1/6] Add codegen for existing resource types and make HLSLAttribut

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-10-02 Thread Helena Kotas via cfe-commits
@@ -4492,6 +4492,31 @@ void CXXNameMangler::mangleType(const ArrayParameterType *T) { mangleType(cast(T)); } +void CXXNameMangler::mangleType(const HLSLAttributedResourceType *T) { hekota wrote: Updated to use `mangleVendorQualifier`. https://github.com/l

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-10-02 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/110327 >From 4f235c0e9c539cdaa2bab9a7f8228f33c0fea2b8 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 26 Sep 2024 14:34:16 -0700 Subject: [PATCH 1/5] Add codegen for existing resource types and make HLSLAttribut

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-10-02 Thread Helena Kotas via cfe-commits
@@ -3753,6 +3754,32 @@ void MicrosoftCXXNameMangler::mangleType(const DependentBitIntType *T, Error(Range.getBegin(), "DependentBitInt type") << Range; } +void MicrosoftCXXNameMangler::mangleType(const HLSLAttributedResourceType *T, +

[clang] [HLSL][NFC] Remove RegisterBindingFlags struct (PR #108924)

2024-09-17 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/108924 >From 1dd552dfb6217804ba5e84a35e59e348622df581 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Mon, 16 Sep 2024 20:54:23 -0700 Subject: [PATCH 1/5] [HLSL][NFC] Remove RegisterBindingFlags struct When diagnosin

[clang] [HLSL] Add Append/ConsumeStructuredBuffer definitions to HLSLExternalSemaSource (PR #113643)

2024-11-06 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/113643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

2024-11-06 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/114148 >From 8c76f28c8a0ba3d087361141366968071fa3af6e Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Tue, 29 Oct 2024 16:02:26 -0700 Subject: [PATCH 1/6] [HLSL] Add Increment/DecrementCounter methods to structured b

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

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

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

2024-11-07 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,771 @@ +//===--- HLSLExternalSemaSource.cpp - HLSL Sema Source ===// hekota wrote: Oops! :) https://github.com/llvm/llvm-project/pull/114148 ___ cfe-commits mailing list cfe-commits@list

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

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

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Helena Kotas via cfe-commits
hekota wrote: > I have to admit I'm pretty confused about what the code is trying to do - the > ratio of new code added to new tests / changes to the tests is a bit > surprising. This means I can't look at the tests to try and understand what > the code change is for, but it also points at may

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

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

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -110,6 +110,19 @@ DeclBindingInfo *ResourceBindings::addDeclBindingInfo(const VarDecl *VD, ResourceClass ResClass) { assert(getDeclBindingInfo(VD, ResClass) == nullptr && "DeclBindingInfo already added"); +#if

[clang] [HLSL] Simplify debug check in ResourceBindings::addDeclBindingInfo (PR #112661)

2024-10-17 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/112661 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add implicit resource element type concepts to AST (PR #112600)

2024-11-06 Thread Helena Kotas via cfe-commits
https://github.com/hekota approved this pull request. Few minor things, otherwise LGTM! https://github.com/llvm/llvm-project/pull/112600 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add implicit resource element type concepts to AST (PR #112600)

2024-11-06 Thread Helena Kotas via cfe-commits
@@ -323,30 +324,127 @@ struct TemplateParameterListBuilder { S.Context, Builder.Record->getDeclContext(), SourceLocation(), SourceLocation(), /* TemplateDepth */ 0, Position, &S.Context.Idents.get(Name, tok::TokenKind::identifier), -/* Typename *

[clang] [HLSL] Add implicit resource element type concepts to AST (PR #112600)

2024-11-06 Thread Helena Kotas via cfe-commits
@@ -323,30 +324,127 @@ struct TemplateParameterListBuilder { S.Context, Builder.Record->getDeclContext(), SourceLocation(), SourceLocation(), /* TemplateDepth */ 0, Position, &S.Context.Idents.get(Name, tok::TokenKind::identifier), -/* Typename *

[clang] [HLSL] Add implicit resource element type concepts to AST (PR #112600)

2024-11-06 Thread Helena Kotas via cfe-commits
@@ -483,10 +581,105 @@ static BuiltinTypeDeclBuilder setupBufferType(CXXRecordDecl *Decl, Sema &S, .addDefaultHandleConstructor(S, RC); } +BinaryOperator *constructSizeOfLEQ16Expr(ASTContext &Context, + SourceLocation NameLoc, +

[clang] [HLSL] Add implicit resource element type concepts to AST (PR #112600)

2024-11-06 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/112600 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add Append/ConsumeStructuredBuffer definitions to HLSLExternalSemaSource (PR #113643)

2024-11-06 Thread Helena Kotas via cfe-commits
@@ -5,17 +5,27 @@ StructuredBuffer Buf : register(t10); RWStructuredBuffer Buf2 : register(u5, space1); +AppendStructuredBuffer Buf3 : register(u3); +ConsumeStructuredBuffer Buf4 : register(u4); -// CHECK: %"class.hlsl::StructuredBuffer" = type { target("dx.RawBuffer", floa

[clang] [HLSL] Add RasterizerOrderedStructuredBuffer definition to HLSLExternalSemaSource (PR #113648)

2024-11-06 Thread Helena Kotas via cfe-commits
@@ -5,17 +5,22 @@ StructuredBuffer Buf : register(t10); RWStructuredBuffer Buf2 : register(u5, space1); +RasterizerOrderedStructuredBuffer Buf5 : register(u1, space2); // CHECK: %"class.hlsl::StructuredBuffer" = type { target("dx.RawBuffer", float, 0, 0), float } // CHECK

[clang] [HLSL] Add RasterizerOrderedStructuredBuffer definition to HLSLExternalSemaSource (PR #113648)

2024-11-06 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/113648 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add Append/ConsumeStructuredBuffer definitions to HLSLExternalSemaSource (PR #113643)

2024-11-07 Thread Helena Kotas via cfe-commits
hekota wrote: I might be worth merging these tests into one, though I am not sure if we should have one for all buffers. I think it would be better to group them, like structured buffers, raw buffers, textures etc. We are also adding the AST for buffer method

[clang] [HLSL] Add Append/ConsumeStructuredBuffer definitions to HLSLExternalSemaSource (PR #113643)

2024-11-07 Thread Helena Kotas via cfe-commits
hekota wrote: Filled an issue to track: llvm/llvm-project#115412 https://github.com/llvm/llvm-project/pull/113643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [HLSL] Add Append/ConsumeStructuredBuffer definitions to HLSLExternalSemaSource (PR #113643)

2024-11-07 Thread Helena Kotas via cfe-commits
@@ -530,6 +530,28 @@ void HLSLExternalSemaSource::defineHLSLTypesWithForwardDeclarations() { .addArraySubscriptOperators() .completeDefinition(); }); + + Decl = + BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "AppendStructuredBuffer") + .addS

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

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

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #117608)

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

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #117608)

2024-11-25 Thread Helena Kotas via cfe-commits
hekota wrote: [First version](llvm/llvm-project#114148) of this PR was reverted because of build break. https://github.com/llvm/llvm-project/pull/117608 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

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

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-27 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,19 @@ +// 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 +// RUN-DISABLED: %clang_cc1 -triple spirv-vulkan-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-27 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,49 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -DEMPTY \ hekota wrote: Since the test now covers multiple buffers please rename it to ByteAddressBuffer**s**-AST.hlsl and update the PR title and description. https:

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

2024-11-09 Thread Helena Kotas via cfe-commits
@@ -271,53 +246,70 @@ struct BuiltinTypeDeclBuilder { return *this; } + FieldDecl *getResourceHandleField() { +FieldDecl *FD = Fields["h"]; hekota wrote: Both [] operator and lookup will add the field if it is not already there. I will update it t

[clang] [llvm] Revert "[HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (#114148)" (PR #117448)

2024-11-23 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/117448 This reverts commit 94bde8cdc39ff7e9c59ee0cd5edda882955242aa. >From 4edec79a02e7d32fe16e257f6151669a2f009d85 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Sat, 23 Nov 2024 11:43:29 -0800 Subject: [PATCH] Rev

[clang] [llvm] Revert "[HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (#114148)" (PR #117448)

2024-11-23 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/117448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Refactor resource buffers AST tests (PR #117659)

2024-11-26 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/117659 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Forward arguments in BuiltinTypeMethodBuilder::callBuiltin. NFC (PR #117789)

2024-11-26 Thread Helena Kotas via cfe-commits
@@ -502,7 +520,10 @@ struct BuiltinTypeMethodBuilder { HLSLParamModifierAttr::Spelling Modifier = HLSLParamModifierAttr::Keyword_in) { assert(Method == nullptr && "Cannot add param, method already

[clang] [HLSL] Implement RWBuffer::operator[] via __builtin_hlsl_resource_getpointer (PR #117017)

2024-11-26 Thread Helena Kotas via cfe-commits
https://github.com/hekota approved this pull request. https://github.com/llvm/llvm-project/pull/117017 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Update resource attribute tests (PR #108919)

2024-09-17 Thread Helena Kotas via cfe-commits
@@ -1,16 +1,25 @@ // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o - %s | FileCheck %s // CHECK: CXXRecordDecl 0x{{[0-9a-f]+}} {{.*}} struct MyBuffer definition -// CHECK: FieldDecl 0x{{[0-9a-f]+}} col:68 h '__hlsl_resource_t {{\[\[}}hlsl::reso

[clang] [HLSL][NFC] Update resource attribute tests (PR #108919)

2024-09-17 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/108919 >From ef22d6e40b6c835a4a46633ba87f2053285c1b49 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Mon, 16 Sep 2024 15:13:54 -0700 Subject: [PATCH 1/2] [HLSL][NFC] Update resource attribute tests - split resource

[clang] [HLSL][NFC] Remove RegisterBindingFlags struct (PR #108924)

2024-09-17 Thread Helena Kotas via cfe-commits
@@ -828,101 +831,85 @@ static void updateResourceClassFlagsFromRecordType(RegisterBindingFlags &Flags, const Type *FieldTy = FD->getType().getTypePtr(); if (const HLSLAttributedResourceType *AttrResType = dyn_cast(FieldTy)) { -updateResourceCl

[clang] [HLSL][NFC] Remove RegisterBindingFlags struct (PR #108924)

2024-09-17 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/108924 >From 1dd552dfb6217804ba5e84a35e59e348622df581 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Mon, 16 Sep 2024 20:54:23 -0700 Subject: [PATCH 1/4] [HLSL][NFC] Remove RegisterBindingFlags struct When diagnosin

[clang] [HLSL][NFC] Remove RegisterBindingFlags struct (PR #108924)

2024-09-17 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/108924 >From 1dd552dfb6217804ba5e84a35e59e348622df581 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Mon, 16 Sep 2024 20:54:23 -0700 Subject: [PATCH 1/4] [HLSL][NFC] Remove RegisterBindingFlags struct When diagnosin

[clang] [HLSL][NFC] Remove RegisterBindingFlags struct (PR #108924)

2024-09-17 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/108924 >From 1dd552dfb6217804ba5e84a35e59e348622df581 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Mon, 16 Sep 2024 20:54:23 -0700 Subject: [PATCH 1/5] [HLSL][NFC] Remove RegisterBindingFlags struct When diagnosin

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

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

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

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

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

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

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

2024-11-14 Thread Helena Kotas via cfe-commits
@@ -343,27 +336,224 @@ struct TemplateParameterListBuilder { Params.clear(); QualType T = Builder.Template->getInjectedClassNameSpecialization(); -T = S.Context.getInjectedClassNameType(Builder.Record, T); +T = AST.getInjectedClassNameType(Builder.Record, T);

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

2024-11-14 Thread Helena Kotas via cfe-commits
@@ -343,27 +336,224 @@ struct TemplateParameterListBuilder { Params.clear(); QualType T = Builder.Template->getInjectedClassNameSpecialization(); -T = S.Context.getInjectedClassNameType(Builder.Record, T); +T = AST.getInjectedClassNameType(Builder.Record, T);

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

2024-11-25 Thread Helena Kotas via cfe-commits
@@ -343,27 +336,224 @@ struct TemplateParameterListBuilder { Params.clear(); QualType T = Builder.Template->getInjectedClassNameSpecialization(); -T = S.Context.getInjectedClassNameType(Builder.Record, T); +T = AST.getInjectedClassNameType(Builder.Record, T);

[clang] [HLSL][NFC] Refactor resource buffers AST tests (PR #117659)

2024-11-25 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/117659 This is a test-only change. This PR merges 5 tests for structured buffers ASTs into one file with multiple run lines and check prefixes because these tests have a lot of common output. It also renames RWBuffer-A

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

2024-11-25 Thread Helena Kotas via cfe-commits
@@ -271,53 +246,70 @@ struct BuiltinTypeDeclBuilder { return *this; } + FieldDecl *getResourceHandleField() { +FieldDecl *FD = Fields["h"]; hekota wrote: Yeah, it would probably work fine too, if default value `ValueTy()` just means `nullptr` when

<    1   2   3   4   5   6   7   8   9   >