16#ifndef LLVM_LIB_CODEGEN_ALLOCATIONORDER_H
17#define LLVM_LIB_CODEGEN_ALLOCATIONORDER_H
26class RegisterClassInfo;
40 const int IterationLimit;
52 bool isHint()
const {
return Pos < 0; }
57 return AO.Hints.end()[Pos];
58 assert(Pos < AO.IterationLimit);
65 if (Pos < AO.IterationLimit)
67 while (Pos >= 0 && Pos < AO.IterationLimit && AO.isHint(AO.Order[Pos]))
74 return Pos ==
Other.Pos;
92 : Hints(
std::
move(Hints)), Order(Order),
93 IterationLimit(HardHints ? 0 : static_cast<int>(Order.
size())) {}
96 return Iterator(*
this, -(
static_cast<int>(Hints.size())));
106 std::min(
static_cast<int>(OrderLimit) - 1, IterationLimit));
117 static_cast<uint32_t>(std::numeric_limits<MCPhysReg>::max()));
#define LLVM_LIBRARY_VISIBILITY
std::optional< std::vector< StOtherPiece > > Other
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
Forward iterator for an AllocationOrder.
bool isHint() const
Return true if the curent position is that of a preferred register.
bool operator==(const Iterator &Other) const
Iterator(const AllocationOrder &AO, int Pos)
Iterator & operator++()
Advance the iterator to the next position.
bool operator!=(const Iterator &Other) const
MCRegister operator*() const
Return the next physical register in the allocation order.
bool isHint(Register Reg) const
Return true if Reg is a preferred physical register.
ArrayRef< MCPhysReg > getOrder() const
Get the allocation order without reordered hints.
Iterator getOrderLimitEnd(unsigned OrderLimit) const
AllocationOrder(SmallVector< MCPhysReg, 16 > &&Hints, ArrayRef< MCPhysReg > Order, bool HardHints)
Create an AllocationOrder given the Hits, Order, and HardHits values.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
Wrapper class representing physical registers. Should be passed by value.
Wrapper class representing virtual and physical registers.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This is an optimization pass for GlobalISel generic memory operations.
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
Implement std::hash so that hash_code can be used in STL containers.