[clang] Create Texture Dimension attribute in HLSL (PR #104239)

2024-08-29 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 converted_to_draft https://github.com/llvm/llvm-project/pull/104239 ___ 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-08-30 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/106782 The space parameter in the register binding annotation may not be used for global constants. There was previously no diagnostic emitted when this case occurred. This PR adds a diagnostic when this case occurs,

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 edited 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 testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/106782 >From 99408f31a8946df7ef9efa223d0dba2ab876fcd0 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 30 Aug 2024 12:08:37 -0700 Subject: [PATCH 1/2] add diag and testing for space and global constants ---

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/106782 >From 99408f31a8946df7ef9efa223d0dba2ab876fcd0 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 30 Aug 2024 12:08:37 -0700 Subject: [PATCH 1/3] add diag and testing for space and global constants ---

[clang-tools-extra] Fix Default Asset File locator for clang docs (PR #97505)

2024-07-08 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/97505 >From 1c190c9c6b55aec23bab6d7b2a0f489c59285dc7 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 2 Jul 2024 18:38:24 -0700 Subject: [PATCH 1/7] if debug exists, go up an extra dir --- clang-tools-extra/

[clang-tools-extra] Fix Default Asset File locator for clang docs (PR #97505)

2024-07-08 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/97505 >From 1c190c9c6b55aec23bab6d7b2a0f489c59285dc7 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 2 Jul 2024 18:38:24 -0700 Subject: [PATCH 1/8] if debug exists, go up an extra dir --- clang-tools-extra/

[clang-tools-extra] Fix Default Asset File locator for clang docs (PR #97505)

2024-07-08 Thread Joshua Batista via cfe-commits
@@ -25,17 +25,15 @@ set(assets ) set(asset_dir "${CMAKE_CURRENT_SOURCE_DIR}/../assets") -set(resource_dir "${CMAKE_BINARY_DIR}/share/clang-doc") set(out_files) function(copy_files_to_dst src_dir dst_dir file) set(src "${src_dir}/${file}") set(dst "${dst_dir}/${file}"

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Joshua Batista via cfe-commits
@@ -437,7 +460,206 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct register_binding_flags { + bool resource = false; + bool udt = false; + bool other = false; + bool basic = false; + + bool srv = false; + bool uav =

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Joshua Batista via cfe-commits
@@ -437,7 +460,406 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct register_binding_flags { + bool resource = false; + bool udt = false; + bool other = false; + bool basic = false; + + bool srv = false; + bool uav =

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Joshua Batista via cfe-commits
@@ -437,7 +460,406 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct register_binding_flags { + bool resource = false; + bool udt = false; + bool other = false; + bool basic = false; + + bool srv = false; + bool uav =

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,104 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer" +struct Eg1 { + float f; + // Buffer Buf; bob80905 wrote: Yes, it is intentional. The commented-out examples canno

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,104 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer" +struct Eg1 { + float f; + // Buffer Buf; + RWBuffer RWBuf; + }; +Eg1 e1 : /* register(t0) :*/ register(u0); +// Valid: f is skip

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Joshua Batista via cfe-commits
@@ -437,7 +460,406 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct register_binding_flags { + bool resource = false; + bool udt = false; + bool other = false; + bool basic = false; + + bool srv = false; + bool uav =

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,104 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer" +struct Eg1 { + float f; + // Buffer Buf; bob80905 wrote: No, it isn't possible, because the tests in udt depend o

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Joshua Batista via cfe-commits
@@ -437,7 +460,406 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct register_binding_flags { + bool resource = false; + bool udt = false; + bool other = false; + bool basic = false; + + bool srv = false; + bool uav =

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,104 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer" +struct Eg1 { + float f; + // Buffer Buf; + RWBuffer RWBuf; + }; +Eg1 e1 : /* register(t0) :*/ register(u0); +// Valid: f is skip

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

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

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Joshua Batista via cfe-commits
@@ -470,13 +892,15 @@ void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { // Validate. if (!Slot.empty()) { switch (Slot[0]) { +case 't': case 'u': case 'b': case 's': -case 't': +case 'c': +case 'i': break;

[clang-tools-extra] Fix Default Asset File locator for clang docs (PR #97505)

2024-07-08 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/97505 >From 1c190c9c6b55aec23bab6d7b2a0f489c59285dc7 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 2 Jul 2024 18:38:24 -0700 Subject: [PATCH 1/9] if debug exists, go up an extra dir --- clang-tools-extra/

[clang-tools-extra] Fix Default Asset File locator for clang docs (PR #97505)

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

[clang-tools-extra] Fix Default Asset File locator for clang docs (PR #97505)

2024-07-09 Thread Joshua Batista via cfe-commits
bob80905 wrote: Closing this PR since https://github.com/llvm/llvm-project/pull/98099 resolves the issue and has already been merged. https://github.com/llvm/llvm-project/pull/97505 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

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

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-07-09 Thread Joshua Batista via cfe-commits
@@ -437,7 +453,409 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct RegisterBindingFlags { + bool Resource = false; + bool Udt = false; + bool Other = false; + bool Basic = false; + + bool Srv = false; + bool Uav = f

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-07-09 Thread Joshua Batista via cfe-commits
@@ -437,7 +453,409 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct RegisterBindingFlags { + bool Resource = false; + bool Udt = false; + bool Other = false; + bool Basic = false; + + bool Srv = false; + bool Uav = f

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-07-09 Thread Joshua Batista via cfe-commits
@@ -437,7 +453,409 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct RegisterBindingFlags { + bool Resource = false; + bool Udt = false; + bool Other = false; + bool Basic = false; + + bool Srv = false; + bool Uav = f

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-07-09 Thread Joshua Batista via cfe-commits
@@ -437,7 +453,409 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct RegisterBindingFlags { + bool Resource = false; + bool Udt = false; + bool Other = false; + bool Basic = false; + + bool Srv = false; + bool Uav = f

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-07-09 Thread Joshua Batista via cfe-commits
@@ -437,7 +453,409 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct RegisterBindingFlags { + bool Resource = false; + bool Udt = false; + bool Other = false; + bool Basic = false; + + bool Srv = false; + bool Uav = f

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-07-09 Thread Joshua Batista via cfe-commits
@@ -437,7 +453,409 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct RegisterBindingFlags { + bool Resource = false; + bool Udt = false; + bool Other = false; + bool Basic = false; + + bool Srv = false; + bool Uav = f

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-07-09 Thread Joshua Batista via cfe-commits
@@ -490,34 +490,36 @@ void HLSLExternalSemaSource::defineTrivialHLSLTypes() { } /// Set up common members and attributes for buffer types -static BuiltinTypeDeclBuilder setupBufferType(CXXRecordDecl *Decl, Sema &S, - ResourceClass R

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-07-09 Thread Joshua Batista via cfe-commits
@@ -12303,7 +12303,10 @@ def err_hlsl_missing_semantic_annotation : Error< def err_hlsl_init_priority_unsupported : Error< "initializer priorities are not supported in HLSL">; -def err_hlsl_unsupported_register_type : Error<"invalid resource class specifier '%0' used; expec

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-07-09 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,104 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer" +struct Eg1 { + float f; + // Buffer Buf; + RWBuffer RWBuf; + }; +Eg1 e1 : /* register(t0) :*/ register(u0); +// Valid: f is skip

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-07-09 Thread Joshua Batista via cfe-commits
@@ -437,7 +453,409 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct RegisterBindingFlags { + bool Resource = false; + bool Udt = false; + bool Other = false; + bool Basic = false; + + bool Srv = false; + bool Uav = f

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-07-09 Thread Joshua Batista via cfe-commits
@@ -635,46 +626,52 @@ RegisterBindingFlags HLSLFillRegisterBindingFlags(Sema &S, Decl *D) { } else r.Other = true; } - } else { -llvm_unreachable("unknown decl type"); } return r; } +int getRegisterTypeIndex(StringRef Slot) { + switch (Slot[0])

[clang] [HLSL] Split out resource class data from resource attribute (PR #98419)

2024-07-10 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/98419 The ability to spell out and specify the resource class is necessary for testing various resource behaviors. Though it is not intended for users to use this in customized HLSL source code, the ability to specif

[clang] [HLSL] Split out resource class data from resource attribute (PR #98419)

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

[clang] [HLSL] Split out resource class data from resource attribute (PR #98419)

2024-07-10 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/98419 >From b740aa9da3baf4fbd32b5a2c59d70bf2f224f700 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 10 Jul 2024 17:10:26 -0700 Subject: [PATCH 1/2] split out resource class data from resource attr, add some

[clang] [HLSL] Split out resource class data from resource attribute (PR #98419)

2024-07-10 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/98419 >From b740aa9da3baf4fbd32b5a2c59d70bf2f224f700 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 10 Jul 2024 17:10:26 -0700 Subject: [PATCH 1/3] split out resource class data from resource attr, add some

[clang] [HLSL] Split out resource class data from resource attribute (PR #98419)

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

[clang] [HLSL] Split out resource class data from resource attribute (PR #98419)

2024-07-11 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/98419 >From b740aa9da3baf4fbd32b5a2c59d70bf2f224f700 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 10 Jul 2024 17:10:26 -0700 Subject: [PATCH 1/4] split out resource class data from resource attr, add some

[clang] [HLSL] Split out resource class data from resource attribute (PR #98419)

2024-07-11 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,38 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o - %s | FileCheck %s + + +// CHECK: -HLSLResourceClassAttr 0x{{[0-9a-f]+}} <> SRV +struct [[hlsl::resource_class(SRV)]] Eg1 { + int i; +}; + +Eg1 e1; + +// CHECK: -CXXRecordDecl 0x{

[clang] [HLSL] Split out resource class data from resource attribute (PR #98419)

2024-07-11 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/98419 >From b740aa9da3baf4fbd32b5a2c59d70bf2f224f700 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 10 Jul 2024 17:10:26 -0700 Subject: [PATCH 1/5] split out resource class data from resource attr, add some

[clang] [HLSL] Split out resource class data from resource attribute (PR #98419)

2024-07-11 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/98419 >From b740aa9da3baf4fbd32b5a2c59d70bf2f224f700 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 10 Jul 2024 17:10:26 -0700 Subject: [PATCH 1/6] split out resource class data from resource attr, add some

[clang] [HLSL] Split out resource class data from resource attribute (PR #98419)

2024-07-11 Thread Joshua Batista via cfe-commits
@@ -7,7 +7,7 @@ struct [[hlsl::resource_class()]] Eg1 { Eg1 e1; -// expected-error@+1{{invalid resource class 'gibberish' used; expected 'SRV', 'UAV', 'CBuffer', or 'Sampler'}} +// expected-warning@+1{{ResourceClass attribute argument not supported: gibberish}}

[clang] [HLSL] Split out resource class data from resource attribute (PR #98419)

2024-07-11 Thread Joshua Batista via cfe-commits
@@ -437,6 +437,33 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { + if (!AL.isArgIdent(0)) { +Diag(AL.getLoc(), diag::err_attribute_argument_type) +

[clang] [HLSL] Split out resource class data from resource attribute (PR #98419)

2024-07-11 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -o - %s -verify + +// expected-error@+1{{'resource_class' attribute takes one argument}} +struct [[hlsl::resource_class()]] Eg1 { + int i; +}; + +Eg1 e1; + +// expected-error@+1{{invalid resource class

[clang] [HLSL] Split out resource class data from resource attribute (PR #98419)

2024-07-12 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/98419 >From b740aa9da3baf4fbd32b5a2c59d70bf2f224f700 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 10 Jul 2024 17:10:26 -0700 Subject: [PATCH 1/8] split out resource class data from resource attr, add some

[clang] [HLSL] Split out resource class data from resource attribute (PR #98419)

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

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

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

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-07-12 Thread Joshua Batista via cfe-commits
@@ -1,9 +1,10 @@ // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify -// expected-error@+1 {{invalid resource class specifier 'c' used; expected 'b', 's', 't', or 'u'}} -float a : register(c0, space1); +// valid, The register keywor

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

2024-05-01 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 01/12] implement binding type error for t/cbuffers and rwbuffers

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

2024-05-01 Thread Joshua Batista 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: +case Triple::DXILSubArch_v1_0: +

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

2024-05-02 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 01/13] implement binding type error for t/cbuffers and rwbuffers

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

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

[clang] [HLSL][CMake] Add clangd and distribution settings (PR #92011)

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

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

2024-07-31 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/101256 >From 7027cf254ae1b6acfdfbbf5dbeda3c4d6a4b3c43 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 26 Jul 2024 15:41:01 -0700 Subject: [PATCH 1/8] first attempt --- clang/docs/LanguageExtensions.rst

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

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

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

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

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

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

[clang] Attach resource attributes to handle within record, instead of record (PR #101433)

2024-07-31 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/101433 This PR attaches the resource attributes, `HLSLResourceAttr` and `HLSLResourceClassAttr`, to the handle contained within such resource classes like `RWBuffer`. CodeGen will now search for fields within HLSL re

[clang] Attach resource attributes to handle within record, instead of record (PR #101433)

2024-07-31 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/101433 >From b17ddcc6f2081135125d6178b22d033bcf7c0998 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 31 Jul 2024 17:01:56 -0700 Subject: [PATCH 1/3] add attrs to handle in record decl, add ast dump test to

[clang] [llvm] Add length builtins and length HLSL function to DirectX Backend (PR #101256)

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

[clang] [HLSL] cleanup builtin names elementwise usage (PR #101543)

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

[clang] [llvm] Add length builtins and length HLSL function to DirectX Backend (PR #101256)

2024-08-01 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,10 @@ +; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s + +; DXIL operation length does not support double overload type +; CHECK: LLVM ERROR: Invalid Overload + +define noundef double @test_length_double2(<2 x double> nou

[clang] Attach resource attributes to handle within record, instead of record (PR #101433)

2024-08-01 Thread Joshua Batista via cfe-commits
@@ -280,18 +280,22 @@ void CGHLSLRuntime::annotateHLSLResource(const VarDecl *D, GlobalVariable *GV) { const auto *RD = Ty->getAsCXXRecordDecl(); if (!RD) return; - const auto *HLSLResAttr = RD->getAttr(); - const auto *HLSLResClassAttr = RD->getAttr(); - if (!HLSLR

[clang] Attach resource attributes to handle within record, instead of record (PR #101433)

2024-08-01 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/101433 >From b17ddcc6f2081135125d6178b22d033bcf7c0998 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 31 Jul 2024 17:01:56 -0700 Subject: [PATCH 1/4] add attrs to handle in record decl, add ast dump test to

[clang] Attach resource attributes to handle within record, instead of record (PR #101433)

2024-08-01 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/101433 >From b17ddcc6f2081135125d6178b22d033bcf7c0998 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 31 Jul 2024 17:01:56 -0700 Subject: [PATCH 1/5] add attrs to handle in record decl, add ast dump test to

[clang] Attach resource attributes to handle within record, instead of record (PR #101433)

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

[clang] [llvm] Add length builtins and length HLSL function to DirectX Backend (PR #101256)

2024-08-02 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,10 @@ +; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s + +; DXIL operation length does not support scalar types +; CHECK: error: invalid intrinsic signature + +define noundef float @test_length_float(float noundef %p0) {

[clang] [llvm] Add length builtins and length HLSL function to DirectX Backend (PR #101256)

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

[clang] [llvm] [HLSL] AST support for WaveSize attribute. (PR #101240)

2024-08-07 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 commented: Other than my nits, looks good to me https://github.com/llvm/llvm-project/pull/101240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] AST support for WaveSize attribute. (PR #101240)

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

[clang] [llvm] [HLSL] AST support for WaveSize attribute. (PR #101240)

2024-08-07 Thread Joshua Batista via cfe-commits
@@ -2862,6 +2862,10 @@ static bool mergeDeclAttribute(Sema &S, NamedDecl *D, else if (const auto *NT = dyn_cast(Attr)) NewAttr = S.HLSL().mergeNumThreadsAttr(D, *NT, NT->getX(), NT->getY(), NT->getZ()); + else if (const auto *NT

[clang] [llvm] [HLSL] AST support for WaveSize attribute. (PR #101240)

2024-08-07 Thread Joshua Batista via cfe-commits
@@ -144,6 +145,25 @@ HLSLNumThreadsAttr *SemaHLSL::mergeNumThreadsAttr(Decl *D, HLSLNumThreadsAttr(getASTContext(), AL, X, Y, Z); } +HLSLWaveSizeAttr *SemaHLSL::mergeWaveSizeAttr(Decl *D, + const AttributeCommonInfo &AL, +

[clang] [llvm] [HLSL] AST support for WaveSize attribute. (PR #101240)

2024-08-07 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.8-library -x hlsl -ast-dump -o - %s | FileCheck %s + +// CHECK-LABLE:FunctionDecl 0x{{[0-9a-f]+}} <{{.*}}> w0 'void ()' +// CHECK:HLSLWaveSizeAttr 0x{{[0-9a-f]+}} <{{.*}}> 128 0 0 + [numthreads(8,8,1)] + [WaveSize(

[clang] [llvm] [HLSL] Add list of exported functions as named metadata node `dx.exports` (PR #102275)

2024-08-07 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,19 @@ +; RUN: opt -S -dxil-metadata-emit %s | FileCheck %s + +target triple = "dxilv1.3-unknown-shadermodel6.3-library" + +define void @"?f1@@YAXXZ"() #0 { +entry: + ret void +} + +define void @"?f2@MyNamespace@@YAXXZ"() #0 { +entry: + ret void +} + b

[clang] [llvm] [HLSL] AST support for WaveSize attribute. (PR #101240)

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

[clang] [llvm] [HLSL] Mark exported functions with "hlsl.export" attribute (PR #102275)

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

[clang] [clang][HLSL] Add sign intrinsic part 3 (PR #101989)

2024-08-07 Thread Joshua Batista via cfe-commits
@@ -916,7 +916,7 @@ float4 lerp(float4, float4, float4); /// \brief Returns the length of the specified floating-point vector. /// \param x [in] The vector of floats, or a scalar float. /// -/// Length is based on the following formula: sqrt(x[0]^2 + x[1]^2 + �). +/// Length is

[clang] [HLSL] Split out the ROV attribute from the resource attribute, make it a new spellable attribute. (PR #102414)

2024-08-07 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/102414 Much like #98193, this PR takes some more data out of the resource attribute, specifically the ROV data. This PR introduces a new attribute called HLSLROVAttr, which contains data on whether or not the decl th

[clang] [HLSL] Split out the ROV attribute from the resource attribute, make it a new spellable attribute. (PR #102414)

2024-08-07 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/102414 >From c35e4ec3f8ea27eedc0658921d8d9055451acd91 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 7 Aug 2024 19:34:54 -0700 Subject: [PATCH 1/2] split out ROV from resource attr --- clang/include/clang/

[clang] [HLSL] Split out the ROV attribute from the resource attribute, make it a new spellable attribute. (PR #102414)

2024-08-08 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/102414 >From c35e4ec3f8ea27eedc0658921d8d9055451acd91 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 7 Aug 2024 19:34:54 -0700 Subject: [PATCH 1/3] split out ROV from resource attr --- clang/include/clang/

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-16 Thread Joshua Batista via cfe-commits
@@ -459,7 +468,407 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-16 Thread Joshua Batista via cfe-commits
@@ -551,24 +541,21 @@ getHLSLResourceAttrFromEitherDecl(VarDecl *VD, // the resource attr could be on the record decl itself or on one of // its fields (the resource handle, most commonly) bob80905 wrote: Yes, I think I may have left support for that

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-20 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,76 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// This test validates the diagnostics that are emitted when a variable with a "resource" type +// is bound to a register using the register annotation + +// expe

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-20 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,131 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer", we use a substitute UDT +// to test the 't' binding type for this test. + +template +struct [[hlsl::resource_class(SRV)]] MyTemplated

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

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

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

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

[clang] Create Texture Dimension attribute in HLSL (PR #104239)

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

[clang] Create Texture Dimension attribute in HLSL (PR #104239)

2024-08-21 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/104239 >From aaa455933d3703b84634703fd4fcb5c815aa139e Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 14 Aug 2024 14:02:22 -0700 Subject: [PATCH 1/3] create texture dimension attr --- clang/include/clang/Ba

[clang] Create Texture Dimension attribute in HLSL (PR #104239)

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

[clang] Create Texture Dimension attribute in HLSL (PR #104239)

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

[clang] Create Texture Dimension attribute in HLSL (PR #104239)

2024-08-21 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o - %s | FileCheck %s + + +// CHECK: -HLSLTextureDimensionAttr 0x{{[0-9a-f]+}} 1 +struct [[hlsl::texture_dimension(1)]] Eg1 { bob80905 wrote: Yes, buffer resources won

[clang] Create Texture Dimension attribute in HLSL (PR #104239)

2024-08-21 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/104239 >From aaa455933d3703b84634703fd4fcb5c815aa139e Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 14 Aug 2024 14:02:22 -0700 Subject: [PATCH 1/4] create texture dimension attr --- clang/include/clang/Ba

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-22 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,71 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// This test validates the diagnostics that are emitted when a variable with a "resource" type +// is bound to a register using the register annotation + +/* +tem

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-22 Thread Joshua Batista via cfe-commits
@@ -1547,6 +1547,9 @@ def DXILValidation : DiagGroup<"dxil-validation">; // Warning for HLSL API availability def HLSLAvailability : DiagGroup<"hlsl-availability">; +// Warnings for legacy binding behavior +def DisallowLegacyBindingRules : DiagGroup<"disallow-legacy-binding-ru

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-22 Thread Joshua Batista via cfe-commits
@@ -503,9 +503,11 @@ void HLSLExternalSemaSource::defineHLSLTypesWithForwardDeclarations() { Decl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "RWBuffer") .addSimpleTemplateParams(*SemaPtr, {"element_type"}) .Record; + onCompletion(Decl, [th

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-22 Thread Joshua Batista via cfe-commits
@@ -459,7 +467,412 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-22 Thread Joshua Batista via cfe-commits
@@ -459,7 +467,412 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-22 Thread Joshua Batista via cfe-commits
@@ -551,24 +541,21 @@ getHLSLResourceAttrFromEitherDecl(VarDecl *VD, // the resource attr could be on the record decl itself or on one of // its fields (the resource handle, most commonly) -const auto *Attr = TheRecordDecl->getAttr(); +const auto *Attr = TheRec

<    1   2   3   4   5   6   7   >