9#ifndef LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUHWEVENTS_H
10#define LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUHWEVENTS_H
25#define AMDGPU_HW_EVENT(X) X,
26#define AMDGPU_FIRST_HW_EVENT(X) FIRST_WAIT_EVENT = X,
27#define AMDGPU_LAST_HW_EVENT(X) NUM_WAIT_EVENTS = X,
28#include "AMDGPUHWEvents.def"
41#define AMDGPU_HW_EVENT(EVENT) \
42 case HWEvent::EVENT: \
44#include "AMDGPUHWEvents.def"
56 return enum_seq(HWEvent::FIRST_WAIT_EVENT, MaxEvent);
65 static_assert(
static_cast<unsigned>(HWEvent::NUM_WAIT_EVENTS) <=
67 "Not enough bits in Mask for all the events");
68 Mask |= 1 <<
static_cast<unsigned>(Event);
70 constexpr HWEventSet(std::initializer_list<HWEvent> Events) {
71 for (
auto &
E : Events) {
72 Mask |= 1 <<
static_cast<unsigned>(
E);
76 Mask |= 1 <<
static_cast<unsigned>(Event);
79 Mask &= ~(1 <<
static_cast<unsigned>(Event));
83 return Mask & (1 <<
static_cast<unsigned>(Event));
87 return (~Mask &
Other.Mask) == 0;
92 Copy.Mask &=
Other.Mask;
98 Copy.Mask |=
Other.Mask;
113 bool empty()
const {
return Mask == 0; }
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
AMDGPU::HWEventSet HWEventSet
Provides some synthesis utilities to produce sequences of values.
void remove(const HWEvent &Event)
constexpr HWEventSet(std::initializer_list< HWEvent > Events)
bool contains(const HWEventSet &Other) const
HWEventSet operator&(const HWEventSet &Other) const
LLVM_DUMP_METHOD void dump() const
HWEventSet operator|(const HWEventSet &Other) const
void remove(const HWEventSet &Other)
HWEventSet & operator|=(const HWEventSet &Other)
This set becomes the union of this and Other.
bool operator==(const HWEventSet &Other) const
constexpr HWEventSet(HWEvent Event)
void print(raw_ostream &OS) const
bool operator!=(const HWEventSet &Other) const
bool contains(const HWEvent &Event) const
HWEventSet & operator&=(const HWEventSet &Other)
This set becomes the intersection of this and Other.
void insert(const HWEvent &Event)
Representation of each machine instruction.
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
This class implements an extremely fast bulk output stream that can only output to a stream.
HWEventSet getEventsFor(const MachineInstr &Inst, const GCNSubtarget &ST, bool IsExpertMode)
static constexpr StringLiteral toString(HWEvent Event)
HWEvent
TODO: This should be a bitmask from the start instead of having this enum.
iota_range< HWEvent > hw_events(HWEvent MaxEvent=HWEvent::NUM_WAIT_EVENTS)
Return an iterator over all events between FIRST_WAIT_EVENT and MaxEvent (exclusive,...
This is an optimization pass for GlobalISel generic memory operations.
auto enum_seq(EnumT Begin, EnumT End)
Iterate over an enum type from Begin up to - but not including - End.
static constexpr bool is_iterable