66#ifndef LLVM_SUPPORT_JOBSERVER_H
67#define LLVM_SUPPORT_JOBSERVER_H
82 Other.Value = kInvalidValue;
86 this->Value =
Other.Value;
87 Other.Value = kInvalidValue;
97 bool isValid()
const {
return Value >= 0; }
103 return JobSlot(
static_cast<int16_t
>(V));
115 JobSlot(int16_t V) : Value(V) {}
126 static constexpr int16_t kInvalidValue = -1;
127 static constexpr int16_t kImplicitValue = INT16_MAX;
128 int16_t
Value = kInvalidValue;
#define LLVM_ABI_FOR_TEST
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 LLVM_ABI_FOR_TEST JobserverClient * getInstance()
Returns the singleton instance of the JobserverClient.
static LLVM_ABI_FOR_TEST 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