[clang] [HLSL] Add 6.2 SM on half availability for length intrinsic (PR #122337)

2025-01-09 Thread Finn Plummer via cfe-commits
@@ -1297,9 +1297,11 @@ float4 lerp(float4, float4, float4); /// /// Length is based on the following formula: sqrt(x[0]^2 + x[1]^2 + ...). +_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) const inline half length(half X) { return __detail::length_impl(X); } const inline float len

[clang] [HLSL] Add 6.2 SM on half availability for length intrinsic (PR #122337)

2025-01-09 Thread Finn Plummer via cfe-commits
https://github.com/inbelic approved this pull request. LGTM, assuming we don't need the other availability denoted https://github.com/llvm/llvm-project/pull/122337 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

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

2025-01-14 Thread Finn Plummer via cfe-commits
https://github.com/inbelic ready_for_review 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-01-14 Thread Finn Plummer via cfe-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/122982 - Defines the in-memory data layout for the Descriptor Table Clauses, its dependent flags/enums and parent RootElement in HLSLRootSignature.h - Implements a Parser and its required Parsing methods in ParseHLSLRo

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-01-14 Thread Finn Plummer via cfe-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/122981 - Define required tokens to parse a Descriptor Table in TokenKinds.def - Implements a Lexer to handle all of the defined tokens in ParseHLSLRootSignature This is an initial part of #120472 >From c1fc823abf07df

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

2025-01-14 Thread Finn Plummer via cfe-commits
inbelic wrote: Please ignore the first commit. It is a duplicate of https://github.com/llvm/llvm-project/pull/122981 https://github.com/llvm/llvm-project/pull/122982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-01-14 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,151 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +namespace llvm { +namespace hlsl { +namespace root_signature { + +// Lexer Definitions + +static bool IsPreprocessorNumberChar(char C) { + // TODO: extend for float support with or without hexadecimal/exponent

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-01-14 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/122981 >From c1fc823abf07dfb8326b6190672d9881890bbb15 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Tue, 14 Jan 2025 22:22:45 + Subject: [PATCH 1/2] [HLSL][RootSignature] Implement Lexing of DescriptorTables

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-01-14 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,96 @@ +//===--- 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: Apa

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-01-14 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,152 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +namespace llvm { +namespace hlsl { +namespace root_signature { + +// Lexer Definitions + +static bool IsPreprocessorNumberChar(char C) { + // TODO: extend for float support with or without hexadecimal/exponent

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

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

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-01-15 Thread Finn Plummer via cfe-commits
inbelic wrote: I have left the error reporting as a todo just to help with pr size, as it will require adding a good chunk of additional testing https://github.com/llvm/llvm-project/pull/122981 ___ cfe-commits mailin

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

2025-01-15 Thread Finn Plummer via cfe-commits
@@ -89,6 +91,72 @@ class RootSignatureLexer { } }; +class RootSignatureParser { +public: + RootSignatureParser(SmallVector &Elements, + const SmallVector &Tokens); + + // Iterates over the provided tokens and constructs the in-memory + // representati

[clang] [llvm] [HLSL] Implement the `reflect` HLSL function (PR #122992)

2025-01-15 Thread Finn Plummer via cfe-commits
@@ -51,6 +51,38 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned BuiltinID, TheCall->setType(RetTy); break; } + case SPIRV::BI__builtin_spirv_reflect: { +if (SemaRef.checkArgCount(TheCall, 2)) + return true; + +ExprResult A = TheCall->getArg(0)

[clang] [llvm] [HLSL] Implement the `reflect` HLSL function (PR #122992)

2025-01-15 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,33 @@ +; RUN: llc -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s inbelic wrote: Out of curiousity, what happens when we use the triple `-mtriple=spirv32-unknown-unknown`? This should change the environment to be `OpenCL`, will it fail beca

[clang] [llvm] [HLSL] Implement the `reflect` HLSL function (PR #122992)

2025-01-15 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify + +float test_no_second_arg(float2 p0) { + return reflect(p0); + // expected-error@-1 {{no matching function

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-01-15 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,121 @@ +//===--- HLSLRootSignature.def - Tokens and Enum Database ---*- 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:

[clang] [llvm] [HLSL] Implement the `reflect` HLSL function (PR #122992)

2025-01-15 Thread Finn Plummer via cfe-commits
@@ -51,6 +51,38 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned BuiltinID, TheCall->setType(RetTy); break; } + case SPIRV::BI__builtin_spirv_reflect: { +if (SemaRef.checkArgCount(TheCall, 2)) + return true; + +ExprResult A = TheCall->getArg(0)

[clang] [llvm] [HLSL] Implement the `reflect` HLSL function (PR #122992)

2025-01-15 Thread Finn Plummer via cfe-commits
@@ -51,6 +51,38 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned BuiltinID, TheCall->setType(RetTy); break; } + case SPIRV::BI__builtin_spirv_reflect: { +if (SemaRef.checkArgCount(TheCall, 2)) + return true; + +ExprResult A = TheCall->getArg(0)

[clang] [HLSL][Sema] Fixed Diagnostics that assumed only two arguments (PR #122772)

2025-01-16 Thread Finn Plummer via cfe-commits
@@ -1688,13 +1688,21 @@ static bool CheckVectorElementCallArgs(Sema *S, CallExpr *TheCall) { auto *VecTyA = ArgTyA->getAs(); SourceLocation BuiltinLoc = TheCall->getBeginLoc(); + bool AllBArgAreVectors = true; for (unsigned i = 1; i < TheCall->getNumArgs(); ++i) {

[clang] [HLSL][Sema] Fixed Diagnostics that assumed only two arguments (PR #122772)

2025-01-16 Thread Finn Plummer via cfe-commits
https://github.com/inbelic approved this pull request. https://github.com/llvm/llvm-project/pull/122772 ___ 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-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
@@ -306,4 +307,254 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexRegNumberTest) { ASSERT_FALSE(Consumer->IsSatisfied()); } +// Valid Parser Tests + +TEST_F(ParseHLSLRootSignatureTest, ValidParseEmptyTest) { + const llvm::StringLiteral Source = R"cc()cc"; + + TrivialModu

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

2025-02-14 Thread Finn Plummer via cfe-commits
@@ -93,6 +96,108 @@ class RootSignatureLexer { } }; +class RootSignatureParser { +public: + RootSignatureParser(SmallVector &Elements, + RootSignatureLexer &Lexer, DiagnosticsEngine &Diags); + + /// Iterates over the provided tokens and constructs the

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

2025-02-14 Thread Finn Plummer via cfe-commits
inbelic wrote: Rebasing onto the lexer changes that have been added to main. Since there were some disruptive review changes in the lexer (removing parsing of integers, removing any error handling and moving the lexer to the Lex subdir) that we are rebasing on, it was quite difficult to apply

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

2025-02-14 Thread Finn Plummer via cfe-commits
inbelic wrote: Also I am also unsure why it triggered a review from all the code owners. Is it because I force-pushed before changing the target branch? https://github.com/llvm/llvm-project/pull/122982 ___ cfe-commits mailing list cfe-commits@lists.ll

[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
@@ -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 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
@@ -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
@@ -50,6 +50,7 @@ def HandleTy : DXILOpParamType; def ResBindTy : DXILOpParamType; def ResPropsTy : DXILOpParamType; def SplitDoubleTy : DXILOpParamType; +def BinaryWithCarryTy : DXILOpParamType; inbelic wrote: Forwarding: https://github.com/llvm/llvm-project

[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][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][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-02-14 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-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] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-02-11 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/122981 >From 98deff6a407b912852e70b2bdc3618aaec8a1931 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Fri, 24 Jan 2025 22:23:39 + Subject: [PATCH 01/16] [HLSL][RootSignature] Initial Lexer Definition with puncua

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-02-13 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,89 @@ +//===--- 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: Apa

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-02-13 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/122981 >From 98deff6a407b912852e70b2bdc3618aaec8a1931 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Fri, 24 Jan 2025 22:23:39 + Subject: [PATCH 01/18] [HLSL][RootSignature] Initial Lexer Definition with puncua

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-02-12 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,194 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +namespace clang { +namespace hlsl { + +// Lexer Definitions + +static bool IsNumberChar(char C) { + // TODO(#126565): extend for float support exponents + return isdigit(C); // integer support +} + +bool RootS

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

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

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-02-12 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/122981 >From 98deff6a407b912852e70b2bdc3618aaec8a1931 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Fri, 24 Jan 2025 22:23:39 + Subject: [PATCH 01/17] [HLSL][RootSignature] Initial Lexer Definition with puncua

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-02-12 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,166 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +namespace clang { +namespace hlsl { + +// Lexer Definitions + +static bool IsNumberChar(char C) { + // TODO(#126565): extend for float support exponents + return isdigit(C); // integer support +} + +bool RootS

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-02-14 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/122981 ___ 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-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] [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] [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
@@ -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
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
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
@@ -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-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] [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] [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] 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] [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] [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] 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] [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] [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] [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] [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
@@ -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] [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
@@ -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-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] 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] 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] 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-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] 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] [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
@@ -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] [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] [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] [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
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 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] [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

<    1   2   3   4