13#ifndef LLVM_FRONTEND_HLSL_HLSLBINDING_H
14#define LLVM_FRONTEND_HLSL_HLSLBINDING_H
119 std::tie(
RHS.RC,
RHS.Space,
RHS.LowerBound,
RHS.UpperBound,
126 std::tie(
RHS.RC,
RHS.Space,
RHS.LowerBound);
142 if (It == Bindings.
begin())
157 uint32_t UpperBound,
const void *Cookie) {
158 Bindings.
emplace_back(RC, Space, LowerBound, UpperBound, Cookie);
172 [&HasOverlap](
auto,
auto) { HasOverlap =
true; });
177 "takeBoundRegs should only be called after calculateBindingInfo");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the SmallVector class.
reference emplace_back(ArgTypes &&... Args)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
An efficient, type-erasing, non-owning reference to a callable.
Builder class for creating a /c BindingInfo.
LLVM_ABI const Binding & findOverlapping(const Binding &ReportedBinding) const
For use in the ReportOverlap callback of calculateBindingInfo - finds a binding that the ReportedBind...
void trackBinding(dxil::ResourceClass RC, uint32_t Space, uint32_t LowerBound, uint32_t UpperBound, const void *Cookie)
LLVM_ABI BindingInfo calculateBindingInfo(llvm::function_ref< void(const BindingInfoBuilder &Builder, const Binding &Overlapping)> ReportOverlap)
Calculate the binding info - ReportOverlap will be called once for each overlapping binding.
LLVM_ABI BoundRegs takeBoundRegs()
BindingInfo calculateBindingInfo(bool &HasOverlap)
Calculate the binding info - HasOverlap will be set to indicate whether there are any overlapping bin...
BindingInfo represents the ranges of bindings and free space for each dxil::ResourceClass.
const BindingSpaces & getBindingSpaces(dxil::ResourceClass RC) const
LLVM_ABI std::optional< uint32_t > findAvailableBinding(dxil::ResourceClass RC, uint32_t Space, int32_t Size)
BindingSpaces & getBindingSpaces(dxil::ResourceClass RC)
bool isBound(dxil::ResourceClass RC, uint32_t Space, uint32_t LowerBound, uint32_t UpperBound) const
BoundRegs(SmallVector< Binding > &&Bindings)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
auto upper_bound(R &&Range, T &&Value)
Provide wrappers to std::upper_bound which take ranges instead of having to pass begin/end explicitly...
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
BindingRange(uint32_t LB, uint32_t UB)
LLVM_ABI RegisterSpace & getOrInsertSpace(uint32_t Space)
llvm::SmallVector< RegisterSpace > Spaces
BindingSpaces(dxil::ResourceClass RC)
SmallVector< BindingRange > FreeRanges
LLVM_ABI std::optional< uint32_t > findAvailableBinding(int32_t Size)
RegisterSpace(uint32_t Space)
bool operator==(const Binding &RHS) const
bool operator<(const Binding &RHS) const
Binding(dxil::ResourceClass RC, uint32_t Space, uint32_t LowerBound, uint32_t UpperBound, const void *Cookie)
bool operator!=(const Binding &RHS) const