LLVM: lib/IR/Assumptions.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
20
21using namespace llvm;
22
25 if (.isValid())
26 return false;
27 assert(A.isStringAttribute() && "Expected a string attribute!");
28
30 A.getValueAsString().split(Strings, ",");
31
33}
34
36 if (.isValid())
38 assert(A.isStringAttribute() && "Expected a string attribute!");
39
42 A.getValueAsString().split(Strings, ",");
43
45 return Assumptions;
46}
47
48template
51 if (Assumptions.empty())
52 return false;
53
55
56 if ((CurAssumptions, Assumptions))
57 return false;
58
63
64 return true;
65}
66
70 return ::hasAssumption(A, AssumptionStr);
71}
72
77 return true;
78
80 return ::hasAssumption(A, AssumptionStr);
81}
82
85 return ::getAssumptions(A);
86}
87
90 return ::getAssumptions(A);
91}
92
94 return ::addAssumptionsImpl(F, Assumptions);
95}
96
99 return ::addAssumptionsImpl(CB, Assumptions);
100}
101
104 "omp_no_openmp",
105 "omp_no_openmp_routines",
106 "omp_no_parallelism",
107 "omp_no_openmp_constructs",
108 "ompx_spmd_amenable",
109 "ompx_no_call_asm",
110 "ompx_aligned_barrier",
111 });
112
113 return Object;
114}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static bool addAssumptionsImpl(AttrSite &Site, const DenseSet< StringRef > &Assumptions)
Definition Assumptions.cpp:49
This file contains the simple types necessary to represent the attributes associated with functions a...
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
This file defines generic set operations that may be used on set's of different types,...
Functions, function parameters, and return types can have attributes to indicate how they should be t...
static LLVM_ABI Attribute get(LLVMContext &Context, AttrKind Kind, uint64_t Val=0)
Return a uniquified Attribute object.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation or the function signa...
Attribute getFnAttr(StringRef Kind) const
Get the attribute of a given kind for the function.
Implements a dense probed hash-table based set.
This is an important class for using LLVM in a threaded context.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringSet - A wrapper for StringMap that provides set-like functionality.
void insert_range(Range &&R)
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI bool addAssumptions(Function &F, const DenseSet< StringRef > &Assumptions)
Appends the set of assumptions Assumptions to \F.
Definition Assumptions.cpp:93
LLVM_ABI StringSet & getKnownAssumptionStrings()
A set of known assumption strings that are accepted without warning and which can be recommended as t...
Definition Assumptions.cpp:102
bool set_union(S1Ty &S1, const S2Ty &S2)
set_union(A, B) - Compute A := A u B, return whether A changed.
LLVM_ABI bool hasAssumption(const Function &F, const KnownAssumptionString &AssumptionStr)
Return true if F has the assumption AssumptionStr attached.
Definition Assumptions.cpp:67
std::string join(IteratorT Begin, IteratorT End, StringRef Separator)
Joins the strings in the range [Begin, End), adding Separator between the elements.
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
LLVM_ABI DenseSet< StringRef > getAssumptions(const Function &F)
Return the set of all assumptions for the function F.
Definition Assumptions.cpp:83
constexpr StringRef AssumptionAttrKey
The key we use for assumption attributes.
Helper that allows to insert a new assumption string in the known assumption set by creating a (stati...