15std::optional<uint32_t>
26 if (It->Space == Space)
28 if (It->Space < Space)
30 return *
Spaces.insert(It, Space);
32 return Spaces.emplace_back(Space);
35std::optional<uint32_t>
39 if (FreeRanges.empty())
45 if (
Last.UpperBound != ~0u)
49 FreeRanges.pop_back();
78 if (NewEnd != Bindings.end())
79 Bindings.erase(NewEnd, Bindings.end());
91 BS = &
Info.getBindingSpaces(
B.RC);
94 ? &BS->
Spaces.emplace_back(
B.Space)
96 assert(S->
Space <=
B.Space &&
"bindings not sorted correctly?");
99 S = &BS->
Spaces.emplace_back(
B.Space);
105 ReportOverlap(*
this,
B);
111 if (
B.UpperBound < ~0u)
115 }
else if (LastFreeRange.
LowerBound <
B.LowerBound) {
117 if (
B.UpperBound < ~0u)
122 ReportOverlap(*
this,
B);
123 if (
B.UpperBound < ~0u)
125 std::max(LastFreeRange.
LowerBound,
B.UpperBound + 1);
141 llvm_unreachable(
"Searching for overlap for binding that does not overlap");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Analysis containing CSE Info
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...
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.
BindingInfo represents the ranges of bindings and free space for each dxil::ResourceClass.
LLVM_ABI std::optional< uint32_t > findAvailableBinding(dxil::ResourceClass RC, uint32_t Space, int32_t Size)
BindingSpaces & getBindingSpaces(dxil::ResourceClass RC)
#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.
void stable_sort(R &&Range)
auto unique(Range &&R, Predicate P)
LLVM_ABI RegisterSpace & getOrInsertSpace(uint32_t Space)
llvm::SmallVector< RegisterSpace > Spaces
SmallVector< BindingRange > FreeRanges
LLVM_ABI std::optional< uint32_t > findAvailableBinding(int32_t Size)