[clang] [llvm] [HLSL] Add handle initialization for simple resource declarations (PR #111207)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -1121,6 +1121,11 @@ CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, if (Decls[i]) EmitRuntimeCall(Decls[i]); +if (getLangOpts().HLSL) + if (llvm::Function *ResInitFn = + CGM.getHLSLRuntime().createResourceBindingInitFn())

[clang] [llvm] [HLSL] Add handle initialization for simple resource declarations (PR #111207)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -5622,6 +5622,9 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D, getCUDARuntime().handleVarRegistration(D, *GV); } + if (LangOpts.HLSL) +getHLSLRuntime().handleGlobalVarDefinition(D, GV); hekota wrote: Done: https://github.com/m

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

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -28,13 +28,60 @@ class AttributeCommonInfo; class IdentifierInfo; class ParsedAttr; class Scope; +class VarDecl; + +using llvm::dxil::ResourceClass; // FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no // longer need to create builtin buffer types

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

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -28,13 +28,60 @@ class AttributeCommonInfo; class IdentifierInfo; class ParsedAttr; class Scope; +class VarDecl; + +using llvm::dxil::ResourceClass; // FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no // longer need to create builtin buffer types

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

2024-10-16 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/111203 >From f545a14e11556c91d10b14617e3588fe5eae6d42 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 4 Oct 2024 12:21:51 -0700 Subject: [PATCH 1/6] [HLSL] Collect explicit resource binding information (part 1)

[clang] [llvm] [HLSL] Add handle initialization for simple resource declarations (PR #111207)

2024-10-16 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/111207 >From a13f62d2b5cf1bd1ee7016fce5e0fd95531bf7a2 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 4 Oct 2024 13:19:27 -0700 Subject: [PATCH 1/4] [HLSL] Add handle initialization for simple resource declarati

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

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -985,88 +1034,85 @@ SemaHLSL::TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT) { return LocInfo; } -// get the record decl from a var decl that we expect -// represents a resource -static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) { - const Type *

[clang] [llvm] [HLSL] Add handle initialization for simple resource declarations (PR #111207)

2024-10-17 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/111207 >From a13f62d2b5cf1bd1ee7016fce5e0fd95531bf7a2 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 4 Oct 2024 13:19:27 -0700 Subject: [PATCH 1/5] [HLSL] Add handle initialization for simple resource declarati

[clang] Fix build break in SemaHLSL.cpp on MSVC 2022: warning C4715: 'getResourceClass': not all control paths return a value (PR #112767)

2024-10-17 Thread Helena Kotas via cfe-commits
https://github.com/hekota approved this pull request. LGTM, thank you for the fix! Interesting that it fires up, the switch covers all enum values. https://github.com/llvm/llvm-project/pull/112767 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] [llvm] [HLSL] Add handle initialization for simple resource declarations (PR #111207)

2024-10-17 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/111207 ___ 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-09 Thread Helena Kotas via cfe-commits
@@ -2228,3 +2242,62 @@ QualType SemaHLSL::getInoutParameterType(QualType Ty) { Ty.addRestrict(); return Ty; } + +// Walks though existing explicit bindings, finds the actual resource class +// decl the binding applies to and sets it to attr->ResourceField. +// Additional pr

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

2024-10-09 Thread Helena Kotas via cfe-commits
@@ -115,12 +114,14 @@ struct Eg13{ MySRV s1; MySRV s2; }; -// expected-warning@+4{{binding type 'u' only applies to types containing UAV resources}} // expected-warning@+3{{binding type 'u' only applies to types containing UAV resources}} -// expected-warning@+2{{binding

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

2024-10-10 Thread Helena Kotas via cfe-commits
@@ -4493,28 +4493,34 @@ void CXXNameMangler::mangleType(const ArrayParameterType *T) { } void CXXNameMangler::mangleType(const HLSLAttributedResourceType *T) { - mangleType(T->getWrappedType()); + llvm::SmallString<64> Str("_Res"); const HLSLAttributedResourceType::Attri

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

2024-10-10 Thread Helena Kotas via cfe-commits
@@ -11533,6 +11539,18 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, bool OfBlockPointer, return {}; return LHS; } + case Type::HLSLAttributedResource: { +const HLSLAttributedResourceType *LHSTy = +LHS->castAs(); +const HLSLAttribut

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

2024-10-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/111203 >From f545a14e11556c91d10b14617e3588fe5eae6d42 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 4 Oct 2024 12:21:51 -0700 Subject: [PATCH 1/3] [HLSL] Collect explicit resource binding information (part 1)

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

2024-10-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/111203 ___ 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-09 Thread Helena Kotas via cfe-commits
@@ -4588,6 +4588,35 @@ def HLSLResourceBinding: InheritableAttr { let LangOpts = [HLSL]; let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>]; let Documentation = [HLSLResourceBindingDocs]; + let AdditionalMembers = [{ + enum class RegisterType : unsigned

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

2024-10-09 Thread Helena Kotas via cfe-commits
@@ -1135,21 +1147,19 @@ static void ValidateMultipleRegisterAnnotations(Sema &S, Decl *TheDecl, RegisterType otherRegType = getRegisterType(attr->getSlot()); if (RegisterTypesDetected[static_cast(otherRegType)]) { -if (PreviousConflicts[TheDecl].count(othe

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

2024-10-09 Thread Helena Kotas via cfe-commits
@@ -2228,3 +2242,62 @@ QualType SemaHLSL::getInoutParameterType(QualType Ty) { Ty.addRestrict(); return Ty; } + +// Walks though existing explicit bindings, finds the actual resource class +// decl the binding applies to and sets it to attr->ResourceField. +// Additional pr

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

2024-10-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/111203 ___ 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-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/111203 ___ 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-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/111203 >From f545a14e11556c91d10b14617e3588fe5eae6d42 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 4 Oct 2024 12:21:51 -0700 Subject: [PATCH 1/4] [HLSL] Collect explicit resource binding information (part 1)

[clang] [HLSL][NFC] Move IsIntangibleType from SemaHLSL to Type to make it accessible outside of Sema (PR #113206)

2024-10-22 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113206 >From ae8b3c909231915f87631665b06321a9f9baff33 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Mon, 21 Oct 2024 12:17:58 -0700 Subject: [PATCH 1/2] [HLSL][NFC] Move IsIntangibleType from SemaHLSL to Type to ma

[clang] [HLSL][NFC] Move IsIntangibleType from SemaHLSL to Type to make it accessible outside of Sema (PR #113206)

2024-10-22 Thread Helena Kotas via cfe-commits
@@ -5030,6 +5030,29 @@ bool Type::hasSizedVLAType() const { return false; } +bool Type::isHLSLIntangibleType() const { + const Type *Ty = getUnqualifiedDesugaredType(); + + // check if it's a builtin type first (simple check, no need to cache it) hekota wr

[clang] [HLSL][NFC] Move IsIntangibleType from SemaHLSL to Type to make it accessible outside of Sema (PR #113206)

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

[clang] [HLSL] Change StructuredBuffer resource class to SRV (PR #113397)

2024-10-22 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/113397 Changes `StructuredBuffer` resource class to SRV (read-only) according to existing [DXC](https://godbolt.org/z/EjY9jbv4W) implementation and [Proposal for mapping resource attributes](https://github.com/llvm/wg-

[clang] [HLSL] Change StructuredBuffer resource class to SRV (PR #113397)

2024-10-22 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113397 >From 7e7812cff9c1d82c8402e840975e3fc5fd726001 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Tue, 22 Oct 2024 16:18:24 -0700 Subject: [PATCH 1/2] [HLSL] Update resource class of StructuredBuffer to SRV ---

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

2024-10-14 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/9] Add codegen for existing resource types and make HLSLAttribut

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

2024-10-24 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113643 >From 497d0f2c2d0c84603f3b3434aaee0e23722cd701 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 24 Oct 2024 20:32:28 -0700 Subject: [PATCH 1/2] [HLSL] Add AppendStructuredBuffer and ConsumeStructuredBuffer

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

2024-10-24 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/113648 Adds `RasterizerOrderedStructuredBuffer` definition to HLSLExternalSemaSource. Adds separate tests for the AST shape and element types. Adds constructor/handle.fromBinding and subscript test cases to shared test

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

2024-10-24 Thread Helena Kotas via cfe-commits
https://github.com/hekota ready_for_review 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-10-24 Thread Helena Kotas via cfe-commits
https://github.com/hekota ready_for_review 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] [HLSL][NFC] Cleanup - removed unused includes and param, fix typos (PR #113649)

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

[clang] [HLSL][NFC] Cleanup - removed unused includes and param, fix typos (PR #113649)

2024-10-24 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/113649 None >From 0dbe1b5888b93d6996e89351617e027d6828 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 24 Oct 2024 21:27:07 -0700 Subject: [PATCH] [HLSL][NFC] Cleanup - removed unused includes and param, fix

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

2024-10-24 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] [HLSL][NFC] Cleanup - removed unused function, includes and param, fix typos (PR #113649)

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

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

2024-10-25 Thread Helena Kotas via cfe-commits
@@ -17,7 +17,7 @@ // EMPTY-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <> Implicit final // There should be no more occurrances of StructuredBuffer -// EMPTY-NOT: StructuredBuffer +// EMPTY-NOT: {{/s}}StructuredBuffer hekota wrote: "/s" is a space in the flavor of reg

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

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

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

2024-10-29 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,70 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.2-compute -finclude-default-header -fnative-half-type -emit-llvm -o - %s | FileCheck %s + +// NOTE: The number in type name and whether the struct is packed or not will mostly +// likely change once subscript oper

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

2024-10-29 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,70 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.2-compute -finclude-default-header -fnative-half-type -emit-llvm -o - %s | FileCheck %s + +// NOTE: The number in type name and whether the struct is packed or not will mostly +// likely change once subscript oper

[clang] [HLSL] Remove old resource annotations for UAVs and SRVs (PR #114139)

2024-10-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/114139 UAVs and SRVs have already been converted to use LLVM target types and we can disable generating of the !hlsl.uavs and !hlsl.srvs! annotations. This will enable adding tests for structured buffers with user defi

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

2024-10-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/114148 Introduces `__builtin_hlsl_buffer_update_counter` clang buildin that is used to implement the `IncrementCounter` and `DecrementCounter` methods on `RWStructuredBuffer` and `RasterizerOrderedStructuredBuffer` (se

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

2024-10-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited 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 RasterizerOrderedStructuredBuffer definition to HLSLExternalSemaSource (PR #113648)

2024-10-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited 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 RasterizerOrderedStructuredBuffer definition to HLSLExternalSemaSource (PR #113648)

2024-10-29 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited 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-10-29 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] Emit constrained atan2 intrinsic for clang builtin (PR #113636)

2024-11-04 Thread Helena Kotas via cfe-commits
https://github.com/hekota approved this pull request. LGTM! Please add a note to the PR description about why is are you changing atan2 to erff in clang/test/CodeGenCXX/builtin-calling-conv.cpp. https://github.com/llvm/llvm-project/pull/113636 ___ cfe

[clang] [HLSL][SPIRV] Add HLSL type translation for spirv. (PR #114273)

2024-11-04 Thread Helena Kotas via cfe-commits
https://github.com/hekota commented: LGTM! https://github.com/llvm/llvm-project/pull/114273 ___ 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-04 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113643 >From 497d0f2c2d0c84603f3b3434aaee0e23722cd701 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 24 Oct 2024 20:32:28 -0700 Subject: [PATCH 1/5] [HLSL] Add AppendStructuredBuffer and ConsumeStructuredBuffer

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

2024-11-05 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113648 >From b8a47223444e72f2a6759178de15f6d1a13dff99 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 24 Oct 2024 21:22:32 -0700 Subject: [PATCH 1/5] [HLSL] Add RasterizerOrderedStructuredBuffer definition to HL

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

2024-11-05 Thread Helena Kotas via cfe-commits
@@ -4846,7 +4846,6 @@ def HLSLSaturate : LangBuiltin<"HLSL_LANG"> { let Prototype = "void(...)"; } - hekota wrote: This is intentional - I'm removing an extra empty line. https://github.com/llvm/llvm-project/pull/114148

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

2024-11-05 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/5] [HLSL] Add Increment/DecrementCounter methods to structured b

[clang] [HLSL] Add empty struct test cases to `__builtin_hlsl_is_typed_resource_element_compatible` test file (PR #115045)

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

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

2024-11-05 Thread Helena Kotas via cfe-commits
@@ -559,7 +559,7 @@ class CompilerInstance : public ModuleLoader { bool hasSema() const { return (bool)TheSema; } Sema &getSema() const { -assert(TheSema && "Compiler instance has no Sema object!"); hekota wrote: Oops, this should not be there! :) ht

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

2024-11-05 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113648 >From b8a47223444e72f2a6759178de15f6d1a13dff99 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 24 Oct 2024 21:22:32 -0700 Subject: [PATCH 1/6] [HLSL] Add RasterizerOrderedStructuredBuffer definition to HL

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

2024-11-05 Thread Helena Kotas via cfe-commits
hekota wrote: Since your PR that adds `__builtin_hlsl_is_typed_resource_element_compatible` is merged do you want to incorporate here? https://github.com/llvm/llvm-project/pull/112600 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

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

2024-11-05 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 IsLineVectorLayoutCompatible type trait (PR #113730)

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

[clang] [HLSL] add IsLineVectorLayoutCompatible type trait (PR #113730)

2024-10-30 Thread Helena Kotas via cfe-commits
https://github.com/hekota requested changes to this pull request. If you are going to store `isHLSLLineVectorLayoutCompatibleType` on a declaration you need to modify addMember to analyze newly added members. Then move the IsLineVectorLayoutCompatibleType implementation from SemaHLSL to Type a

[clang] [HLSL] Remove old resource annotations for UAVs and SRVs (PR #114139)

2024-10-30 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/114139 >From f9b74fe0a9631a01edbad1e8c8e02ca05e3ee0ee Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Tue, 29 Oct 2024 15:22:27 -0700 Subject: [PATCH 1/3] [HLSL] Remove old resource annotations for UAVs and SRVs UAVs

[clang] [HLSL] add IsLineVectorLayoutCompatible type trait (PR #113730)

2024-10-30 Thread Helena Kotas via cfe-commits
@@ -253,4 +253,9 @@ FIELD(IsAnyDestructorNoReturn, 1, NO_MERGE) /// type that is intangible). HLSL only. FIELD(IsHLSLIntangible, 1, NO_MERGE) +/// Whether the record type is line vector layout compatible (that is, +/// it has at most 4 elements, does not exceed 16 bytes, is ho

[clang] [HLSL] add IsLineVectorLayoutCompatible type trait (PR #113730)

2024-10-30 Thread Helena Kotas via cfe-commits
@@ -2163,6 +2163,51 @@ static void BuildFlattenedTypeList(QualType BaseTy, } } +bool SemaHLSL::IsLineVectorLayoutCompatibleType(clang::QualType QT) { + if (QT.isNull()) +return false; + + llvm::SmallVector QTTypes; + BuildFlattenedTypeList(QT, QTTypes); + + assert(QT

[clang] [HLSL] add IsLineVectorLayoutCompatible type trait (PR #113730)

2024-10-30 Thread Helena Kotas via cfe-commits
@@ -2163,6 +2163,51 @@ static void BuildFlattenedTypeList(QualType BaseTy, } } +bool SemaHLSL::IsLineVectorLayoutCompatibleType(clang::QualType QT) { + if (QT.isNull()) +return false; + + llvm::SmallVector QTTypes; + BuildFlattenedTypeList(QT, QTTypes); --

[clang] [HLSL] add IsLineVectorLayoutCompatible type trait (PR #113730)

2024-10-30 Thread Helena Kotas via cfe-commits
@@ -8459,6 +8460,12 @@ inline bool Type::isHLSLBuiltinIntangibleType() const { false; } +inline bool Type::isHLSLLineVectorLayoutCompatibleType() const { +#define HLSL_LINE_VECTOR_LAYOUT_COMPATIBLE_TYPE(Name, Id, SingletonId) \ + is##Id##Type() || + return isH

[clang] [HLSL] add IsLineVectorLayoutCompatible type trait (PR #113730)

2024-10-30 Thread Helena Kotas via cfe-commits
@@ -2163,6 +2163,51 @@ static void BuildFlattenedTypeList(QualType BaseTy, } } +bool SemaHLSL::IsLineVectorLayoutCompatibleType(clang::QualType QT) { + if (QT.isNull()) +return false; + + llvm::SmallVector QTTypes; + BuildFlattenedTypeList(QT, QTTypes); + + assert(QT

[clang] [llvm] [HLSL][SPIRV][DXIL] Implement `WaveActiveSum` intrinsic (PR #112400)

2024-10-31 Thread Helena Kotas via cfe-commits
hekota wrote: LGTM! I'm not familiar with the SPIR-V side though. https://github.com/llvm/llvm-project/pull/112400 ___ 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-10-31 Thread Helena Kotas via cfe-commits
@@ -483,10 +582,101 @@ 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-10-31 Thread Helena Kotas via cfe-commits
@@ -323,30 +324,99 @@ struct TemplateParameterListBuilder { S.Context, Builder.Record->getDeclContext(), SourceLocation(), SourceLocation(), /* TemplateDepth */ 0, Position, &S.Context.Idents.get(Name, tok::TokenKind::identifier), -/* Typename */

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

2024-10-30 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113648 >From b8a47223444e72f2a6759178de15f6d1a13dff99 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 24 Oct 2024 21:22:32 -0700 Subject: [PATCH 1/2] [HLSL] Add RasterizerOrderedStructuredBuffer definition to HL

[clang] [HLSL] Remove old resource annotations for UAVs and SRVs (PR #114139)

2024-10-30 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/114139 ___ 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-10-30 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113643 >From 497d0f2c2d0c84603f3b3434aaee0e23722cd701 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 24 Oct 2024 20:32:28 -0700 Subject: [PATCH 1/3] [HLSL] Add AppendStructuredBuffer and ConsumeStructuredBuffer

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

2024-10-30 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][SPIRV][DXIL] Implement `WaveActiveSum` intrinsic (PR #112400)

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

[clang] [llvm] [HLSL][SPIRV][DXIL] Implement `WaveActiveSum` intrinsic (PR #112400)

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

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

2024-10-23 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/113477 Add tests for RWStructuredBuffer class definition. Use shared test files for all structured buffers' constructor and subscript tests. Keep AST and element-type tests separate for each buffer type because they lo

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

2024-10-23 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,70 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.2-compute -finclude-default-header -fnative-half-type -emit-llvm -o - %s | FileCheck %s + +// NOTE: The number in type name and whether the struct is packed or not will mostly +// likely change once subscript oper

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

2024-11-08 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113643 >From 497d0f2c2d0c84603f3b3434aaee0e23722cd701 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 24 Oct 2024 20:32:28 -0700 Subject: [PATCH 1/6] [HLSL] Add AppendStructuredBuffer and ConsumeStructuredBuffer

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

2024-11-08 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113643 >From 497d0f2c2d0c84603f3b3434aaee0e23722cd701 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 24 Oct 2024 20:32:28 -0700 Subject: [PATCH 1/7] [HLSL] Add AppendStructuredBuffer and ConsumeStructuredBuffer

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

2024-11-08 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed 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-08 Thread Helena Kotas via cfe-commits
@@ -4883,6 +4882,12 @@ def HLSLRadians : LangBuiltin<"HLSL_LANG"> { let Prototype = "void(...)"; } +def HLSLBufferUpdateCounter : LangBuiltin<"HLSL_LANG"> { + let Spellings = ["__builtin_hlsl_buffer_update_counter"]; + let Attributes = [NoThrow]; + let Prototype = "uint32

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

2024-10-23 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113477 >From 106ea44e1f8833f26364c54cc3fbf2fb57665be6 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 23 Oct 2024 10:29:44 -0700 Subject: [PATCH 1/5] [HLSL] Add RWStructuredBuffer definition to HLSLExternalSemaS

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

2024-10-23 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113477 >From 106ea44e1f8833f26364c54cc3fbf2fb57665be6 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 23 Oct 2024 10:29:44 -0700 Subject: [PATCH 1/4] [HLSL] Add RWStructuredBuffer definition to HLSLExternalSemaS

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

2024-10-23 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113477 >From 106ea44e1f8833f26364c54cc3fbf2fb57665be6 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 23 Oct 2024 10:29:44 -0700 Subject: [PATCH 1/3] [HLSL] Add RWStructuredBuffer definition to HLSLExternalSemaS

[clang] [HLSL] Change StructuredBuffer resource class to SRV (PR #113397)

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

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

2024-10-23 Thread Helena Kotas via cfe-commits
@@ -17,7 +17,7 @@ // EMPTY-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <> Implicit final // There should be no more occurrances of StructuredBuffer -// EMPTY-NOT: StructuredBuffer +// EMPTY-NOT: {{^\W}}StructuredBuffer hekota wrote: Thanks Tex! I forgot `^` has differ

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

2024-10-23 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,70 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.2-compute -finclude-default-header -fnative-half-type -emit-llvm -o - %s | FileCheck %s + +// NOTE: The number in type name and whether the struct is packed or not will mostly +// likely change once subscript oper

[clang] [HLSL] Add AppendStructuredBuffer and ConsumeStructuredBuffer to HLSLExternalSemaSource (PR #113643)

2024-10-24 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/113643 Adds AppendStructuredBuffer and ConsumeStructuredBuffer to HLSLExternalSemaSource. Adds separate tests for the AST shape and element types, and adds constructor/handle.fromBinding test case to shared test file

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

2024-10-24 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] [HLSL] Add Append/ConsumeStructuredBuffer definitions to HLSLExternalSemaSource (PR #113643)

2024-10-24 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] [HLSL][NFC] Cleanup - removed unused includes and param, fix typos (PR #113649)

2024-10-24 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113649 >From 0dbe1b5888b93d6996e89351617e027d6828 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 24 Oct 2024 21:27:07 -0700 Subject: [PATCH 1/2] [HLSL][NFC] Cleanup - removed unused includes and param, fix

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

2024-10-23 Thread Helena Kotas via cfe-commits
@@ -17,7 +17,7 @@ // EMPTY-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <> Implicit final // There should be no more occurrances of StructuredBuffer -// EMPTY-NOT: StructuredBuffer +// EMPTY-NOT: {{/s}}StructuredBuffer hekota wrote: I've update it to use `{^\W}}`. htt

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

2024-10-23 Thread Helena Kotas via cfe-commits
@@ -17,7 +17,7 @@ // EMPTY-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <> Implicit final // There should be no more occurrances of StructuredBuffer -// EMPTY-NOT: StructuredBuffer +// EMPTY-NOT: {{/s}}StructuredBuffer hekota wrote: This ensures that we match Structure

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

2024-10-23 Thread Helena Kotas via cfe-commits
@@ -4,21 +4,30 @@ // NOTE: SPIRV codegen for resource types is not yet implemented StructuredBuffer Buf : register(t10); +RWStructuredBuffer Buf2 : register(u5, space1); // CHECK: %"class.hlsl::StructuredBuffer" = type { target("dx.RawBuffer", float, 0, 0), float } +// CHE

[clang] [HLSL] add IsLineVectorLayoutCompatible type trait (PR #113730)

2024-10-30 Thread Helena Kotas via cfe-commits
@@ -2163,6 +2163,51 @@ static void BuildFlattenedTypeList(QualType BaseTy, } } +bool SemaHLSL::IsLineVectorLayoutCompatibleType(clang::QualType QT) { + if (QT.isNull()) +return false; + + llvm::SmallVector QTTypes; + BuildFlattenedTypeList(QT, QTTypes); --

[clang] [HLSL] add IsLineVectorLayoutCompatible type trait (PR #113730)

2024-10-30 Thread Helena Kotas via cfe-commits
hekota wrote: > If you are going to store `isHLSLLineVectorLayoutCompatibleType` on a > declaration you need to modify addMember to analyze newly added members. Then > move the IsLineVectorLayoutCompatibleType implementation from SemaHLSL to > Type and use the bit on the record type decl inste

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

2024-10-31 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/2] [HLSL] Add Increment/DecrementCounter methods to structured b

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

2024-10-31 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/2] [HLSL] Add Increment/DecrementCounter methods to structured b

[clang] [HLSL] add IsTypedResourceElementCompatible type trait (PR #113730)

2024-10-31 Thread Helena Kotas via cfe-commits
https://github.com/hekota approved this pull request. LGTM! Please remove the whitespace-only change in clang/include/clang/AST/Type.h. https://github.com/llvm/llvm-project/pull/113730 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

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

<    1   2   3   4   5   6   7   8   9   >