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

2024-08-07 Thread Xiang Li via cfe-commits
python3kgae wrote: > > Could this be an analysis pass which collect the list as a > > SmallVector instead of creating the list in 'dx.exports' > > metadata? > > You mean the DXILFinalizeLinkage pass (coming soon) that needs a list of > entries and exported functions should get the information

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

2024-08-07 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/101240 >From c7a476a4d8b06e399e9c076cc15208871e1b5a25 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 30 Jul 2024 16:34:40 -0400 Subject: [PATCH 1/5] [HLSL] AST support for WaveSize attribute. First step for su

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

2024-08-07 Thread Xiang Li 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] AST support for WaveSize attribute. (PR #101240)

2024-08-07 Thread Xiang Li 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 Xiang Li 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] [DirectX] Add DirectXTargetCodeGenInfo (PR #104856)

2024-08-19 Thread Xiang Li via cfe-commits
@@ -0,0 +1,60 @@ +//===- DirectX.cpp +//---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier

[clang] [DirectX] Add DirectXTargetCodeGenInfo (PR #104856)

2024-08-20 Thread Xiang Li via cfe-commits
https://github.com/python3kgae approved this pull request. https://github.com/llvm/llvm-project/pull/104856 ___ 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 Xiang Li 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 { python3kgae wrote: Should we limit this a

[clang] [ParserHLSL] Attempt to parse HLSL annotations on Field Decls. (PR #96346)

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

[clang] [ParserHLSL] Attempt to parse HLSL annotations on Field Decls. (PR #96346)

2024-06-26 Thread Xiang Li via cfe-commits
@@ -1,10 +1,13 @@ -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -o - %s -verify +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o - %s | FileCheck %s -// TODO: update once we handle annotations on struct fields +// tests that

[clang] [ParserHLSL] Attempt to parse HLSL annotations on Field Decls. (PR #96346)

2024-06-26 Thread Xiang Li via cfe-commits
@@ -1,11 +1,24 @@ -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -o - %s -verify +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -ast-dump -x hlsl -o - %s | Filecheck %s -// expected-no-diagnostics struct MyBitFields { -unsigned int field1

[clang] [HLSL][clang][Driver] Fix error when using the option -fcgl in --driver-mode=dxc. (PR #97001)

2024-06-27 Thread Xiang Li via cfe-commits
https://github.com/python3kgae created https://github.com/llvm/llvm-project/pull/97001 When -fcgl is set in --driver-mode=dxc, both -S and -emit-llvm are currently enabled. This results in the following error: ``` error: '-S' action ignored; '-emit-llvm' action specified previously. ``` Thi

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

2024-06-28 Thread Xiang Li 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-06-28 Thread Xiang Li via cfe-commits
@@ -21,6 +21,7 @@ #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/SourceLocation.h" #include "clang/Sema/Scope.h" +#include "clang/Sema/Sema.h" python3kgae wrote: What led us to include Sema.h? https://github.com/llvm/llvm-project/pull/97103 __

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

2024-06-29 Thread Xiang Li 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-06-29 Thread Xiang Li via cfe-commits
@@ -21,6 +21,7 @@ #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/SourceLocation.h" #include "clang/Sema/Scope.h" +#include "clang/Sema/Sema.h" python3kgae wrote: If only SemaHLSL.cpp needs the header, could we move the include to SemaHLSL.cpp?

[clang] [llvm] [HLSL] Implement elementwise popcount (PR #108121)

2024-09-11 Thread Xiang Li via cfe-commits
python3kgae wrote: > > > This pull request is missing the appropriate text in 'ReleaseNotes.rst'. > > > I am looking for advice on what is appropriate to put in that file, and > > > where. > > > > > > Here's a PR with ReleaseNotes.rst change > > [57f879c#diff-ec770381d76c859f5f572db789175fe4

[clang] [llvm] [clang][hlsl] Add atan2 intrinsic part 1 (PR #107923)

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

[clang] [HLSL] generate hlsl.wavesize attribute (PR #107176)

2024-09-11 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/107176 >From 3b4ba1436220d6eef11bce713618aefb272ea74f Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 3 Sep 2024 22:56:21 -0400 Subject: [PATCH 1/2] [HLSL] generate hlsl.wavesize attribute Generate function att

[clang] Update StructuredBuffer-AST test after removal of HLSLResourceClassAttr (PR #108292)

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

[clang] [HLSL] Add HLSL 202y language mode (PR #108437)

2024-09-12 Thread Xiang Li via cfe-commits
@@ -12397,6 +12397,9 @@ def warn_attr_min_eq_max: Warning< def err_hlsl_attribute_number_arguments_insufficient_shader_model: Error< "attribute %0 with %1 arguments requires shader model %2 or greater">; +def ext_hlsl_auto_type_specifier : ExtWarn< python3k

[clang] [HLSL] Add HLSL 202y language mode (PR #108437)

2024-09-12 Thread Xiang Li via cfe-commits
https://github.com/python3kgae approved this pull request. https://github.com/llvm/llvm-project/pull/108437 ___ 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-13 Thread Xiang Li via cfe-commits
@@ -0,0 +1,56 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// valid +cbuffer cbuf { +RWBuffer r : register(u0, space0); +} + +cbuffer cbuf2 { +struct x { +// expected-error@+1 {{'register' attribute only ap

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

2024-09-13 Thread Xiang Li via cfe-commits
@@ -0,0 +1,56 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// valid +cbuffer cbuf { +RWBuffer r : register(u0, space0); +} + +cbuffer cbuf2 { +struct x { +// expected-error@+1 {{'register' attribute only ap

[clang] [HLSL] Add `[[hlsl::contained_type()]]` attribute (PR #108456)

2024-09-16 Thread Xiang Li via cfe-commits
https://github.com/python3kgae approved this pull request. Why the name is contained_type instead of element_type? https://github.com/llvm/llvm-project/pull/108456 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] Implementing `asfloat` using `bit_cast` (PR #108686)

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

[clang] [HLSL] Use HLSLToolChain for Vulkan (PR #110306)

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

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

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

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

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

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

2024-09-17 Thread Xiang Li via cfe-commits
https://github.com/python3kgae 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][NFC] Update resource attribute tests (PR #108919)

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

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

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

[clang] [HLSL] update StructuredBuffer subscript test for alwaysinline (PR #109023)

2024-09-17 Thread Xiang Li via cfe-commits
https://github.com/python3kgae approved this pull request. https://github.com/llvm/llvm-project/pull/109023 ___ 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 Xiang Li via cfe-commits
https://github.com/python3kgae approved this pull request. 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] generate hlsl.wavesize attribute (PR #107176)

2024-09-17 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/107176 >From 6de0eb900e845e6ac7918433c597bf3665b93741 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 3 Sep 2024 22:56:21 -0400 Subject: [PATCH 1/2] [HLSL] generate hlsl.wavesize attribute Generate function att

[clang] [HLSL] generate hlsl.wavesize attribute (PR #107176)

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

<    1   2   3   4