|
LLVM 23.0.0git
|
Bit mask of hardware events. More...
#include "Target/AMDGPU/AMDGPUHWEvents.h"
Classes | |
| class | const_iterator |
| Iterates over the set bits of an HWEvent. More... | |
Public Types | |
| enum | : value_type { NONE = 0 , ALL = ((HWEVENT_LAST_EVENT << 1) - 1) } |
| using | value_type = uint32_t |
Bit mask of hardware events.
This is useful to manipulate events as hardware events rarely come alone. This class implements all the usual operators one would need to manipulate a bit mask, and also supports printing to a raw_ostream and iterating over all the set bits of the event mask.
This class behaves like a constexpr set of flags. None of the methods should be able to mutate the data unless they are assignment operators. Examples:
/// A |= B; // Add flags (union). /// A -= B; // Remove flags (substraction). /// A &= B; // Intersection. /// A ^= B; // Bitwise XOR. /// (bool)A; // Check whether any bits are set; A.any() also works. /// !A; // Check if no bits are set; A.none() also works. /// A.size(); // Check how many bits are set. ///
This type also provides certain stronger guarantees than a simple integer:
Definition at line 49 of file AMDGPUHWEvents.h.
| using llvm::AMDGPU::HWEvents::value_type = uint32_t |
Definition at line 51 of file AMDGPUHWEvents.h.
| anonymous enum : value_type |
| Enumerator | |
|---|---|
| NONE | |
| ALL | |
Definition at line 53 of file AMDGPUHWEvents.h.
|
constexprdefault |
Referenced by llvm::AMDGPU::HWEvents::const_iterator::const_iterator(), contains(), operator!=(), operator&(), operator&(), operator&=(), operator&=(), llvm::AMDGPU::HWEvents::const_iterator::operator*(), operator-(), operator-=(), operator==(), operator^=(), operator|(), operator|=(), and operator~().
|
inlineconstexpr |
Definition at line 93 of file AMDGPUHWEvents.h.
|
inlineconstexpr |
Definition at line 98 of file AMDGPUHWEvents.h.
Referenced by operator bool().
|
inline |
Definition at line 108 of file AMDGPUHWEvents.h.
Definition at line 104 of file AMDGPUHWEvents.h.
References HWEvents(), and llvm::AMDGPU::Other.
| LLVM_DUMP_METHOD void llvm::AMDGPU::HWEvents::dump | ( | ) | const |
Definition at line 20 of file AMDGPUHWEvents.cpp.
References llvm::dbgs(), and LLVM_DUMP_METHOD.
|
inline |
Definition at line 109 of file AMDGPUHWEvents.h.
|
inlineconstexpr |
Definition at line 99 of file AMDGPUHWEvents.h.
|
inlineexplicitconstexpr |
Definition at line 102 of file AMDGPUHWEvents.h.
References any().
Definition at line 128 of file AMDGPUHWEvents.h.
References HWEvents(), and llvm::AMDGPU::Other.
Definition at line 114 of file AMDGPUHWEvents.h.
References HWEvents(), and llvm::AMDGPU::Other.
|
inlineconstexpr |
Overload both bitwise AND operators w/ the value_type to avoid an implicit conversion to HWEvent in this common pattern used to clear an event bit: Events & ~HWEvent::EVENT_TO_CLEAR.
If we had the implicit conversion to HWEvent, we'd assert because ~HWEvent::EVENT_TO_CLEAR has bits set outside of HWEvent::ALL.
Definition at line 153 of file AMDGPUHWEvents.h.
References HWEvents(), and llvm::AMDGPU::Other.
Definition at line 134 of file AMDGPUHWEvents.h.
References HWEvents(), and llvm::AMDGPU::Other.
|
inlineconstexpr |
Definition at line 154 of file AMDGPUHWEvents.h.
References HWEvents(), and llvm::AMDGPU::Other.
Definition at line 121 of file AMDGPUHWEvents.h.
References HWEvents(), and llvm::AMDGPU::Other.
Definition at line 143 of file AMDGPUHWEvents.h.
References HWEvents(), and llvm::AMDGPU::Other.
Definition at line 127 of file AMDGPUHWEvents.h.
References HWEvents(), and llvm::AMDGPU::Other.
Definition at line 117 of file AMDGPUHWEvents.h.
Definition at line 138 of file AMDGPUHWEvents.h.
References HWEvents(), and llvm::AMDGPU::Other.
Definition at line 111 of file AMDGPUHWEvents.h.
References HWEvents(), and llvm::AMDGPU::Other.
Definition at line 130 of file AMDGPUHWEvents.h.
References HWEvents(), and llvm::AMDGPU::Other.
|
inlineconstexpr |
Definition at line 125 of file AMDGPUHWEvents.h.
References ALL, and HWEvents().
|
inlineconstexpr |
Definition at line 97 of file AMDGPUHWEvents.h.
References llvm::popcount().
|
inlineconstexpr |
Definition at line 100 of file AMDGPUHWEvents.h.
Referenced by llvm::AMDGPU::HWEvents::const_iterator::const_iterator().