30 MDTuple *Tuple = dyn_cast<MDTuple>(MD);
31 assert(Tuple &&
"Invalid MMRA structure");
33 const auto HandleTagMD = [
this](
MDNode *TagMD) {
34 Tags.
insert({cast<MDString>(TagMD->getOperand(0))->getString(),
35 cast<MDString>(TagMD->getOperand(1))->getString()});
44 MDNode *MDOp = cast<MDNode>(
Op.get());
51 if (
auto *Tuple = dyn_cast<MDTuple>(MD)) {
52 return Tuple->getNumOperands() == 2 &&
53 isa<MDString>(Tuple->getOperand(0)) &&
54 isa<MDString>(Tuple->getOperand(1));
74 for (
const auto &
Tag : Tags)
90 for (
const auto &[
P, S] :
A) {
91 if (
B.hasTagWithPrefix(
P))
94 for (
const auto &[
P, S] :
B) {
95 if (
A.hasTagWithPrefix(
P))
103 return Tags.
count({Prefix, Suffix});
113 for (
const auto &[
P, S] : Tags)
114 PrefixStatuses[
P] |= (
Other.hasTag(
P, S) || !
Other.hasTagWithPrefix(
P));
115 for (
const auto &[
P, S] :
Other)
118 for (
auto &[Prefix,
Status] : PrefixStatuses) {
127 for (
const auto &[
P, S] : Tags)
146 for (
const auto &[
P, S] : Tags) {
161 if (
const auto *
C = dyn_cast<CallBase>(&
I))
162 return C->mayReadOrWriteMemory() ||
163 !
C->getMemoryEffects().doesNotAccessMemory();
168 return isa<LoadInst>(
I) || isa<StoreInst>(
I) || isa<AtomicCmpXchgInst>(
I) ||
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
static bool isReadWriteMemCall(const Instruction &I)
This file provides utility for Memory Model Relaxation Annotations (MMRAs).
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringSet - A set-like wrapper for the StringMap.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
const T & front() const
front - Get the first element.
size_t size() const
size - Get the array size.
bool empty() const
empty - Check if the array is empty.
This class represents an Operation in the Expression.
This is an important class for using LLVM in a threaded context.
ArrayRef< MDOperand > operands() const
Tracking metadata reference owned by Metadata.
static MDString * get(LLVMContext &Context, StringRef Str)
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
std::pair< iterator, bool > insert(const ValueT &V)
size_type count(const_arg_type_t< ValueT > V) const
Return 1 if the specified key is in the set, 0 otherwise.
This class implements an extremely fast bulk output stream that can only output to a stream.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
bool canInstructionHaveMMRAs(const Instruction &I)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.