66#ifndef LLVM_SUPPORT_JOBSERVER_H
67#define LLVM_SUPPORT_JOBSERVER_H
84 Other.Value = kInvalidValue;
88 this->Value =
Other.Value;
89 Other.Value = kInvalidValue;
99 bool isValid()
const {
return Value >= 0; }
105 return JobSlot(
static_cast<int16_t
>(V));
117 JobSlot(int16_t V) : Value(V) {}
128 static constexpr int16_t kInvalidValue = -1;
129 static constexpr int16_t kImplicitValue = INT16_MAX;
130 int16_t
Value = kInvalidValue;
A JobSlot represents a single job slot that can be acquired from or released to a jobserver pool.
static JobSlot createExplicit(uint8_t V)
JobSlot()=default
Default constructor creates an invalid instance.
JobSlot & operator=(const JobSlot &)=delete
uint8_t getExplicitValue() const
JobSlot(JobSlot &&Other) noexcept
bool isImplicit() const
Returns true if this instance represents the implicit job slot.
JobSlot & operator=(JobSlot &&Other) noexcept
bool isValid() const
Returns true if this instance is valid (either implicit or explicit).
friend class JobserverClient
friend class JobserverClientImpl
static JobSlot createImplicit()
JobSlot(const JobSlot &)=delete
The public interface for a jobserver client.
virtual JobSlot tryAcquire()=0
Tries to acquire a job slot from the pool.
virtual void release(JobSlot Slot)=0
Releases a job slot back to the pool.
static JobserverClient * getInstance()
Returns the singleton instance of the JobserverClient.
static void resetForTesting()
Resets the singleton instance. For testing purposes only.
virtual ~JobserverClient()
virtual unsigned getNumJobs() const =0
Returns the number of job slots available, as determined on first use.
LLVM Value Representation.
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr Value