[clang] [HLSL] support packoffset in clang codeGen (PR #91999)

2024-05-16 Thread Xiang Li via cfe-commits
python3kgae wrote: > > This PR will not change this. The padding will only be added when required. > > _That's the problem_ > > > ```hlsl > > cbuffer { > > float F; > > float2 V; > > } > > ``` > > > > > > > > > > > > > > > > > > > > > > > > will

[clang] [HLSL] support packoffset in clang codeGen (PR #91999)

2024-05-16 Thread Xiang Li via cfe-commits
python3kgae wrote: > > You can use `type <{ float, <2 x float>}>` if you need the tightly-packed > > layout. > > I think we need to figure out how we're going to lower this too. Loading from > this memory space requires loading 128 bytes at a time, and we need to slice > it down to just the

[clang] [HLSL] support packoffset in clang codeGen (PR #91999)

2024-05-16 Thread Xiang Li via cfe-commits
https://github.com/python3kgae edited https://github.com/llvm/llvm-project/pull/91999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] support packoffset in clang codeGen (PR #91999)

2024-05-16 Thread Xiang Li via cfe-commits
https://github.com/python3kgae edited https://github.com/llvm/llvm-project/pull/91999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] support packoffset in clang codeGen (PR #91999)

2024-05-16 Thread Xiang Li via cfe-commits
python3kgae wrote: > > Could you explain more about can't put any vectors or matrices into the > > cbuffer structure type? > > Consider this example (regardless of packoffset): > > ```hlsl > cbuffer { > float F; > float2 V; > } > ``` > > The layout for this is basically: > > ```c >

[clang] [HLSL] support packoffset in clang codeGen (PR #91999)

2024-05-16 Thread Xiang Li via cfe-commits
@@ -5671,6 +5671,54 @@ HLSLBufferDecl *HLSLBufferDecl::CreateDeserialized(ASTContext , SourceLocation(), SourceLocation()); } +static uint64_t calculateLegacyCbufferAlign(const ASTContext , +

[clang] [HLSL] support packoffset in clang codeGen (PR #91999)

2024-05-16 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/91999 >From de2b6cab831ac07bf6adcfe563fd9d866e295071 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 13 May 2024 12:59:48 -0400 Subject: [PATCH 1/2] [HLSL] support packoffset in clang codeGen Implement

[clang] [HLSL] support packoffset in clang codeGen (PR #91999)

2024-05-15 Thread Xiang Li via cfe-commits
python3kgae wrote: > I'm a little concerned about the strategy here. LLVM generally doesn't > explicitly capture padding it relies on the data layout rules to capture that. > > If this is the approach we're going with you can't put any vectors or > matrices into the cbuffer structure type and

[clang] HLSL availability diagnostics design doc (PR #92207)

2024-05-15 Thread Xiang Li via cfe-commits
@@ -0,0 +1,53 @@ += +HLSL Availability Diagnostics += + +.. contents:: + :local: + +Introduction + + +HLSL availability diagnostics emits errors or warning when unavailable shader APIs are used. Unavailable

[clang] HLSL availability diagnostics design doc (PR #92207)

2024-05-15 Thread Xiang Li via cfe-commits
@@ -0,0 +1,53 @@ += +HLSL Availability Diagnostics += + +.. contents:: + :local: + +Introduction + + +HLSL availability diagnostics emits errors or warning when unavailable shader APIs are used. Unavailable

[clang] HLSL availability diagnostics design doc (PR #92207)

2024-05-15 Thread Xiang Li via cfe-commits
@@ -0,0 +1,53 @@ += +HLSL Availability Diagnostics += + +.. contents:: + :local: + +Introduction + + +HLSL availability diagnostics emits errors or warning when unavailable shader APIs are used. Unavailable

[clang] HLSL availability diagnostics design doc (PR #92207)

2024-05-15 Thread Xiang Li via cfe-commits
@@ -0,0 +1,53 @@ += +HLSL Availability Diagnostics += + +.. contents:: + :local: + +Introduction + + +HLSL availability diagnostics emits errors or warning when unavailable shader APIs are used. Unavailable

[clang] [Clang][HLSL] Add environment parameter to availability attribute (PR #89809)

2024-05-14 Thread Xiang Li via cfe-commits
@@ -18,14 +18,21 @@ namespace hlsl { #define _HLSL_BUILTIN_ALIAS(builtin) \ __attribute__((clang_builtin_alias(builtin))) -#define _HLSL_AVAILABILITY(environment, version) \ -

[clang] [HLSL] support packoffset in clang codeGen (PR #91999)

2024-05-13 Thread Xiang Li via cfe-commits
https://github.com/python3kgae created https://github.com/llvm/llvm-project/pull/91999 Implement packoffset as offset in the layouted struct for cbuffer. cbuffer CB { float a : packoffset(c2); float b : packoffset(c4); float2 c : packoffset(c2.z); } will get layout struct like struct

[clang] [HLSL] reenable add packoffset in AST (PR #91474)

2024-05-09 Thread Xiang Li via cfe-commits
https://github.com/python3kgae closed https://github.com/llvm/llvm-project/pull/91474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Start documenting DXIL Resource handling (PR #90553)

2024-05-08 Thread Xiang Li via cfe-commits
@@ -0,0 +1,794 @@ +== +DXIL Resource Handling +== + +.. contents:: + :local: + +.. toctree:: + :hidden: + +Introduction + + +Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and +eventually lowered by the

[clang] [HLSL] reenable add packoffset in AST (PR #91474)

2024-05-08 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/91474 >From 251bbfbd77f9fa968a3fe76156e216f27eeb973f Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Wed, 8 May 2024 09:48:30 -0400 Subject: [PATCH 1/2] Revert "Revert "[HLSL] Support packoffset attribute in AST

[clang] [HLSL] reenable add packoffset in AST (PR #91474)

2024-05-08 Thread Xiang Li via cfe-commits
python3kgae wrote: > When reapplying a change that was reverted, please include enough information > in the description so that it can be understood without having to dig up the > old change. Something like: > > > [HLSL] reenable add packoffset in AST > > This reapplies > >

[clang] [HLSL] reenable add packoffset in AST (PR #91474)

2024-05-08 Thread Xiang Li via cfe-commits
https://github.com/python3kgae edited https://github.com/llvm/llvm-project/pull/91474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] reenable add packoffset in AST (PR #91474)

2024-05-08 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/91474 >From 251bbfbd77f9fa968a3fe76156e216f27eeb973f Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Wed, 8 May 2024 09:48:30 -0400 Subject: [PATCH 1/2] Revert "Revert "[HLSL] Support packoffset attribute in AST

[clang] [HLSL] reenable add packoffset in AST (PR #91474)

2024-05-08 Thread Xiang Li via cfe-commits
https://github.com/python3kgae created https://github.com/llvm/llvm-project/pull/91474 Fix the test fail caused by missing -fnative-half-type. For #57914 >From 5809281176c75712752fe152c160ce964993726e Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Wed, 8 May 2024 09:46:44 -0400 Subject:

[clang] Revert "[HLSL] Support packoffset attribute in AST (#89836)" (PR #91473)

2024-05-08 Thread Xiang Li via cfe-commits
https://github.com/python3kgae closed https://github.com/llvm/llvm-project/pull/91473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[HLSL] Support packoffset attribute in AST (#89836)" (PR #91473)

2024-05-08 Thread Xiang Li via cfe-commits
https://github.com/python3kgae created https://github.com/llvm/llvm-project/pull/91473 This reverts commit c5509fedc5757fffece385d9d068e36b26793ade. >From 5809281176c75712752fe152c160ce964993726e Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Wed, 8 May 2024 09:46:44 -0400 Subject: [PATCH]

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-08 Thread Xiang Li via cfe-commits
https://github.com/python3kgae closed https://github.com/llvm/llvm-project/pull/89836 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DXIL] Set DXIL Version in DXIL target triple based on shader model version (PR #91407)

2024-05-07 Thread Xiang Li via cfe-commits
https://github.com/python3kgae approved this pull request. https://github.com/llvm/llvm-project/pull/91407 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-07 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/89836 >From 4d8c72688656fe3b2ce8817087d8cf7352b5876b Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 23 Apr 2024 17:49:02 -0400 Subject: [PATCH 01/10] [HLSL] Support packoffset attribute in AST Add

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-07 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/89836 >From 4d8c72688656fe3b2ce8817087d8cf7352b5876b Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 23 Apr 2024 17:49:02 -0400 Subject: [PATCH 1/9] [HLSL] Support packoffset attribute in AST Add

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-07 Thread Xiang Li via cfe-commits
@@ -4372,6 +4372,13 @@ def HLSLResourceBinding: InheritableAttr { let Documentation = [HLSLResourceBindingDocs]; } +def HLSLPackOffset: HLSLAnnotationAttr { + let Spellings = [HLSLAnnotation<"packoffset">]; + let LangOpts = [HLSL]; + let Args = [IntArgument<"Offset">];

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-07 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/89836 >From 4d8c72688656fe3b2ce8817087d8cf7352b5876b Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 23 Apr 2024 17:49:02 -0400 Subject: [PATCH 1/8] [HLSL] Support packoffset attribute in AST Add

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-06 Thread Xiang Li via cfe-commits
python3kgae wrote: > I'm marking this as requesting changes because I don't think we should land > this as-is. Switched to warning. https://github.com/llvm/llvm-project/pull/89836 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-06 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/89836 >From 4d8c72688656fe3b2ce8817087d8cf7352b5876b Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 23 Apr 2024 17:49:02 -0400 Subject: [PATCH 1/7] [HLSL] Support packoffset attribute in AST Add

[clang] [llvm] [DirectX][DXIL] Set DXIL Version in DXIL target triple based on shader model version (PR #90809)

2024-05-06 Thread Xiang Li via cfe-commits
@@ -2454,4 +2454,19 @@ TEST(TripleTest, isArmMClass) { EXPECT_TRUE(T.isArmMClass()); } } + +TEST(TripleTest, DXILNormaizeWithVersion) { + EXPECT_EQ("dxilv1.0-unknown-shadermodel6.0", +Triple::normalize("dxilv1.0--shadermodel6.0"));

[clang] [llvm] [DirectX][DXIL] Set DXIL Version in DXIL target triple based on shader model version (PR #90809)

2024-05-06 Thread Xiang Li via cfe-commits
@@ -2454,4 +2454,19 @@ TEST(TripleTest, isArmMClass) { EXPECT_TRUE(T.isArmMClass()); } } + +TEST(TripleTest, DXILNormaizeWithVersion) { + EXPECT_EQ("dxilv1.0-unknown-shadermodel6.0", +Triple::normalize("dxilv1.0--shadermodel6.0"));

[clang] [llvm] [DirectX][DXIL] Set DXIL Version in DXIL target triple based on shader model version (PR #90809)

2024-05-06 Thread Xiang Li via cfe-commits
@@ -2454,4 +2454,19 @@ TEST(TripleTest, isArmMClass) { EXPECT_TRUE(T.isArmMClass()); } } + +TEST(TripleTest, DXILNormaizeWithVersion) { + EXPECT_EQ("dxilv1.0-unknown-shadermodel6.0", +Triple::normalize("dxilv1.0--shadermodel6.0"));

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-05-02 Thread Xiang Li via cfe-commits
https://github.com/python3kgae edited https://github.com/llvm/llvm-project/pull/87578 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-05-02 Thread Xiang Li via cfe-commits
@@ -1,13 +1,15 @@ // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -ast-dump -o - %s | FileCheck %s python3kgae wrote: Should we support ``` float c : register(c10); ``` It is legal in dxc. https://github.com/llvm/llvm-project/pull/87578

[clang] [llvm] [DirectX][DXIL] Set DXIL Version in DXIL target triple based on shader model version (PR #90809)

2024-05-02 Thread Xiang Li via cfe-commits
@@ -115,6 +115,30 @@ StringRef Triple::getArchName(ArchType Kind, SubArchType SubArch) { if (SubArch == AArch64SubArch_arm64e) return "arm64e"; break; + case Triple::dxil: +switch (SubArch) { +case Triple::NoSubArch: python3kgae wrote:

[clang] [llvm] [DirectX][DXIL] Set DXIL Version in DXIL target triple based on shader model version (PR #90809)

2024-05-01 Thread Xiang Li via cfe-commits
@@ -760,7 +760,7 @@ using namespace clang::targets; TargetInfo * TargetInfo::CreateTargetInfo(DiagnosticsEngine , const std::shared_ptr ) { - llvm::Triple Triple(Opts->Triple); + llvm::Triple Triple(llvm::Triple::normalize(Opts->Triple));

[clang] [llvm] [DirectX][DXIL] Set DXIL Version in DXIL target triple based on shader model version (PR #90809)

2024-05-01 Thread Xiang Li via cfe-commits
@@ -760,7 +760,7 @@ using namespace clang::targets; TargetInfo * TargetInfo::CreateTargetInfo(DiagnosticsEngine , const std::shared_ptr ) { - llvm::Triple Triple(Opts->Triple); + llvm::Triple Triple(llvm::Triple::normalize(Opts->Triple));

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Xiang Li via cfe-commits
@@ -7398,6 +7398,26 @@ The full documentation is available here: https://docs.microsoft.com/en-us/windo }]; } +def HLSLPackOffsetDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The packoffset attribute is used to change the layout of a

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/89836 >From 4d8c72688656fe3b2ce8817087d8cf7352b5876b Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 23 Apr 2024 17:49:02 -0400 Subject: [PATCH 1/6] [HLSL] Support packoffset attribute in AST Add

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Xiang Li via cfe-commits
@@ -1745,5 +1745,7 @@ def err_hlsl_separate_attr_arg_and_number : Error<"wrong argument format for hls def ext_hlsl_access_specifiers : ExtWarn< "access specifiers are a clang HLSL extension">, InGroup; +def err_hlsl_unsupported_component : Error<"invalid component '%0'

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Xiang Li via cfe-commits
@@ -4372,6 +4372,13 @@ def HLSLResourceBinding: InheritableAttr { let Documentation = [HLSLResourceBindingDocs]; } +def HLSLPackOffset: HLSLAnnotationAttr { + let Spellings = [HLSLAnnotation<"packoffset">]; + let LangOpts = [HLSL]; + let Args = [IntArgument<"Offset">];

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Xiang Li via cfe-commits
https://github.com/python3kgae edited https://github.com/llvm/llvm-project/pull/89836 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Xiang Li via cfe-commits
@@ -4372,6 +4372,13 @@ def HLSLResourceBinding: InheritableAttr { let Documentation = [HLSLResourceBindingDocs]; } +def HLSLPackOffset: HLSLAnnotationAttr { + let Spellings = [HLSLAnnotation<"packoffset">]; + let LangOpts = [HLSL]; + let Args = [IntArgument<"Offset">];

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Xiang Li via cfe-commits
@@ -7314,6 +7314,41 @@ static void handleHLSLSV_DispatchThreadIDAttr(Sema , Decl *D, D->addAttr(::new (S.Context) HLSLSV_DispatchThreadIDAttr(S.Context, AL)); } +static void handleHLSLPackOffsetAttr(Sema , Decl *D, const ParsedAttr ) { + if (!isa(D) ||

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/89836 >From 4d8c72688656fe3b2ce8817087d8cf7352b5876b Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 23 Apr 2024 17:49:02 -0400 Subject: [PATCH 1/5] [HLSL] Support packoffset attribute in AST Add

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Xiang Li via cfe-commits
@@ -7398,6 +7398,26 @@ The full documentation is available here: https://docs.microsoft.com/en-us/windo }]; } +def HLSLPackOffsetDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The packoffset attribute is used to change the layout of a

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Xiang Li via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -triple dxil-unknown-shadermodel6.3-library -S -finclude-default-header -ast-dump -x hlsl %s | FileCheck %s + + +// CHECK: HLSLBufferDecl {{.*}} cbuffer A +cbuffer A +{ +// CHECK-NEXT: VarDecl {{.*}} C1 'float4' +// CHECK-NEXT:

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Xiang Li via cfe-commits
@@ -183,6 +183,86 @@ void Parser::ParseHLSLAnnotations(ParsedAttributes , return; } } break; + case ParsedAttr::AT_HLSLPackOffset: { +// Parse 'packoffset( c[Subcomponent][.component] )'. +// Check '('. +if (ExpectAndConsume(tok::l_paren,

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Xiang Li via cfe-commits
@@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library -verify %s + +// expected-error@+1{{cannot mix packoffset elements with nonpackoffset elements in a cbuffer}} +cbuffer Mix +{ +float4 M1 : packoffset(c0); +float M2; +

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Xiang Li via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -triple dxil-unknown-shadermodel6.3-library -S -finclude-default-header -ast-dump -x hlsl %s | FileCheck %s + + +// CHECK: HLSLBufferDecl {{.*}} cbuffer A +cbuffer A +{ +// CHECK-NEXT: VarDecl {{.*}} C1 'float4'

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/89836 >From 4d8c72688656fe3b2ce8817087d8cf7352b5876b Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 23 Apr 2024 17:49:02 -0400 Subject: [PATCH 1/4] [HLSL] Support packoffset attribute in AST Add

[clang] [llvm] [DirectX] Start documenting DXIL Resource handling (PR #90553)

2024-05-01 Thread Xiang Li via cfe-commits
@@ -0,0 +1,799 @@ +== +DXIL Resource Handling +== + +.. contents:: + :local: + +.. toctree:: + :hidden: + +Introduction + + +Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and +eventually lowered by the

[clang] [llvm] [DirectX] Start documenting DXIL Resource handling (PR #90553)

2024-04-30 Thread Xiang Li via cfe-commits
@@ -0,0 +1,794 @@ +== +DXIL Resource Handling +== + +.. contents:: + :local: + +.. toctree:: + :hidden: + +Introduction + + +Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and +eventually lowered by the

[clang] [llvm] [DirectX] Start documenting DXIL Resource handling (PR #90553)

2024-04-30 Thread Xiang Li via cfe-commits
@@ -0,0 +1,799 @@ +== +DXIL Resource Handling +== + +.. contents:: + :local: + +.. toctree:: + :hidden: + +Introduction + + +Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and +eventually lowered by the

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-29 Thread Xiang Li via cfe-commits
@@ -44,7 +44,7 @@ void foo2() { // expected-warning@+1 {{'register' attribute only applies to cbuffer/tbuffer and external global variables}} extern RWBuffer U2 : register(u5); } -// FIXME: expect-error once fix https://github.com/llvm/llvm-project/issues/57886. +//

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-29 Thread Xiang Li via cfe-commits
@@ -44,7 +44,7 @@ void foo2() { // expected-warning@+1 {{'register' attribute only applies to cbuffer/tbuffer and external global variables}} extern RWBuffer U2 : register(u5); } -// FIXME: expect-error once fix https://github.com/llvm/llvm-project/issues/57886. +//

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-29 Thread Xiang Li via cfe-commits
@@ -44,7 +44,7 @@ void foo2() { // expected-warning@+1 {{'register' attribute only applies to cbuffer/tbuffer and external global variables}} extern RWBuffer U2 : register(u5); } -// FIXME: expect-error once fix https://github.com/llvm/llvm-project/issues/57886. +//

[clang] [llvm] [DirectX] Set DXIL Version using shader model version in compilation target profile (PR #89823)

2024-04-26 Thread Xiang Li via cfe-commits
https://github.com/python3kgae edited https://github.com/llvm/llvm-project/pull/89823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Set DXIL Version using shader model version in compilation target profile (PR #89823)

2024-04-26 Thread Xiang Li via cfe-commits
@@ -2,39 +2,45 @@ // Supported targets // -// RUN: %clang -target dxil--shadermodel6.2-pixel %s -S -o /dev/null 2>&1 | FileCheck --check-prefix=CHECK-VALID %s -// RUN: %clang -target dxil-unknown-shadermodel6.2-pixel %s -S -o /dev/null 2>&1 | FileCheck

[clang] [Clang][HLSL] Add environment parameter to availability attribute (PR #89809)

2024-04-26 Thread Xiang Li via cfe-commits
@@ -1016,7 +1016,34 @@ static llvm::StringRef canonicalizePlatformName(llvm::StringRef Platform) { .Case("visionos_app_extension", "xros_app_extension") .Case("ShaderModel", "shadermodel") .Default(Platform); -} }]; +} +static

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-04-25 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/89836 >From 4d8c72688656fe3b2ce8817087d8cf7352b5876b Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 23 Apr 2024 17:49:02 -0400 Subject: [PATCH 1/3] [HLSL] Support packoffset attribute in AST Add

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-24 Thread Xiang Li via cfe-commits
@@ -25,6 +25,7 @@ enum class ResourceClass : uint8_t { SRV = 0, UAV, CBuffer, + TBuffer, python3kgae wrote: TBuffer should be a resource kind, not resource class. https://github.com/llvm/llvm-project/pull/87578

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-24 Thread Xiang Li via cfe-commits
@@ -12154,6 +12154,8 @@ def err_hlsl_missing_semantic_annotation : Error< def err_hlsl_init_priority_unsupported : Error< "initializer priorities are not supported in HLSL">; +def err_hlsl_mismatching_register_resource_type_and_name: Error<"invalid register name prefix

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-04-24 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/89836 >From 4d8c72688656fe3b2ce8817087d8cf7352b5876b Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 23 Apr 2024 17:49:02 -0400 Subject: [PATCH 1/2] [HLSL] Support packoffset attribute in AST Add

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-04-23 Thread Xiang Li via cfe-commits
https://github.com/python3kgae created https://github.com/llvm/llvm-project/pull/89836 Add HLSLPackOffsetAttr to save packoffset in AST. Since we have to parse the attribute manually in ParseHLSLAnnotations, we could create the ParsedAttribute with a integer offset parameter instead of

[clang] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-22 Thread Xiang Li via cfe-commits
@@ -9,7 +9,7 @@ cbuffer A : register(b0, space2) { } // CHECK: @[[TB:.+]] = external constant { float, double } -tbuffer A : register(t2, space1) { +tbuffer A : register(b2, space1) { python3kgae wrote: This is tbuffer, it should use 't' instead of 'b'.

[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

2024-04-18 Thread Xiang Li via cfe-commits
https://github.com/python3kgae approved this pull request. https://github.com/llvm/llvm-project/pull/89309 ___ 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-04-15 Thread Xiang Li via cfe-commits
@@ -0,0 +1,291 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are

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

2024-04-15 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/88781 >From 0065f8eade1fc00bce560ceeba9431a4616615b9 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 15 Apr 2024 12:23:46 -0700 Subject: [PATCH 1/4] [Doc][HLSL] Add documentation for root signature This patch

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

2024-04-15 Thread Xiang Li via cfe-commits
@@ -0,0 +1,291 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are

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

2024-04-15 Thread Xiang Li via cfe-commits
@@ -0,0 +1,291 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are

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

2024-04-15 Thread Xiang Li via cfe-commits
@@ -0,0 +1,291 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are

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

2024-04-15 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/88781 >From 0065f8eade1fc00bce560ceeba9431a4616615b9 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 15 Apr 2024 12:23:46 -0700 Subject: [PATCH 1/3] [Doc][HLSL] Add documentation for root signature This patch

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

2024-04-15 Thread Xiang Li via cfe-commits
https://github.com/python3kgae edited https://github.com/llvm/llvm-project/pull/88781 ___ 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-04-15 Thread Xiang Li via cfe-commits
@@ -0,0 +1,291 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are

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

2024-04-15 Thread Xiang Li via cfe-commits
@@ -0,0 +1,291 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are

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

2024-04-15 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/88781 >From 0065f8eade1fc00bce560ceeba9431a4616615b9 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 15 Apr 2024 12:23:46 -0700 Subject: [PATCH 1/2] [Doc][HLSL] Add documentation for root signature This patch

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

2024-04-15 Thread Xiang Li via cfe-commits
https://github.com/python3kgae created https://github.com/llvm/llvm-project/pull/88781 This patch adds documentation for the root signature in HLSL. For issue #55116 >From 0065f8eade1fc00bce560ceeba9431a4616615b9 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 15 Apr 2024 12:23:46 -0700

[clang] [llvm] [HLSL] move rcp to cgbuiltins (PR #88401)

2024-04-11 Thread Xiang Li via cfe-commits
https://github.com/python3kgae approved this pull request. https://github.com/llvm/llvm-project/pull/88401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] move rcp to cgbuiltins (PR #88401)

2024-04-11 Thread Xiang Li via cfe-commits
@@ -0,0 +1,126 @@ + ; RUN: llc -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s + +; CHECK-DAG: %[[#float_64:]] = OpTypeFloat 64 +; CHECK-DAG: %[[#float_32:]] = OpTypeFloat 32 +; CHECK-DAG: %[[#float_16:]] = OpTypeFloat 16 +; CHECK-DAG: %[[#vec2_float_16:]] =

[clang] [llvm] [HLSL] move rcp to cgbuiltins (PR #88401)

2024-04-11 Thread Xiang Li via cfe-commits
https://github.com/python3kgae edited https://github.com/llvm/llvm-project/pull/88401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] move rcp to cgbuiltins (PR #88401)

2024-04-11 Thread Xiang Li via cfe-commits
@@ -0,0 +1,126 @@ + ; RUN: llc -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s + +; CHECK-DAG: %[[#float_64:]] = OpTypeFloat 64 +; CHECK-DAG: %[[#float_32:]] = OpTypeFloat 32 +; CHECK-DAG: %[[#float_16:]] = OpTypeFloat 16 +; CHECK-DAG: %[[#vec2_float_16:]] =

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

2024-04-08 Thread Xiang Li via cfe-commits
https://github.com/python3kgae closed https://github.com/llvm/llvm-project/pull/83933 ___ 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 #83933)

2024-04-08 Thread Xiang Li via cfe-commits
python3kgae wrote: > I think we need to break this PR up into different parts going to different > places. > > Documenting the RootSignature grammar and usage in the Clang docs makes sense. > > I think documentation of the RootSignature binary format probably should live > with the DirectX

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

2024-04-05 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/83933 >From b134854e7e183a1113ee6ae5c5f7b7910270c987 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 4 Mar 2024 16:39:41 -0800 Subject: [PATCH 01/19] [DOC][HLSL] Add documentation for root signature This patch

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

2024-04-05 Thread Xiang Li via cfe-commits
@@ -0,0 +1,562 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are

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

2024-04-05 Thread Xiang Li via cfe-commits
@@ -0,0 +1,426 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are

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

2024-04-05 Thread Xiang Li via cfe-commits
@@ -0,0 +1,426 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are

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

2024-04-05 Thread Xiang Li via cfe-commits
python3kgae wrote: > I did not see any discussion of local root signatures here. It is probably > good to consider those as well when thinking about this design. There is > alternate syntax for specifying both local root signatues and global root > signatures starting in SM 6.3 > >

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

2024-04-05 Thread Xiang Li via cfe-commits
@@ -0,0 +1,258 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are

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

2024-04-05 Thread Xiang Li via cfe-commits
@@ -0,0 +1,426 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are

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

2024-04-05 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/83933 >From b134854e7e183a1113ee6ae5c5f7b7910270c987 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 4 Mar 2024 16:39:41 -0800 Subject: [PATCH 01/18] [DOC][HLSL] Add documentation for root signature This patch

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

2024-03-30 Thread Xiang Li via cfe-commits
@@ -0,0 +1,258 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are

[clang] [llvm] [HLSL][DXIL] HLSL's `round` should follow `roundeven` behavior (PR #87078)

2024-03-29 Thread Xiang Li via cfe-commits
https://github.com/python3kgae approved this pull request. https://github.com/llvm/llvm-project/pull/87078 ___ 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 #83933)

2024-03-29 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/83933 >From b134854e7e183a1113ee6ae5c5f7b7910270c987 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 4 Mar 2024 16:39:41 -0800 Subject: [PATCH 01/17] [DOC][HLSL] Add documentation for root signature This patch

[clang] [HLSL] prevent generation of wrong double intrinsics. (PR #86932)

2024-03-28 Thread Xiang Li via cfe-commits
https://github.com/python3kgae approved this pull request. https://github.com/llvm/llvm-project/pull/86932 ___ 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 #83933)

2024-03-27 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/83933 >From b134854e7e183a1113ee6ae5c5f7b7910270c987 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 4 Mar 2024 16:39:41 -0800 Subject: [PATCH 01/16] [DOC][HLSL] Add documentation for root signature This patch

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

2024-03-27 Thread Xiang Li via cfe-commits
@@ -0,0 +1,426 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are

  1   2   3   >