17#ifndef LLVM_SUPPORT_ATOMICORDERING_H
18#define LLVM_SUPPORT_ATOMICORDERING_H
83 static const char *names[8] = {
"not_atomic",
"unordered",
"monotonic",
84 "consume",
"acquire",
"release",
85 "acq_rel",
"seq_cst"};
86 return names[
static_cast<size_t>(ao)];
92 static const bool lookup[8][8] = {
94 {
false,
false,
false,
false,
false,
false,
false,
false},
95 {
true,
false,
false,
false,
false,
false,
false,
false},
96 {
true,
true,
false,
false,
false,
false,
false,
false},
97 {
true,
true,
true,
false,
false,
false,
false,
false},
98 {
true,
true,
true,
true,
false,
false,
false,
false},
99 {
true,
true,
true,
false,
false,
false,
false,
false},
100 {
true,
true,
true,
true,
true,
true,
false,
false},
101 {
true,
true,
true,
true,
true,
true,
true,
false},
103 return lookup[
static_cast<size_t>(AO)][
static_cast<size_t>(
Other)];
107 static const bool lookup[8][8] = {
109 {
true,
false,
false,
false,
false,
false,
false,
false},
110 {
true,
true,
false,
false,
false,
false,
false,
false},
111 {
true,
true,
true,
false,
false,
false,
false,
false},
112 {
true,
true,
true,
true,
false,
false,
false,
false},
113 {
true,
true,
true,
true,
true,
false,
false,
false},
114 {
true,
true,
true,
false,
false,
true,
false,
false},
115 {
true,
true,
true,
true,
true,
true,
true,
false},
116 {
true,
true,
true,
true,
true,
true,
true,
true},
118 return lookup[
static_cast<size_t>(AO)][
static_cast<size_t>(
Other)];
158 return lookup[
static_cast<size_t>(AO)];
static bool lookup(const GsymReader &GR, DataExtractor &Data, uint64_t &Offset, uint64_t BaseAddr, uint64_t Addr, SourceLocations &SrcLocs, llvm::Error &Err)
A Lookup helper functions.
This is an optimization pass for GlobalISel generic memory operations.
bool isValidAtomicOrderingCABI(Int I)
bool operator<(int64_t V1, const APSInt &V2)
bool isValidAtomicOrdering(Int I)
bool isStrongerThanMonotonic(AtomicOrdering AO)
bool operator>=(int64_t V1, const APSInt &V2)
bool isStrongerThanUnordered(AtomicOrdering AO)
bool isReleaseOrStronger(AtomicOrdering AO)
const char * toIRString(AtomicOrdering ao)
String used by LLVM IR to represent atomic ordering.
AtomicOrderingCABI
Atomic ordering for C11 / C++11's memory models.
AtomicOrderingCABI toCABI(AtomicOrdering AO)
bool operator>(int64_t V1, const APSInt &V2)
AtomicOrdering getMergedAtomicOrdering(AtomicOrdering AO, AtomicOrdering Other)
Return a single atomic ordering that is at least as strong as both the AO and Other orderings for an ...
bool isAtLeastOrStrongerThan(AtomicOrdering AO, AtomicOrdering Other)
AtomicOrdering
Atomic ordering for LLVM's memory model.
bool isAcquireOrStronger(AtomicOrdering AO)
bool isStrongerThan(AtomicOrdering AO, AtomicOrdering Other)
Returns true if ao is stronger than other as defined by the AtomicOrdering lattice,...
bool operator<=(int64_t V1, const APSInt &V2)