[clang] [llvm] [HLSL][RootSignature] Add parsing of remaining Descriptor Table params (PR #137038)

2025-04-25 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/137038 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add parsing of remaining Descriptor Table params (PR #137038)

2025-04-25 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/137038 >From dd004171f5777dc68b700a5bf0f96c9c703a57c9 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 23 Apr 2025 18:37:55 + Subject: [PATCH 1/2] pre-req: Add `unbounded` keyword to lexer --- clang/include

[clang] [llvm] [HLSL][RootSignature] Add parsing of DescriptorRangeFlags (PR #136775)

2025-04-25 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/136775 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add parsing of DescriptorRangeFlags (PR #136775)

2025-04-24 Thread Finn Plummer via cfe-commits
@@ -91,11 +92,19 @@ class RootSignatureParser { /// Parsing methods of various enums std::optional parseShaderVisibility(); + std::optional + parseDescriptorRangeFlags(); inbelic wrote: Yep, adding spaces will make clang-format complain. https://github

[clang] Reland "[HLSL][RootSignature] Define and integrate HLSLRootSignatureAttr" (PR #134293)

2025-04-24 Thread Finn Plummer via cfe-commits
inbelic wrote: Closing as this would actually introduce a circular dependency between clangParse and clangSema, as surprisingly, clangParse has a dependency on clangSema. This will need to reland after we move the HLSLRootSignatureParser into an accessible location (most likely within clangSem

[clang] Reland "[HLSL][RootSignature] Define and integrate HLSLRootSignatureAttr" (PR #134293)

2025-04-24 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/134293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add parsing of ShaderVisibility to DescriptorTable (PR #136751)

2025-04-24 Thread Finn Plummer via cfe-commits
https://github.com/inbelic reopened https://github.com/llvm/llvm-project/pull/136751 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add parsing of ShaderVisibility to DescriptorTable (PR #136751)

2025-04-24 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/136751 >From bf4bb7a08445df8f65cbee8b98e674fbbd154965 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Tue, 22 Apr 2025 19:42:50 + Subject: [PATCH] [HLSL][RootSignature] Add parsing of ShaderVisibility to Descrip

[clang] [llvm] [HLSL][RootSignature] Add parsing of ShaderVisibility to DescriptorTable (PR #136751)

2025-04-24 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/136751 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][RootSignatures] Conform to new std::optional calling conventions (PR #136747)

2025-04-24 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/136747 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][RootSignatures] Conform to new std::optional calling conventions (PR #136747)

2025-04-24 Thread Finn Plummer via cfe-commits
@@ -26,22 +26,14 @@ RootSignatureParser::RootSignatureParser(SmallVector &Elements, bool RootSignatureParser::parse() { // Iterate as many RootElements as possible - while (tryConsumeExpectedToken(TokenKind::kw_DescriptorTable)) { -// Dispatch onto parser method. -

[clang] [HLSL] Put tests for compatibility overloads for 'clamp', 'isinf', 'min', and 'max' in own files (PR #137004)

2025-04-23 Thread Finn Plummer via cfe-commits
https://github.com/inbelic approved this pull request. Can use the [NFC] tag as well if you want https://github.com/llvm/llvm-project/pull/137004 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [llvm] [NFC][RootSignatures] Conform to new std::optional calling conventions (PR #136747)

2025-04-23 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/136747 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Reland "[HLSL][RootSignature] Implement initial parsing of the descriptor table clause params" (PR #136740)

2025-04-23 Thread Finn Plummer via cfe-commits
@@ -90,36 +89,170 @@ bool RootSignatureParser::parseDescriptorTableClause() { CurToken.TokKind == TokenKind::kw_Sampler) && "Expects to only be invoked starting at given keyword"); + TokenKind ParamKind = CurToken.TokKind; + + if (consumeExpectedToken(Toke

[clang] [llvm] Reland "[HLSL][RootSignature] Implement initial parsing of the descriptor table clause params" (PR #136740)

2025-04-23 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/136740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Reland "[HLSL][RootSignature] Implement initial parsing of the descriptor table clause params" (PR #136740)

2025-04-23 Thread Finn Plummer via cfe-commits
@@ -129,10 +129,10 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseEmptyTest) { TEST_F(ParseHLSLRootSignatureTest, ValidParseDTClausesTest) { const llvm::StringLiteral Source = R"cc( DescriptorTable( - CBV(), - SRV(), - Sampler(), - UAV() + CBV(b0

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-18 Thread Finn Plummer via cfe-commits
inbelic wrote: I don't have any strong arguments against structuring it like described and have updated accordingly. Since we are changing the calling convention of the `parse.*` methods to use `std::optional` I had originally also updated the `parseDescriptorTable` and `parseDescriptorTable

[clang] [llvm] Revert "[HLSL][RootSignature] Implement initial parsing of the descriptor table clause params" (PR #136252)

2025-04-17 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/136252 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Revert "[HLSL][RootSignature] Implement initial parsing of the descriptor table clause params" (PR #136252)

2025-04-17 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/136252 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Revert "[HLSL][RootSignature] Implement initial parsing of the descriptor table clause params" (PR #136252)

2025-04-17 Thread Finn Plummer via cfe-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/136252 Reverts llvm/llvm-project#133800 Reverting to resolve the introduce naming collisions. >From c410a82b85a63274f7849de434d133a0f8706269 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Thu, 17 Apr 2025 20:56:49

[clang] [llvm] [HLSL][RootSignature] Implement initial parsing of the descriptor table clause params (PR #133800)

2025-04-17 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/133800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Implement initial parsing of the descriptor table clause params (PR #133800)

2025-04-17 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/133800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-17 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/133800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-17 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/133800 >From 9ff87eb37437dc92a554d1d89b236e9a13249694 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Mon, 31 Mar 2025 18:29:26 + Subject: [PATCH 01/10] [HLSL][RootSignature] Add infastructure to parse parameter

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-17 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/133800 >From 9ff87eb37437dc92a554d1d89b236e9a13249694 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Mon, 31 Mar 2025 18:29:26 + Subject: [PATCH 01/11] [HLSL][RootSignature] Add infastructure to parse parameter

[clang] [llvm] [HLSL] Implement the `faceforward` intrinsic (PR #135878)

2025-04-16 Thread Finn Plummer via cfe-commits
@@ -214,6 +214,53 @@ const inline double4 dst(double4 Src0, double4 Src1) { return __detail::dst_impl(Src0, Src1); } +//===--===// +// faceforward builtin +//===--

[clang] [HLSL] Add a warning for implicit bindings (PR #135909)

2025-04-16 Thread Finn Plummer via cfe-commits
@@ -3278,6 +3284,9 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl *VD) { << static_cast(RT); } } + + if (!HasBinding && VD->getType()->isHLSLResourceRecord()) inbelic wrote: I do also see the function `isResourceRecordTypeOrArrayOf`

[clang] [llvm] [HLSL] Implement the `faceforward` intrinsic (PR #135878)

2025-04-16 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,94 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ inbelic wrote: ```suggestion // RUN: %clang_cc1 -finclude-default-header -triple \ ``` `-x` just specifies the file extension, since the file is `.hlsl` it should naturally detect an

[clang] [llvm] [HLSL] Implement the `faceforward` intrinsic (PR #135878)

2025-04-16 Thread Finn Plummer via cfe-commits
@@ -137,6 +137,42 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned BuiltinID, TheCall->setType(RetTy); break; } + case SPIRV::BI__builtin_spirv_faceforward: { +if (SemaRef.checkArgCount(TheCall, 3)) + return true; + +// check if all arguments h

[clang] [llvm] [HLSL] Implement the `faceforward` intrinsic (PR #135878)

2025-04-16 Thread Finn Plummer via cfe-commits
@@ -137,6 +137,42 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned BuiltinID, TheCall->setType(RetTy); break; } + case SPIRV::BI__builtin_spirv_faceforward: { +if (SemaRef.checkArgCount(TheCall, 3)) + return true; + +// check if all arguments h

[clang] [llvm] [HLSL] Implement the `faceforward` intrinsic (PR #135878)

2025-04-16 Thread Finn Plummer via cfe-commits
https://github.com/inbelic commented: Just a collection of nits. LGTM https://github.com/llvm/llvm-project/pull/135878 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement the `faceforward` intrinsic (PR #135878)

2025-04-16 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/135878 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-14 Thread Finn Plummer via cfe-commits
@@ -32,11 +39,19 @@ struct DescriptorTable { using ClauseType = llvm::dxil::ResourceClass; struct DescriptorTableClause { ClauseType Type; + Register Register; + uint32_t Space = 0; }; // Models RootElement : DescriptorTable | DescriptorTableClause using RootElement =

[clang] [llvm] [DirectX] Use scalar arguments for @llvm.dx.dot intrinsics (PR #134570)

2025-04-11 Thread Finn Plummer via cfe-commits
https://github.com/inbelic approved this pull request. https://github.com/llvm/llvm-project/pull/134570 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-11 Thread Finn Plummer via cfe-commits
@@ -89,37 +88,178 @@ bool RootSignatureParser::parseDescriptorTableClause() { CurToken.TokKind == TokenKind::kw_UAV || CurToken.TokKind == TokenKind::kw_Sampler) && "Expects to only be invoked starting at given keyword"); + TokenKind ParamKind = Cu

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-11 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/133800 >From 9ff87eb37437dc92a554d1d89b236e9a13249694 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Mon, 31 Mar 2025 18:29:26 + Subject: [PATCH 1/8] [HLSL][RootSignature] Add infastructure to parse parameters

[clang] [llvm] [DirectX] Implement UseNativeLowPrecision shader flag analysis (PR #134288)

2025-04-10 Thread Finn Plummer via cfe-commits
@@ -282,10 +282,14 @@ void CGHLSLRuntime::addHLSLBufferLayoutType(const RecordType *StructType, void CGHLSLRuntime::finishCodeGen() { auto &TargetOpts = CGM.getTarget().getTargetOpts(); + auto &LangOpts = CGM.getLangOpts(); llvm::Module &M = CGM.getModule(); Triple T

[clang] [llvm] [DirectX] Implement UseNativeLowPrecision shader flag analysis (PR #134288)

2025-04-09 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,45 @@ +; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s +; RUN: llc %s --filetype=obj -o - | obj2yaml | FileCheck %s --check-prefix=DXC + +target triple = "dxil-pc-shadermodel6.7-library" + +;CHECK: ; Combined Shader Flags for Module +;CHECK-NEXT: ;

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-09 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/133800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-09 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/133800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-09 Thread Finn Plummer via cfe-commits
@@ -89,37 +88,178 @@ bool RootSignatureParser::parseDescriptorTableClause() { CurToken.TokKind == TokenKind::kw_UAV || CurToken.TokKind == TokenKind::kw_Sampler) && "Expects to only be invoked starting at given keyword"); + TokenKind ParamKind = Cu

[clang] Reland "[HLSL][RootSignature] Define and integrate HLSLRootSignatureAttr" (PR #134293)

2025-04-09 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/134293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Make it possible to assign an array from a cbuffer (PR #134174)

2025-04-08 Thread Finn Plummer via cfe-commits
@@ -2268,17 +2268,15 @@ static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType, // handling here. if (ToType->isArrayParameterType()) { FromType = S.Context.getArrayParameterType(FromType); - SCS.First = ICK_HLSL_Array_RValue; } else if (

[clang] [HLSL] Make it possible to assign an array from a cbuffer (PR #134174)

2025-04-08 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/134174 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Make it possible to assign an array from a cbuffer (PR #134174)

2025-04-08 Thread Finn Plummer via cfe-commits
https://github.com/inbelic approved this pull request. LGTM, just two small things https://github.com/llvm/llvm-project/pull/134174 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Make it possible to assign an array from a cbuffer (PR #134174)

2025-04-08 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/134174 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Make it possible to assign an array from a cbuffer (PR #134174)

2025-04-08 Thread Finn Plummer via cfe-commits
@@ -2268,17 +2268,15 @@ static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType, // handling here. if (ToType->isArrayParameterType()) { FromType = S.Context.getArrayParameterType(FromType); - SCS.First = ICK_HLSL_Array_RValue; } else if (

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-08 Thread Finn Plummer via cfe-commits
@@ -89,37 +88,178 @@ bool RootSignatureParser::parseDescriptorTableClause() { CurToken.TokKind == TokenKind::kw_UAV || CurToken.TokKind == TokenKind::kw_Sampler) && "Expects to only be invoked starting at given keyword"); + TokenKind ParamKind = Cu

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-07 Thread Finn Plummer via cfe-commits
@@ -89,37 +88,178 @@ bool RootSignatureParser::parseDescriptorTableClause() { CurToken.TokKind == TokenKind::kw_UAV || CurToken.TokKind == TokenKind::kw_Sampler) && "Expects to only be invoked starting at given keyword"); + TokenKind ParamKind = Cu

[clang] [llvm] [DirectX] Implement UseNativeLowPrecision shader flag analysis (PR #134288)

2025-04-07 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/134288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Implement UseNativeLowPrecision shader flag analysis (PR #134288)

2025-04-07 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,45 @@ +; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s +; RUN: llc %s --filetype=obj -o - | obj2yaml | FileCheck %s --check-prefix=DXC + +target triple = "dxil-pc-shadermodel6.7-library" + +;CHECK: ; Combined Shader Flags for Module +;CHECK-NEXT: ;

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-07 Thread Finn Plummer via cfe-commits
@@ -89,37 +88,178 @@ bool RootSignatureParser::parseDescriptorTableClause() { CurToken.TokKind == TokenKind::kw_UAV || CurToken.TokKind == TokenKind::kw_Sampler) && "Expects to only be invoked starting at given keyword"); + TokenKind ParamKind = Cu

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-07 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/133800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Implement UseNativeLowPrecision shader flag analysis (PR #134288)

2025-04-07 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/134288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Implement UseNativeLowPrecision shader flag analysis (PR #134288)

2025-04-07 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -fnative-half-type -finclude-default-header -triple dxil-pc-shadermodel6.3-library -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefix=FLAG inbelic wrote: nit: it feels like we could remove some of the flags

[clang] [llvm] [DirectX] Implement UseNativeLowPrecision shader flag analysis (PR #134288)

2025-04-07 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,45 @@ +; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s +; RUN: llc %s --filetype=obj -o - | obj2yaml | FileCheck %s --check-prefix=DXC + +target triple = "dxil-pc-shadermodel6.7-library" + +;CHECK: ; Combined Shader Flags for Module +;CHECK-NEXT: ;

[clang] [llvm] [DirectX] Implement UseNativeLowPrecision shader flag analysis (PR #134288)

2025-04-07 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/134288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Implement UseNativeLowPrecision shader flag analysis (PR #134288)

2025-04-07 Thread Finn Plummer via cfe-commits
https://github.com/inbelic commented: Assuming `-fnative-half-type` can be directly used as an alias to `enable-16bit-types` in DXC, this LGTM. Just some nits otherwise https://github.com/llvm/llvm-project/pull/134288 ___ cfe-commits mailing list cfe-

[clang] Reland "[HLSL][RootSignature] Define and integrate HLSLRootSignatureAttr" (PR #134293)

2025-04-07 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/134293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland "[HLSL][RootSignature] Define and integrate HLSLRootSignatureAttr" (PR #134293)

2025-04-07 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/134293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland "[HLSL][RootSignature] Define and integrate HLSLRootSignatureAttr" (PR #134293)

2025-04-04 Thread Finn Plummer via cfe-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/134293 This pr relands https://github.com/llvm/llvm-project/pull/134124. It resolves the many linking errors during build, [here](https://github.com/llvm/llvm-project/pull/134124#issuecomment-2776370486). There was a

[clang] [NFC][HLSL][RootSignature] Make the Lexer adhere to naming conventions (PR #134136)

2025-04-04 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/134136 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[HLSL][RootSignature] Define and integrate `HLSLRootSignatureAttr`" (PR #134273)

2025-04-04 Thread Finn Plummer via cfe-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/134273 Reverts llvm/llvm-project#134124 The build is failing again to a linking error: [here](https://github.com/llvm/llvm-project/pull/134124#issuecomment-2776370486). Again the error was not present locally or any

[clang] Reland "[HLSL][RootSignature] Define and integrate HLSLRootSignatureAttr" (PR #134293)

2025-04-03 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/134293 >From b5a61c786eac10b77c15a16b7425d158396a234b Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 2 Apr 2025 17:04:57 + Subject: [PATCH 1/2] [HLSL][RootSignature] Define and integrate `HLSLRootSignature

[clang] [llvm] [HLSL] Implement dot2add intrinsic (PR #131237)

2025-04-03 Thread Finn Plummer via cfe-commits
https://github.com/inbelic approved this pull request. LGTM once formatting is resolved https://github.com/llvm/llvm-project/pull/131237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[HLSL][RootSignature] Define and integrate `HLSLRootSignatureAttr`" (PR #134273)

2025-04-03 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/134273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-03 Thread Finn Plummer via cfe-commits
@@ -32,11 +39,19 @@ struct DescriptorTable { using ClauseType = llvm::dxil::ResourceClass; struct DescriptorTableClause { ClauseType Type; + Register Register; + uint32_t Space = 0; }; // Models RootElement : DescriptorTable | DescriptorTableClause using RootElement =

[clang] [HLSL][RootSignature] Define and integrate `HLSLRootSignatureAttr` (PR #134124)

2025-04-03 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/134124 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Revert "[HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses" (PR #133790)

2025-03-31 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/133790 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Revert "[HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses" (PR #133790)

2025-03-31 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/133790 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Revert "[HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses" (PR #133790)

2025-03-31 Thread Finn Plummer via cfe-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/133790 Reverts llvm/llvm-project#133302 Reverting to inspect build failures that were introduced from use of the `clang::Preprocessor`, and the warning about an unused declaration. See linked issue for failures. >Fr

[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)

2025-03-31 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/133302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)

2025-03-31 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/133302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][RootSignature] Make Root Signature lexer keywords case-insensitive (PR #132967)

2025-03-28 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/132967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)

2025-03-28 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/133302 >From 3094705b94fab19ecc75cb501cceae506bb0128e Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Fri, 14 Feb 2025 19:44:36 + Subject: [PATCH 01/14] [NFC][HLSL][RootSignature] add spelling of tokens to token

[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)

2025-03-28 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,188 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +#include "llvm/Support/raw_ostream.h" + +using namespace llvm::hlsl::rootsig; + +namespace clang { +namespace hlsl { + +static std::string FormatTokenKinds(ArrayRef Kinds) { inbelic wrote: Upda

[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)

2025-03-27 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,188 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +#include "llvm/Support/raw_ostream.h" + +using namespace llvm::hlsl::rootsig; + +namespace clang { +namespace hlsl { + +static std::string FormatTokenKinds(ArrayRef Kinds) { + std::string TokenString; + llvm::

[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)

2025-03-27 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,110 @@ +//===--- ParseHLSLRootSignature.h ---*- C++ -*-===// +// +// 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: Ap

[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)

2025-03-27 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/133302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)

2025-03-27 Thread Finn Plummer via cfe-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/133302 - defines the Parser class and an initial set of helper methods to support consuming tokens. functionality is demonstrated through a simple empty descriptor table test case - defines an initial in-memory represen

[clang] [HLSL][RootSignature] Make Root Signature lexer keywords case-insensitive (PR #132967)

2025-03-25 Thread Finn Plummer via cfe-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/132967 >From the corrections to the Root Signature specification here: >https://github.com/llvm/wg-hlsl/issues/192. It was denoted that keywords are >also case-insensitive in DXC. This pr adjusts the lexer to adhere

[clang] [llvm] [DirectX] Implement Shader Flags Analysis for ResMayNotAlias (PR #131070)

2025-03-18 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/131070 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Implement Shader Flags Analysis for ResMayNotAlias (PR #131070)

2025-03-17 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,39 @@ +; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s + +target triple = "dxil-pc-shadermodel6.8-library" + +; CHECK: Combined Shader Flags for Module +; CHECK-NEXT: Shader Flags Value: 0x20010 + +; CHECK: Note: extra DXIL module flags: +

[clang] [llvm] [DirectX] Implement Shader Flags Analysis for ResMayNotAlias (PR #131070)

2025-03-17 Thread Finn Plummer via cfe-commits
@@ -176,10 +198,16 @@ void ModuleShaderFlags::initialize(Module &M, DXILResourceTypeMap &DRTM, continue; } + // Set ResMayNotAlias to true if DXIL version < 1.8 and there are UAVs + // present globally. + if (CanSetResMayNotAlias && MMDI.DXILVersi

[clang] [llvm] [DirectX] Implement Shader Flags Analysis for ResMayNotAlias (PR #131070)

2025-03-17 Thread Finn Plummer via cfe-commits
inbelic wrote: Sure, although I would maybe argue that setting the module flag with a comment makes it more clear which shader flag we are interested in testing here. Just a suggestion though https://github.com/llvm/llvm-project/pull/131070 _

[clang] [llvm] [DirectX] Implement Shader Flags Analysis for ResMayNotAlias (PR #131070)

2025-03-17 Thread Finn Plummer via cfe-commits
https://github.com/inbelic commented: Nice work, just some minor comments/questions. As mentioned, we should have a definitive answer to if we need SRV to be included at all here (both in code comments and testcases). https://github.com/llvm/llvm-project/pull/131070 ___

[clang] [llvm] [DirectX] Implement Shader Flags Analysis for ResMayNotAlias (PR #131070)

2025-03-17 Thread Finn Plummer via cfe-commits
@@ -176,10 +198,16 @@ void ModuleShaderFlags::initialize(Module &M, DXILResourceTypeMap &DRTM, continue; } + // Set ResMayNotAlias to true if DXIL version < 1.8 and there are UAVs + // present globally. + if (CanSetResMayNotAlias && MMDI.DXILVersi

[clang] [llvm] [DirectX] Implement Shader Flags Analysis for ResMayNotAlias (PR #131070)

2025-03-17 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,39 @@ +; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s + +target triple = "dxil-pc-shadermodel6.8-library" + +; CHECK: Combined Shader Flags for Module +; CHECK-NEXT: Shader Flags Value: 0x20010 inbelic wrote: It seems th

[clang] [llvm] [DirectX] Implement Shader Flags Analysis for ResMayNotAlias (PR #131070)

2025-03-17 Thread Finn Plummer via cfe-commits
inbelic wrote: Are we able to add the `-res-may-alias` flag here so that we keep our testcase isolated on the current flag being tested? Or add the module flag I suppose https://github.com/llvm/llvm-project/pull/131070 _

[clang] [llvm] [DirectX] Implement Shader Flags Analysis for ResMayNotAlias (PR #131070)

2025-03-17 Thread Finn Plummer via cfe-commits
inbelic wrote: Can we add a comment in these test files to describe what they are distinctly testing? It is not immediately clear to me https://github.com/llvm/llvm-project/pull/131070 ___ cfe-commits mailing list cf

[clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-03-07 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/122982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-03-05 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/122982 >From 9fe6b897b161f7e40e4a5662ab2cad4dceed174e Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Thu, 13 Feb 2025 22:56:52 + Subject: [PATCH 01/15] [HLSL][RootSignature] Parse empty Descriptor Table Root El

[clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-03-05 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,417 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +#include "clang/Lex/LiteralSupport.h" + +#include "llvm/Support/raw_ostream.h" + +using namespace llvm::hlsl::rootsig; + +namespace clang { +namespace hlsl { + +static std::string FormatTokenKinds(ArrayRef Kinds

[clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-02-14 Thread Finn Plummer via cfe-commits
@@ -162,5 +219,371 @@ std::optional RootSignatureLexer::PeekNextToken() { return Result; } +// Parser Definitions + +RootSignatureParser::RootSignatureParser(SmallVector &Elements, + RootSignatureLexer &Lexer, +

[clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-02-14 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,417 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +#include "clang/Lex/LiteralSupport.h" + +#include "llvm/Support/raw_ostream.h" + +using namespace llvm::hlsl::rootsig; + +namespace clang { +namespace hlsl { + +static std::string FormatTokenKinds(ArrayRef Kinds

[clang] [llvm] [HLSL] [DXIL] Implement the AddUint64 HLSL function and the UAddc DXIL op (PR #127137)

2025-02-14 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/127137 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] [DXIL] Implement the AddUint64 HLSL function and the UAddc DXIL op (PR #127137)

2025-02-14 Thread Finn Plummer via cfe-commits
@@ -19445,6 +19445,70 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, return nullptr; switch (BuiltinID) { + case Builtin::BI__builtin_hlsl_adduint64: { +Value *OpA = EmitScalarExpr(E->getArg(0)); inbelic wrote: Forwarding: htt

[clang] [llvm] [HLSL] [DXIL] Implement the AddUint64 HLSL function and the UAddc DXIL op (PR #127137)

2025-02-14 Thread Finn Plummer via cfe-commits
https://github.com/inbelic commented: Just copying over some comments from the previous p, that might not be completely resolved for new reviewers to consider. https://github.com/llvm/llvm-project/pull/127137 ___ cfe-commits mailing list cfe-commits@l

[clang] [llvm] [HLSL] [DXIL] Implement the AddUint64 HLSL function and the UAddc DXIL op (PR #127137)

2025-02-14 Thread Finn Plummer via cfe-commits
@@ -50,6 +50,7 @@ def HandleTy : DXILOpParamType; def ResBindTy : DXILOpParamType; def ResPropsTy : DXILOpParamType; def SplitDoubleTy : DXILOpParamType; +def BinaryWithCarryTy : DXILOpParamType; inbelic wrote: There is an issue to track doing it a more generi

[clang] [llvm] [HLSL] [DXIL] Implement the AddUint64 HLSL function and the UAddc DXIL op (PR #127137)

2025-02-14 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/127137 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   >