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

2024-11-05 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 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 implicit resource element type concepts to AST (PR #112600)

2024-11-05 Thread Joshua Batista via cfe-commits
bob80905 wrote: > Since your PR that adds `__builtin_hlsl_is_typed_resource_element_compatible` > is merged do you want to incorporate here? I'd prefer not to, because this PR is already pretty big and I have a separate task that is singularly dedicated to finalizing the constraint expression,

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

2024-10-30 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. 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 IsTypedResourceElementCompatible type trait (PR #113730)

2024-10-31 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 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 IsTypedResourceElementCompatible type trait (PR #113730)

2024-10-31 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 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 IsTypedResourceElementCompatible type trait (PR #113730)

2024-11-01 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/113730 >From a31199224c19c1087b114de29d864125b720e6d8 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 25 Oct 2024 12:33:05 -0700 Subject: [PATCH 1/6] add type trait --- .../clang/AST/CXXRecordDeclDefinition

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

2024-10-23 Thread Joshua Batista 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 bob80905 wrote: This ensures that StructuredBuffer

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

2024-11-08 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115045 >From ef4a7eea3eacce4f77b628aebe7f2838733971d0 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 5 Nov 2024 10:35:59 -0800 Subject: [PATCH 1/5] add empty struct test cases --- .../SemaHLSL/Types/Traits

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

2024-11-08 Thread Joshua Batista via cfe-commits
@@ -2200,47 +2200,43 @@ static void BuildFlattenedTypeList(QualType BaseTy, } bool SemaHLSL::IsTypedResourceElementCompatible(clang::QualType QT) { - if (QT.isNull()) + // null and array types are not allowed. + if (QT.isNull() || QT->isArrayType()) return false; -

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

2024-11-08 Thread Joshua Batista via cfe-commits
@@ -1,109 +1,28 @@ // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -finclude-default-header -fnative-half-type -verify %s // expected-no-diagnostics -struct oneInt { -int i; -}; - -struct twoInt { - int aa; - int ab; -}; - -struct threeInts { - oneInt o; -

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

2024-10-23 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. 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 Joshua Batista 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 RWStructuredBuffer definition to HLSLExternalSemaSource (PR #113477)

2024-10-23 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. 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] [llvm] [HLSL] Print struct body definition when within the context of defining a target extension type (PR #115971)

2024-11-12 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/115971 This PR changes the way that final DXIL is printed by adjusting the way the type definition section of the DXIL output is printed. Specifically, when defining a target extension type, if the RHS involves a str

[clang] [HLSL] Implement SV_GroupID semantic (PR #115911)

2024-11-13 Thread Joshua Batista via cfe-commits
@@ -27,3 +27,25 @@ struct ST2 { static uint X : SV_DispatchThreadID; uint s : SV_DispatchThreadID; }; + +[numthreads(8,8,1)] +// expected-error@+1 {{attribute 'SV_GroupID' only applies to a field or parameter of type 'uint/uint2/uint3'}} +void CSMain_GID(float ID : SV_

[clang] [llvm] [HLSL] Print struct body definition when within the context of defining a target extension type (PR #115971)

2024-11-13 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115971 >From 7413ceb21a6e0ac9212ef6317763ee0eff559612 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 12 Nov 2024 16:44:00 -0800 Subject: [PATCH 1/2] print struct body within target ext ty context --- .../t

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

2024-10-30 Thread Joshua Batista 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 implicit resource element type concepts to AST (PR #112600)

2024-10-31 Thread Joshua Batista 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 IsTypedResourceElementCompatible type trait (PR #113730)

2024-10-31 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/113730 >From a31199224c19c1087b114de29d864125b720e6d8 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 25 Oct 2024 12:33:05 -0700 Subject: [PATCH 1/5] add type trait --- .../clang/AST/CXXRecordDeclDefinition

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

2024-11-08 Thread Joshua Batista 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] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-09-18 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/109180 This PR adds the step intrinsic and an HLSL function that uses it. The SPIRV backend is also implemented. Used https://github.com/llvm/llvm-project/pull/106471 as a reference. Fixes https://github.com/llvm/llvm

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-09-23 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/109180 >From 3c58861f3e8c2f1333d0b36c6f5b7ba7f3d9e187 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 18 Sep 2024 12:20:19 -0700 Subject: [PATCH 1/5] add cross hlsl function --- clang/include/clang/Basic/Bu

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-09-23 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -disable-llvm-passes -verify -verify-ignore-unexpected + +void test_too_few_arg() +{ + return __builtin_hlsl_cross(); + // expected-error@-1 {{too few arg

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-09-23 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/109180 >From 3c58861f3e8c2f1333d0b36c6f5b7ba7f3d9e187 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 18 Sep 2024 12:20:19 -0700 Subject: [PATCH 1/4] add cross hlsl function --- clang/include/clang/Basic/Bu

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-09-23 Thread Joshua Batista via cfe-commits
@@ -1704,6 +1704,20 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { return true; break; } + case Builtin::BI__builtin_hlsl_cross: { +if (SemaRef.checkArgCount(TheCall, 2)) + return true; +if (CheckVectorElementCallA

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-09-24 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/109180 >From 3c58861f3e8c2f1333d0b36c6f5b7ba7f3d9e187 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 18 Sep 2024 12:20:19 -0700 Subject: [PATCH 1/6] add cross hlsl function --- clang/include/clang/Basic/Bu

[clang] [llvm] Adding splitdouble HLSL function (PR #109331)

2024-09-26 Thread Joshua Batista via cfe-commits
@@ -3,12 +3,12 @@ // Supported targets // -// RUN: %clang -target dxil-unknown-shadermodel6.2-compute %s -S -o /dev/null 2>&1 | FileCheck --allow-empty --check-prefix=CHECK-VALID %s -// RUN: %clang -target spirv-unknown-vulkan-compute %s -S -o /dev/null 2>&1 | FileCheck --al

[clang] [HLSL] Warn about incomplete language support (PR #108894)

2024-09-20 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/108894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Doc][HLSL] Add documentation for root signature (PR #88781)

2024-09-20 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,312 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bou

[clang] [Doc][HLSL] Add documentation for root signature (PR #88781)

2024-09-20 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,312 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bou

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

2024-09-20 Thread Joshua Batista 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 bob80905 wrote: This comment may be better updated to something like:

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

2024-09-20 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -S -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -S -o - %s | FileCheck %s + +// Verify that internal linkage unused functions are removed + +RWBuffer buf; + +// Never

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-09-20 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/109180 >From 3c58861f3e8c2f1333d0b36c6f5b7ba7f3d9e187 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 18 Sep 2024 12:20:19 -0700 Subject: [PATCH 1/3] add cross hlsl function --- clang/include/clang/Basic/Bu

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-09-20 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/109180 >From 3c58861f3e8c2f1333d0b36c6f5b7ba7f3d9e187 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 18 Sep 2024 12:20:19 -0700 Subject: [PATCH 1/2] add cross hlsl function --- clang/include/clang/Basic/Bu

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-09-20 Thread Joshua Batista via cfe-commits
@@ -1704,6 +1704,20 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { return true; break; } + case Builtin::BI__builtin_hlsl_cross: { +if (SemaRef.checkArgCount(TheCall, 2)) + return true; +if (CheckVectorElementCallA

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-10-01 Thread Joshua Batista via cfe-commits
@@ -74,6 +75,42 @@ static Value *expandAbs(CallInst *Orig) { "dx.max"); } +static Value *expandCrossIntrinsic(CallInst *Orig) { + + VectorType *VT = cast(Orig->getType()); + if (cast(VT)->getNumElements() != 3) +report_fatal_error(Twine("

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-09-30 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/109180 >From 3c58861f3e8c2f1333d0b36c6f5b7ba7f3d9e187 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 18 Sep 2024 12:20:19 -0700 Subject: [PATCH 1/6] add cross hlsl function --- clang/include/clang/Basic/Bu

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-10-01 Thread Joshua Batista via cfe-commits
@@ -1828,6 +1828,41 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { return true; break; } + case Builtin::BI__builtin_hlsl_cross: { +if (SemaRef.checkArgCount(TheCall, 2)) + return true; +if (CheckVectorElementCallA

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-10-01 Thread Joshua Batista via cfe-commits
@@ -4709,6 +4709,18 @@ def HLSLClamp : LangBuiltin<"HLSL_LANG"> { let Prototype = "void(...)"; } +def HLSLCreateHandle : LangBuiltin<"HLSL_LANG"> { + let Spellings = ["__builtin_hlsl_create_handle"]; + let Attributes = [NoThrow, Const]; + let Prototype = "void*(unsigned c

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-09-30 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/109180 >From 3c58861f3e8c2f1333d0b36c6f5b7ba7f3d9e187 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 18 Sep 2024 12:20:19 -0700 Subject: [PATCH 1/7] add cross hlsl function --- clang/include/clang/Basic/Bu

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-10-01 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/109180 >From 3c58861f3e8c2f1333d0b36c6f5b7ba7f3d9e187 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 18 Sep 2024 12:20:19 -0700 Subject: [PATCH 1/8] add cross hlsl function --- clang/include/clang/Basic/Bu

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-10-02 Thread Joshua Batista via cfe-commits
@@ -74,6 +75,42 @@ static Value *expandAbs(CallInst *Orig) { "dx.max"); } +static Value *expandCrossIntrinsic(CallInst *Orig) { + + VectorType *VT = cast(Orig->getType()); + if (cast(VT)->getNumElements() != 3) +report_fatal_error(Twine("

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-10-02 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/109180 >From 3c58861f3e8c2f1333d0b36c6f5b7ba7f3d9e187 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 18 Sep 2024 12:20:19 -0700 Subject: [PATCH 1/9] add cross hlsl function --- clang/include/clang/Basic/Bu

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-10-02 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,43 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -disable-llvm-passes -verify -verify-ignore-unexpected bob80905 wrote: Thanks, this revealed a missing open curly brace on line 18! I got

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-10-03 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 closed https://github.com/llvm/llvm-project/pull/109180 ___ 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-06 Thread Joshua Batista 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 Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. 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 implicit resource element type concepts to AST (PR #112600)

2024-11-06 Thread Joshua Batista 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 empty struct test cases to `__builtin_hlsl_is_typed_resource_element_compatible` test file (PR #115045)

2024-11-07 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115045 >From ef4a7eea3eacce4f77b628aebe7f2838733971d0 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 5 Nov 2024 10:35:59 -0800 Subject: [PATCH 1/4] add empty struct test cases --- .../SemaHLSL/Types/Traits

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

2024-11-07 Thread Joshua Batista 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-07 Thread Joshua Batista 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-07 Thread Joshua Batista 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 IsLineVectorLayoutCompatible type trait (PR #113730)

2024-10-25 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/113730 This PR implements a new type trait as a builtin, `__builtin_hlsl_is_line_vector_layout_compatible` This type traits verifies that the given input type is suitable as a typed resource element type. It checks t

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

2024-10-25 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/113730 >From a915def0c7cb69d8c910c697aa610fa37278d032 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 25 Oct 2024 12:33:05 -0700 Subject: [PATCH] add type trait --- .../clang/AST/CXXRecordDeclDefinitionBits

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

2024-10-25 Thread Joshua Batista 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 IsLineVectorLayoutCompatible type trait (PR #113730)

2024-10-25 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/113730 >From a31199224c19c1087b114de29d864125b720e6d8 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 25 Oct 2024 12:33:05 -0700 Subject: [PATCH 1/3] add type trait --- .../clang/AST/CXXRecordDeclDefinition

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

2024-10-25 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/113730 >From a915def0c7cb69d8c910c697aa610fa37278d032 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 25 Oct 2024 12:33:05 -0700 Subject: [PATCH 1/2] add type trait --- .../clang/AST/CXXRecordDeclDefinition

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

2024-10-25 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/113730 >From a915def0c7cb69d8c910c697aa610fa37278d032 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 25 Oct 2024 12:33:05 -0700 Subject: [PATCH 1/3] add type trait --- .../clang/AST/CXXRecordDeclDefinition

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

2024-10-17 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/112600 >From 0739f6da81d7c1edd9578ae4ff9dd699e5c828c6 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Thu, 10 Oct 2024 14:31:25 -0700 Subject: [PATCH 01/11] ConceptSpecializationExpr shows up in AST!!! --- .../c

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

2024-10-17 Thread Joshua Batista via cfe-commits
@@ -483,10 +554,109 @@ static BuiltinTypeDeclBuilder setupBufferType(CXXRecordDecl *Decl, Sema &S, .addDefaultHandleConstructor(S, RC); } +BinaryOperator *getSizeOfLEQ16Expr(clang::ASTContext &context, + SourceLocation NameLoc, +

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

2024-10-17 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/112600 >From 0739f6da81d7c1edd9578ae4ff9dd699e5c828c6 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Thu, 10 Oct 2024 14:31:25 -0700 Subject: [PATCH 01/12] ConceptSpecializationExpr shows up in AST!!! --- .../c

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

2024-11-06 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. My other comment is just a nit, I can approve this as it is. https://github.com/llvm/llvm-project/pull/113643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

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

2024-11-06 Thread Joshua Batista 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 Joshua Batista 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 Joshua Batista 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] [llvm] [HLSL] Disallow named struct types as parameters in target extension types (PR #115971)

2024-11-25 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115971 >From 7413ceb21a6e0ac9212ef6317763ee0eff559612 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 12 Nov 2024 16:44:00 -0800 Subject: [PATCH 1/9] print struct body within target ext ty context --- .../t

[clang] [llvm] [HLSL] Disallow named struct types as parameters in target extension types (PR #115971)

2024-11-25 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115971 >From 7413ceb21a6e0ac9212ef6317763ee0eff559612 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 12 Nov 2024 16:44:00 -0800 Subject: [PATCH 01/10] print struct body within target ext ty context --- ...

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

2024-11-20 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/116413 >From 92ccbe72ca95ad2df5a81b76244a8a8d7cedef40 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 15 Nov 2024 09:00:15 -0800 Subject: [PATCH 1/4] update new tests --- clang/lib/Sema/HLSLExternalSemaSour

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

2024-11-18 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 edited https://github.com/llvm/llvm-project/pull/116413 ___ 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 #116413)

2024-11-18 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/116413 >From 92ccbe72ca95ad2df5a81b76244a8a8d7cedef40 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 15 Nov 2024 09:00:15 -0800 Subject: [PATCH 1/3] update new tests --- clang/lib/Sema/HLSLExternalSemaSour

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

2024-11-19 Thread Joshua Batista via cfe-commits
@@ -323,19 +325,114 @@ struct TemplateParameterListBuilder { return *this; } - BuiltinTypeDeclBuilder &finalizeTemplateArgs() { + // The concept specialization expression (CSE) constructed in + // constructConceptSpecializationExpr is constructed so that it + // matc

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

2024-11-19 Thread Joshua Batista via cfe-commits
@@ -323,19 +325,114 @@ struct TemplateParameterListBuilder { return *this; } - BuiltinTypeDeclBuilder &finalizeTemplateArgs() { + // The concept specialization expression (CSE) constructed in + // constructConceptSpecializationExpr is constructed so that it + // matc

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

2024-11-14 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 closed https://github.com/llvm/llvm-project/pull/116305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-11-14 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/116305 Reverts llvm/llvm-project#112600 >From 110599f1ada1999c5c33c41928cec0ea6e438992 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Thu, 14 Nov 2024 17:08:30 -0800 Subject: [PATCH] Revert "[HLSL] Add implicit

[clang] Add concepts to ast (PR #116407)

2024-11-15 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 closed https://github.com/llvm/llvm-project/pull/116407 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-11-13 Thread Joshua Batista via cfe-commits
@@ -1,109 +1,28 @@ // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -finclude-default-header -fnative-half-type -verify %s // expected-no-diagnostics -struct oneInt { -int i; -}; - -struct twoInt { - int aa; - int ab; -}; - -struct threeInts { - oneInt o; -

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

2024-11-14 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 closed 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 implicit resource element type concepts to AST (PR #112600)

2024-11-14 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 closed 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] [llvm] [HLSL] Add implicit resource element type concepts to AST (PR #116413)

2024-11-20 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/116413 >From 92ccbe72ca95ad2df5a81b76244a8a8d7cedef40 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 15 Nov 2024 09:00:15 -0800 Subject: [PATCH 1/6] update new tests --- clang/lib/Sema/HLSLExternalSemaSour

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

2024-11-20 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/116413 >From 92ccbe72ca95ad2df5a81b76244a8a8d7cedef40 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 15 Nov 2024 09:00:15 -0800 Subject: [PATCH 1/5] update new tests --- clang/lib/Sema/HLSLExternalSemaSour

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

2024-09-17 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. 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] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-09-17 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 closed https://github.com/llvm/llvm-project/pull/106782 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-11-13 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115045 >From ef4a7eea3eacce4f77b628aebe7f2838733971d0 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 5 Nov 2024 10:35:59 -0800 Subject: [PATCH 1/6] add empty struct test cases --- .../SemaHLSL/Types/Traits

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

2024-11-13 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115045 >From ef4a7eea3eacce4f77b628aebe7f2838733971d0 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 5 Nov 2024 10:35:59 -0800 Subject: [PATCH 1/7] add empty struct test cases --- .../SemaHLSL/Types/Traits

[clang] Add concepts to ast (PR #116407)

2024-11-15 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/116407 None >From 68985e64694b0f6e0e779d4711bbff8afb3fe6b2 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Thu, 10 Oct 2024 14:31:25 -0700 Subject: [PATCH 01/19] ConceptSpecializationExpr shows up in AST!!! ---

[clang] Add concepts to ast (PR #116407)

2024-11-15 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/116407 >From 68985e64694b0f6e0e779d4711bbff8afb3fe6b2 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Thu, 10 Oct 2024 14:31:25 -0700 Subject: [PATCH 01/19] ConceptSpecializationExpr shows up in AST!!! --- clang

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

2024-11-15 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/116413 >From 92ccbe72ca95ad2df5a81b76244a8a8d7cedef40 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 15 Nov 2024 09:00:15 -0800 Subject: [PATCH 1/2] update new tests --- clang/lib/Sema/HLSLExternalSemaSour

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

2024-11-15 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/116413 This PR is step one on the journey to implement resource element type validation via C++20 concepts. The PR sets up the infrastructure for injecting implicit concept decls / concept specialization expressions

[clang] [clang-cl][flang][dxc] Fix opts exposed to clang-cl/dxc by mistake (PR #118640)

2024-12-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/118640 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Disallow named struct types as parameters in target extension types (PR #115971)

2024-12-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115971 >From 7413ceb21a6e0ac9212ef6317763ee0eff559612 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 12 Nov 2024 16:44:00 -0800 Subject: [PATCH 01/10] print struct body within target ext ty context --- ...

[clang] [llvm] [HLSL] Disallow named struct types as parameters in target extension types (PR #115971)

2024-12-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115971 >From 7413ceb21a6e0ac9212ef6317763ee0eff559612 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 12 Nov 2024 16:44:00 -0800 Subject: [PATCH 01/11] print struct body within target ext ty context --- ...

[clang] [llvm] [HLSL] Do not print details in IR for target extension types (PR #115971)

2024-12-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 edited https://github.com/llvm/llvm-project/pull/115971 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Do not print details in IR for target extension types (PR #115971)

2024-12-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 edited https://github.com/llvm/llvm-project/pull/115971 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Do not print details in IR for target extension types (PR #115971)

2024-12-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115971 >From 7413ceb21a6e0ac9212ef6317763ee0eff559612 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 12 Nov 2024 16:44:00 -0800 Subject: [PATCH 01/12] print struct body within target ext ty context --- ...

[clang] [llvm] [HLSL] Do not print details in IR for target extension types (PR #115971)

2024-12-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115971 >From 7413ceb21a6e0ac9212ef6317763ee0eff559612 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 12 Nov 2024 16:44:00 -0800 Subject: [PATCH 01/13] print struct body within target ext ty context --- ...

[clang] [llvm] [HLSL] Do not print details in IR for target extension types (PR #115971)

2024-12-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115971 >From 7413ceb21a6e0ac9212ef6317763ee0eff559612 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 12 Nov 2024 16:44:00 -0800 Subject: [PATCH 01/14] print struct body within target ext ty context --- ...

[clang] [llvm] [HLSL] Do not print details in IR for target extension types (PR #115971)

2024-12-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115971 >From 7413ceb21a6e0ac9212ef6317763ee0eff559612 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 12 Nov 2024 16:44:00 -0800 Subject: [PATCH 01/15] print struct body within target ext ty context --- ...

[clang] [llvm] [NFC] fix up typos (PR #121842)

2025-01-06 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/121842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Move packoffset validation to separate function and calculate offsets in bytes (PR #121989)

2025-01-07 Thread Joshua Batista via cfe-commits
@@ -219,33 +223,41 @@ void SemaHLSL::ActOnFinishBuffer(Decl *Dcl, SourceLocation RBrace) { } } - if (HasPackOffset && HasNonPackOffset) -Diag(BufDecl->getLocation(), diag::warn_hlsl_packoffset_mix); - - if (HasPackOffset) { -ASTContext &Context = getASTContext

[clang] [HLSL][NFC] Move packoffset validation to separate function and calculate offsets in bytes (PR #121989)

2025-01-07 Thread Joshua Batista via cfe-commits
@@ -4721,9 +4721,9 @@ def HLSLPackOffset: HLSLAnnotationAttr { let Args = [IntArgument<"Subcomponent">, IntArgument<"Component">]; let Documentation = [HLSLPackOffsetDocs]; let AdditionalMembers = [{ - unsigned getOffset() { -return subcomponent * 4 + compone

<    1   2   3   4   5   6   >