diff options
author | Joao Saffran <joaosaffranllvm@gmail.com> | 2025-08-21 13:37:13 -0700 |
---|---|---|
committer | Joao Saffran <joaosaffranllvm@gmail.com> | 2025-08-21 13:37:13 -0700 |
commit | 11b9fb21bfaeb0342f30e0129e875678176ddb88 (patch) | |
tree | 29d56d481d0957ef8f1f03a79b84e1414bf50330 | |
parent | 15b75920623dd7f3031654dbbd367e23dcd8168f (diff) | |
download | llvm-users/joaosaffran/146785.zip llvm-users/joaosaffran/146785.tar.gz llvm-users/joaosaffran/146785.tar.bz2 |
updating error messages and testsusers/joaosaffran/146785
6 files changed, 11 insertions, 9 deletions
diff --git a/llvm/lib/Frontend/HLSL/HLSLBinding.cpp b/llvm/lib/Frontend/HLSL/HLSLBinding.cpp index 9cb1cce..bb62ad8 100644 --- a/llvm/lib/Frontend/HLSL/HLSLBinding.cpp +++ b/llvm/lib/Frontend/HLSL/HLSLBinding.cpp @@ -36,8 +36,11 @@ BindingInfo::BindingSpaces::getOrInsertSpace(uint32_t Space) { std::optional<const BindingInfo::RegisterSpace *> BindingInfo::BindingSpaces::contains(uint32_t Space) const { - const BindingInfo::RegisterSpace *It = - std::find(Spaces.begin(), Spaces.end(), Space); + const BindingInfo::RegisterSpace *It = Spaces.begin(); + for (auto *End = Spaces.end(); It != End; ++It) { + if (It->Space == Space) + break; + } if (It == Spaces.end()) return std::nullopt; return It; diff --git a/llvm/lib/Target/DirectX/DXILPostOptimizationValidation.cpp b/llvm/lib/Target/DirectX/DXILPostOptimizationValidation.cpp index e3ece35..b001c71 100644 --- a/llvm/lib/Target/DirectX/DXILPostOptimizationValidation.cpp +++ b/llvm/lib/Target/DirectX/DXILPostOptimizationValidation.cpp @@ -138,9 +138,8 @@ reportRegNotBound(Module &M, ResourceClass Class, const llvm::dxil::ResourceInfo::ResourceBinding &Unbound) { SmallString<128> Message; raw_svector_ostream OS(Message); - OS << "register " << getResourceClassName(Class) - << " (space=" << Unbound.Space << ", register=" << Unbound.LowerBound - << ")" + OS << getResourceClassName(Class) << " register " << Unbound.LowerBound + << " in space " << Unbound.Space << " does not have a binding in the Root Signature"; M.getContext().diagnose(DiagnosticInfoGeneric(Message)); } diff --git a/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-cbv-binding.ll b/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-cbv-binding.ll index 07dbeb9..a469c16 100644 --- a/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-cbv-binding.ll +++ b/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-cbv-binding.ll @@ -1,5 +1,5 @@ ; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 | FileCheck %s -; CHECK: error: register CBV (space=666, register=2) does not have a binding in the Root Signature +; CHECK: error: CBV register 2 in space 666 does not have a binding in the Root Signature %__cblayout_CB = type <{ float }> diff --git a/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-sampler-binding.ll b/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-sampler-binding.ll index 4dc2144..3e1d7f4 100644 --- a/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-sampler-binding.ll +++ b/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-sampler-binding.ll @@ -1,5 +1,5 @@ ; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 | FileCheck %s -; CHECK: error: register Sampler (space=2, register=3) does not have a binding in the Root Signature +; CHECK: error: Sampler register 3 in space 2 does not have a binding in the Root Signature @Smp.str = private unnamed_addr constant [4 x i8] c"Smp\00", align 1 diff --git a/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-srv-binding.ll b/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-srv-binding.ll index c851550..e027d3c 100644 --- a/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-srv-binding.ll +++ b/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-srv-binding.ll @@ -1,5 +1,5 @@ ; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 | FileCheck %s -; CHECK: error: register SRV (space=0, register=0) does not have a binding in the Root Signature +; CHECK: error: SRV register 0 in space 0 does not have a binding in the Root Signature @SB.str = private unnamed_addr constant [3 x i8] c"SB\00", align 1 diff --git a/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-uav-binding.ll b/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-uav-binding.ll index 5239993..5e30b1f4 100644 --- a/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-uav-binding.ll +++ b/llvm/test/CodeGen/DirectX/rootsignature-validation-fail-uav-binding.ll @@ -1,5 +1,5 @@ ; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 | FileCheck %s -; CHECK: error: register UAV (space=0, register=4294967294) does not have a binding in the Root Signature +; CHECK: error: UAV register 4294967294 in space 0 does not have a binding in the Root Signature @RWB.str = private unnamed_addr constant [4 x i8] c"RWB\00", align 1 |