[all-commits] [llvm/llvm-project] 9e0186: [HLSL][RootSignature] Implement `ResourceRange` as...
Finn Plummer via All-commits
all-commits at lists.llvm.org
Tue Jun 17 10:25:19 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 9e0186d925f0c375a627866c59394f25c22eb3ff
https://github.com/llvm/llvm-project/commit/9e0186d925f0c375a627866c59394f25c22eb3ff
Author: Finn Plummer <finn.c.plum at gmail.com>
Date: 2025-06-17 (Tue, 17 Jun 2025)
Changed paths:
M llvm/include/llvm/Frontend/HLSL/HLSLRootSignature.h
M llvm/include/llvm/Frontend/HLSL/HLSLRootSignatureUtils.h
M llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
M llvm/unittests/Frontend/CMakeLists.txt
A llvm/unittests/Frontend/HLSLRootSignatureRangesTest.cpp
Log Message:
-----------
[HLSL][RootSignature] Implement `ResourceRange` as an `IntervalMap` (#140957)
A resource range consists of a closed interval, `[a;b]`, denoting which
shader registers it is bound to.
For instance:
- `CBV(b1)` corresponds to the resource range of `[1;1]`
- `CBV(b0, numDescriptors = 3)` likewise to `[0;2]`
We want to provide an error diagnostic when there is an overlap in the
required registers (an overlap in the resource ranges).
The goal of this pr is to implement a structure to model a set of
resource ranges and provide an api to detect any overlap over a set of
resource ranges.
`ResourceRange` models this by implementing an `IntervalMap` to denote a
mapping from an interval of registers back to a resource range. It
allows for a new `ResourceRange` to be added to the mapping and it will
report if and what the first overlap is.
For the context of how this will be used in validation of a
`RootSignatureDecl` please see the proceeding pull request here:
https://github.com/llvm/llvm-project/pull/140962.
- Implements `ResourceRange` as an `IntervalMap`
- Adds unit testing of the various `insert` scenarios
Note: it was also considered to implement this as an `IntervalTree`,
this would allow reporting of a diagnostic for each overlap that is
encountered, as opposed to just the first. However, error generation of
just reporting the first error is already rather verbose, and adding the
additional diagnostics only made this worse.
Part 1 of https://github.com/llvm/llvm-project/issues/129942
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list