aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/IR/Instructions.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/IR/Instructions.h')
-rw-r--r--include/llvm/IR/Instructions.h34
1 files changed, 30 insertions, 4 deletions
diff --git a/include/llvm/IR/Instructions.h b/include/llvm/IR/Instructions.h
index a590f5a..dcf19e0 100644
--- a/include/llvm/IR/Instructions.h
+++ b/include/llvm/IR/Instructions.h
@@ -50,6 +50,22 @@ enum SynchronizationScope {
CrossThread = 1
};
+/// Returns true if the ordering is at least as strong as acquire
+/// (i.e. acquire, acq_rel or seq_cst)
+inline bool isAtLeastAcquire(AtomicOrdering Ord) {
+ return (Ord == Acquire ||
+ Ord == AcquireRelease ||
+ Ord == SequentiallyConsistent);
+}
+
+/// Returns true if the ordering is at least as strong as release
+/// (i.e. release, acq_rel or seq_cst)
+inline bool isAtLeastRelease(AtomicOrdering Ord) {
+return (Ord == Release ||
+ Ord == AcquireRelease ||
+ Ord == SequentiallyConsistent);
+}
+
//===----------------------------------------------------------------------===//
// AllocaInst Class
//===----------------------------------------------------------------------===//
@@ -119,7 +135,7 @@ public:
return getSubclassDataFromInstruction() & 32;
}
- /// \brief Specify whether this alloca is used to represent a the arguments to
+ /// \brief Specify whether this alloca is used to represent the arguments to
/// a call.
void setUsedWithInAlloca(bool V) {
setInstructionSubclassData((getSubclassDataFromInstruction() & ~32) |
@@ -225,7 +241,6 @@ public:
(xthread << 6));
}
- bool isAtomic() const { return getOrdering() != NotAtomic; }
void setAtomic(AtomicOrdering Ordering,
SynchronizationScope SynchScope = CrossThread) {
setOrdering(Ordering);
@@ -345,7 +360,6 @@ public:
(xthread << 6));
}
- bool isAtomic() const { return getOrdering() != NotAtomic; }
void setAtomic(AtomicOrdering Ordering,
SynchronizationScope SynchScope = CrossThread) {
setOrdering(Ordering);
@@ -637,7 +651,7 @@ public:
Sub,
/// *p = old & v
And,
- /// *p = ~old & v
+ /// *p = ~(old & v)
Nand,
/// *p = old | v
Or,
@@ -1376,6 +1390,12 @@ public:
return AttributeList.getParamAlignment(i);
}
+ /// \brief Extract the number of dereferenceable bytes for a call or
+ /// parameter (0=unknown).
+ uint64_t getDereferenceableBytes(unsigned i) const {
+ return AttributeList.getDereferenceableBytes(i);
+ }
+
/// \brief Return true if the call should not be treated as a call to a
/// builtin.
bool isNoBuiltin() const {
@@ -3051,6 +3071,12 @@ public:
return AttributeList.getParamAlignment(i);
}
+ /// \brief Extract the number of dereferenceable bytes for a call or
+ /// parameter (0=unknown).
+ uint64_t getDereferenceableBytes(unsigned i) const {
+ return AttributeList.getDereferenceableBytes(i);
+ }
+
/// \brief Return true if the call should not be treated as a call to a
/// builtin.
bool isNoBuiltin() const {