18 #ifndef LLVM_SUPPORT_ATOMICORDERING_H 19 #define LLVM_SUPPORT_ATOMICORDERING_H 82 static const char *names[8] = {
"not_atomic",
"unordered",
"monotonic",
83 "consume",
"acquire",
"release",
84 "acq_rel",
"seq_cst"};
85 return names[
static_cast<size_t>(ao)];
91 static const bool lookup[8][8] = {
93 {
false,
false,
false,
false,
false,
false,
false,
false},
94 {
true,
false,
false,
false,
false,
false,
false,
false},
95 {
true,
true,
false,
false,
false,
false,
false,
false},
96 {
true,
true,
true,
false,
false,
false,
false,
false},
97 {
true,
true,
true,
true,
false,
false,
false,
false},
98 {
true,
true,
true,
false,
false,
false,
false,
false},
99 {
true,
true,
true,
true,
true,
true,
false,
false},
100 {
true,
true,
true,
true,
true,
true,
true,
false},
102 return lookup[
static_cast<size_t>(ao)][static_cast<size_t>(other)];
106 static const bool lookup[8][8] = {
108 {
true,
false,
false,
false,
false,
false,
false,
false},
109 {
true,
true,
false,
false,
false,
false,
false,
false},
110 {
true,
true,
true,
false,
false,
false,
false,
false},
111 {
true,
true,
true,
true,
false,
false,
false,
false},
112 {
true,
true,
true,
true,
true,
false,
false,
false},
113 {
true,
true,
true,
false,
false,
true,
false,
false},
114 {
true,
true,
true,
true,
true,
true,
true,
false},
115 {
true,
true,
true,
true,
true,
true,
true,
true},
117 return lookup[
static_cast<size_t>(ao)][static_cast<size_t>(other)];
147 return lookup[
static_cast<size_t>(ao)];
152 #endif // LLVM_SUPPORT_ATOMICORDERING_H
bool isStrongerThanUnordered(AtomicOrdering ao)
This class represents lattice values for constants.
bool isValidAtomicOrdering(Int I)
bool operator>(int64_t V1, const APSInt &V2)
bool operator<=(int64_t V1, const APSInt &V2)
bool operator>=(int64_t V1, const APSInt &V2)
bool isStrongerThan(AtomicOrdering ao, AtomicOrdering other)
Returns true if ao is stronger than other as defined by the AtomicOrdering lattice, which is based on C++'s definition.
static const uint16_t * lookup(unsigned opcode, unsigned domain, ArrayRef< uint16_t[3]> Table)
AtomicOrdering
Atomic ordering for LLVM's memory model.
bool isStrongerThanMonotonic(AtomicOrdering ao)
bool isAtLeastOrStrongerThan(AtomicOrdering ao, AtomicOrdering other)
bool isValidAtomicOrderingCABI(Int I)
const char * toIRString(AtomicOrdering ao)
String used by LLVM IR to represent atomic ordering.
bool isAcquireOrStronger(AtomicOrdering ao)
AtomicOrderingCABI
Atomic ordering for C11 / C++11's memody models.
bool isReleaseOrStronger(AtomicOrdering ao)
AtomicOrderingCABI toCABI(AtomicOrdering ao)
bool operator<(int64_t V1, const APSInt &V2)