9#ifndef LLVM_TARGETPARSER_ATOMICSCOPE_H
10#define LLVM_TARGETPARSER_ATOMICSCOPE_H
33inline std::optional<StringRef>
35 bool IsSingleAddressSpace =
false) {
39 return IsSingleAddressSpace ?
"singlethread-one-as" :
"singlethread";
41 return IsSingleAddressSpace ?
"wavefront-one-as" :
"wavefront";
43 return IsSingleAddressSpace ?
"workgroup-one-as" :
"workgroup";
45 return IsSingleAddressSpace ?
"cluster-one-as" :
"cluster";
47 return IsSingleAddressSpace ?
"agent-one-as" :
"agent";
49 return IsSingleAddressSpace ?
"one-as" :
"";
56 return "singlethread";
73 return "singlethread";
93inline std::optional<std::pair<AtomicScope, bool>>
95 using Result = std::optional<std::pair<AtomicScope, bool>>;
97 bool IsSingleAddressSpace) -> std::pair<AtomicScope, bool> {
98 return {S, IsSingleAddressSpace};
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
Represent a constant reference to a string, i.e.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
Triple - Helper class for working with autoconf configuration names.
This is an optimization pass for GlobalISel generic memory operations.
AtomicScope
Target-neutral memory synchronization scopes.
std::optional< std::pair< AtomicScope, bool > > parseAtomicScopeIRString(const Triple &T, StringRef Name)
Parses a target syncscope string into its abstract scope, the inverse of getAtomicScopeIRString.
std::optional< StringRef > getAtomicScopeIRString(const Triple &T, AtomicScope S, bool IsSingleAddressSpace=false)
Returns the LLVM IR syncscope string that T uses to spell S.