[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Retain `SourceLocation` of `RootElement` for `SemaHLSL` diagnostics (PR #147115)

2025-07-09 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/147115 >From bef7466d6110c682ee5887b7fc98c980f7a1ec94 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Fri, 27 Jun 2025 18:36:38 + Subject: [PATCH 01/15] nfc: introduce wrapper `RootSignatureElement` around `Root

[llvm-branch-commits] [clang] [llvm] [DirectX] Validate registers are bound to root signature (PR #146785)

2025-07-09 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: This should be in the include directory https://github.com/llvm/llvm-project/pull/146785 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[llvm-branch-commits] [clang] [llvm] [DirectX] Validate registers are bound to root signature (PR #146785)

2025-07-09 Thread Finn Plummer via llvm-branch-commits
@@ -0,0 +1,160 @@ +; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 + +; CHECK: error: register cbuffer (space=665, register=3) is not defined in Root Signature +; CHECK: error: register srv (space=0, register=0) is n

[llvm-branch-commits] [clang] [llvm] [DirectX] Validate registers are bound to root signature (PR #146785)

2025-07-09 Thread Finn Plummer via llvm-branch-commits
@@ -14,10 +14,129 @@ #ifndef LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H #define LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H +#include "DXILRootSignature.h" +#include "llvm/ADT/IntervalMap.h" +#include "llvm/Analysis/DXILResource.h" #include "llvm/IR

[llvm-branch-commits] [clang] [HLSL][RootSignature] Audit `RootSignatureParser` diagnostic production (PR #147800)

2025-07-09 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/147800 >From 95166f5e2bfb2816ce39d3abd1823486742109bd Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 9 Jul 2025 15:50:55 + Subject: [PATCH 01/11] remove confusing hlsl_unexpected_end_of_params diagnostic

[llvm-branch-commits] [clang] [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (PR #147832)

2025-07-09 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/147832 >From 7ec7e32d2ac4945a489d5463b9fb700b0cceff9d Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 9 Jul 2025 21:21:53 + Subject: [PATCH] [HLSL][RootSignature] Implement multiple diagnostics in `RootSign

[llvm-branch-commits] [clang] [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (PR #147832)

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

[llvm-branch-commits] [clang] [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (PR #147832)

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

[llvm-branch-commits] [clang] [llvm] [DirectX] Validate registers are bound to root signature (PR #146785)

2025-07-10 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: Ah okay, didn't realize it follows a different structure here. Thanks for checking https://github.com/llvm/llvm-project/pull/146785 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.o

[llvm-branch-commits] [clang] [llvm] [DirectX] Validate registers are bound to root signature (PR #146785)

2025-07-10 Thread Finn Plummer via llvm-branch-commits
@@ -94,14 +147,83 @@ static void reportErrors(Module &M, DXILResourceMap &DRM, assert(!DRBI.hasImplicitBinding() && "implicit bindings should be handled in " "DXILResourceImplicitBinding pass"); + + if (auto RSD = getRootSignature(RSB

[llvm-branch-commits] [clang] [llvm] [DirectX] Validate registers are bound to root signature (PR #146785)

2025-07-10 Thread Finn Plummer via llvm-branch-commits
@@ -14,10 +14,129 @@ #ifndef LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H #define LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H +#include "DXILRootSignature.h" +#include "llvm/ADT/IntervalMap.h" +#include "llvm/Analysis/DXILResource.h" #include "llvm/IR

[llvm-branch-commits] [clang] [llvm] [DirectX] Validate registers are bound to root signature (PR #146785)

2025-07-10 Thread Finn Plummer via llvm-branch-commits
@@ -14,10 +14,129 @@ #ifndef LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H #define LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H +#include "DXILRootSignature.h" +#include "llvm/ADT/IntervalMap.h" +#include "llvm/Analysis/DXILResource.h" #include "llvm/IR

[llvm-branch-commits] [clang] [llvm] [DirectX] Validate registers are bound to root signature (PR #146785)

2025-07-10 Thread Finn Plummer via llvm-branch-commits
@@ -0,0 +1,160 @@ +; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 + +; CHECK: error: register cbuffer (space=665, register=3) is not defined in Root Signature +; CHECK: error: register srv (space=0, register=0) is n

[llvm-branch-commits] [clang] [llvm] [DirectX] Validate registers are bound to root signature (PR #146785)

2025-07-10 Thread Finn Plummer via llvm-branch-commits
@@ -14,10 +14,129 @@ #ifndef LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H #define LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H +#include "DXILRootSignature.h" +#include "llvm/ADT/IntervalMap.h" +#include "llvm/Analysis/DXILResource.h" #include "llvm/IR

[llvm-branch-commits] [clang] [llvm] [DirectX] Validate registers are bound to root signature (PR #146785)

2025-07-10 Thread Finn Plummer via llvm-branch-commits
@@ -0,0 +1,160 @@ +; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 + +; CHECK: error: register cbuffer (space=665, register=3) is not defined in Root Signature +; CHECK: error: register srv (space=0, register=0) is n

[llvm-branch-commits] [clang] [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (PR #147832)

2025-07-11 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/147832 >From 7ec7e32d2ac4945a489d5463b9fb700b0cceff9d Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 9 Jul 2025 21:21:53 + Subject: [PATCH 1/3] [HLSL][RootSignature] Implement multiple diagnostics in `Root

[llvm-branch-commits] [clang] [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (PR #147832)

2025-07-11 Thread Finn Plummer via llvm-branch-commits
@@ -27,51 +36,68 @@ RootSignatureParser::RootSignatureParser( bool RootSignatureParser::parse() { // Iterate as many RootSignatureElements as possible, until we hit the // end of the stream + bool HadError = false; while (!peekExpectedToken(TokenKind::end_of_stream)) {

[llvm-branch-commits] [clang] [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (PR #147832)

2025-07-11 Thread Finn Plummer via llvm-branch-commits
@@ -27,51 +36,68 @@ RootSignatureParser::RootSignatureParser( bool RootSignatureParser::parse() { // Iterate as many RootSignatureElements as possible, until we hit the // end of the stream + bool HadError = false; while (!peekExpectedToken(TokenKind::end_of_stream)) {

[llvm-branch-commits] [clang] [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (PR #147832)

2025-07-11 Thread Finn Plummer via llvm-branch-commits
@@ -27,51 +36,68 @@ RootSignatureParser::RootSignatureParser( bool RootSignatureParser::parse() { // Iterate as many RootSignatureElements as possible, until we hit the // end of the stream + bool HadError = false; while (!peekExpectedToken(TokenKind::end_of_stream)) {

[llvm-branch-commits] [clang] [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (PR #147832)

2025-07-11 Thread Finn Plummer via llvm-branch-commits
@@ -27,51 +36,68 @@ RootSignatureParser::RootSignatureParser( bool RootSignatureParser::parse() { // Iterate as many RootSignatureElements as possible, until we hit the // end of the stream + bool HadError = false; inbelic wrote: The pattern that I have s

[llvm-branch-commits] [clang] [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (PR #147832)

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

[llvm-branch-commits] [clang] [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (PR #147832)

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

[llvm-branch-commits] [llvm] [DirectX] Error handling improve in root signature metadata Parser (PR #149232)

2025-07-17 Thread Finn Plummer via llvm-branch-commits
@@ -111,14 +110,25 @@ analyzeModule(Module &M) { reportError(Ctx, "Root Element is not a metadata node."); continue; } -mcdxbc::RootSignatureDesc RSD; -if (std::optional Version = extractMdIntValue(RSDefNode, 2)) - RSD.Version = *Version; +uint3

[llvm-branch-commits] [llvm] [DirectX] Error handling improve in root signature metadata Parser (PR #149232)

2025-07-17 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: The changes to all the test files here seem strange https://github.com/llvm/llvm-project/pull/149232 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[llvm-branch-commits] [llvm] [DirectX] Error handling improve in root signature metadata Parser (PR #149232)

2025-07-17 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: Does `joinErrors` allow for automatic reporting of multiple errors? If so can we add a test to demonstrate? https://github.com/llvm/llvm-project/pull/149232 ___ llvm-branch-commits mailing list llvm-br

[llvm-branch-commits] [llvm] [DirectX] Error handling improve in root signature metadata Parser (PR #149232)

2025-07-17 Thread Finn Plummer via llvm-branch-commits
@@ -111,14 +110,25 @@ analyzeModule(Module &M) { reportError(Ctx, "Root Element is not a metadata node."); continue; } -mcdxbc::RootSignatureDesc RSD; -if (std::optional Version = extractMdIntValue(RSDefNode, 2)) - RSD.Version = *Version; +uint3

[llvm-branch-commits] [clang] [llvm] [DirectX] Validate if Textures/TypedBuffers are being bound in Root Signatures (PR #147573)

2025-07-17 Thread Finn Plummer via llvm-branch-commits
@@ -249,6 +260,20 @@ getRootSignature(RootSignatureBindingInfo &RSBI, return RootSigDesc; } +static void reportInvalidHandleTy( +Module &M, +const iterator_range::iterator> +&Resources) { + for (auto Res = Resources.begin(), End = Resources.end(); Res != End

[llvm-branch-commits] [clang] [llvm] [DirectX] Validate if Textures/TypedBuffers are being bound in Root Signatures (PR #147573)

2025-07-17 Thread Finn Plummer via llvm-branch-commits
@@ -249,6 +260,20 @@ getRootSignature(RootSignatureBindingInfo &RSBI, return RootSigDesc; } +static void reportInvalidHandleTy( +Module &M, +const iterator_range::iterator> inbelic wrote: nit: ```suggestion dxil::ResourceInfo::iterator_range ```

[llvm-branch-commits] [clang] [llvm] [DirectX] Validate if Textures/TypedBuffers are being bound in Root Signatures (PR #147573)

2025-07-17 Thread Finn Plummer via llvm-branch-commits
@@ -21,7 +21,7 @@ entry: %CB = tail call target("dx.CBuffer", target("dx.Layout", %__cblayout_CB, 4, 0)) @llvm.dx.resource.handlefrombinding(i32 1, i32 3, i32 1, i32 0, i1 false, ptr nonnull @CB.str) %Sampler = call target("dx.Sampler", 0) @llvm.dx.resource.handlefrombind

[llvm-branch-commits] [clang] [llvm] [DirectX] Add Range Overlap validation to `DXILPostOptimizationValidation.cpp` (PR #148919)

2025-07-17 Thread Finn Plummer via llvm-branch-commits
@@ -312,21 +399,22 @@ static void reportErrors(Module &M, DXILResourceMap &DRM, "DXILResourceImplicitBinding pass"); if (auto RSD = getRootSignature(RSBI, MMI)) { - -llvm::hlsl::rootsig::RootSignatureBindingValidation Validation = -

[llvm-branch-commits] [clang] [llvm] [DirectX] Add Range Overlap validation to `DXILPostOptimizationValidation.cpp` (PR #148919)

2025-07-17 Thread Finn Plummer via llvm-branch-commits
@@ -260,6 +260,93 @@ getRootSignature(RootSignatureBindingInfo &RSBI, return RootSigDesc; } +static void +reportOverlappingRegisters(Module &M, + llvm::hlsl::rootsig::OverlappingRanges Overlap) { + const llvm::hlsl::rootsig::RangeInfo *Info = Overl

[llvm-branch-commits] [clang] [llvm] [DirectX] Add Range Overlap validation to `DXILPostOptimizationValidation.cpp` (PR #148919)

2025-07-17 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: Can we add a test for when there are multiple overlaps. Just to make sure multiple diagnostics are being generated. https://github.com/llvm/llvm-project/pull/148919 ___ llvm-branch-commits mailing list

<    1   2   3