[llvm-branch-commits] [clang] [llvm] [DirectX] Add Range Overlap validation to `DXILPostOptimizationValidation.cpp` (PR #148919)
Joshua Batista via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Jul 24 11:40:34 PDT 2025
================
@@ -0,0 +1,15 @@
+; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 | FileCheck %s
+; CHECK: error: register CBuffer (space=0, register=0) is overlapping with register CBuffer (space=0, register=2), verify your root signature definition
+
+define void @CSMain() "hlsl.shader"="compute" {
+entry:
+ ret void
+}
+
+; RootConstants(num32BitConstants=4, b2), DescriptorTable(CBV(b0, numDescriptors=3))
----------------
bob80905 wrote:
I want to better understand how these tests cover each of the switch cases. It looks like this one covers the `Constants32Bit` case, and that `llvm/test/CodeGen/DirectX/rootsignature-validation-fail-sampler-range.ll` covers the static sampler case.
But for `llvm/test/CodeGen/DirectX/rootsignature-validation-fail-overlap-range.ll`, I am not sure. Does it cover the
```
llvm::to_underlying(dxbc::RootParameterType::SRV):
case llvm::to_underlying(dxbc::RootParameterType::UAV):
case llvm::to_underlying(dxbc::RootParameterType::CBV):
```
case?
Or does it cover the `DescriptorTable` case? If one or the other, can a test be made to cover the missing case?
https://github.com/llvm/llvm-project/pull/148919
More information about the llvm-branch-commits
mailing list