[PATCH] Add two helper functions: isAtLeastAcquire, isAtLeastRelease
Robin Morisset
morisset at google.com
Mon Aug 11 11:03:34 PDT 2014
Add a comment to the body of the two functions, based on the comment of jfb
http://reviews.llvm.org/D4844
Files:
include/llvm/IR/Instructions.h
Index: include/llvm/IR/Instructions.h
===================================================================
--- include/llvm/IR/Instructions.h
+++ include/llvm/IR/Instructions.h
@@ -236,6 +236,12 @@
bool isUnordered() const {
return getOrdering() <= Unordered && !isVolatile();
}
+ bool isAtLeastAcquire() const {
+ // We do not have to check for AcquireRelease as this is a load and
+ // it is not a valid ordering for loads.
+ return (getOrdering() == Acquire
+ || getOrdering() == SequentiallyConsistent);
+ }
Value *getPointerOperand() { return getOperand(0); }
const Value *getPointerOperand() const { return getOperand(0); }
@@ -356,6 +362,12 @@
bool isUnordered() const {
return getOrdering() <= Unordered && !isVolatile();
}
+ bool isAtLeastRelease() const {
+ // We do not have to check for AcquireRelease as this is a store and
+ // it is not a valid ordering for stores.
+ return (getOrdering() == Release
+ || getOrdering() == SequentiallyConsistent);
+ }
Value *getValueOperand() { return getOperand(0); }
const Value *getValueOperand() const { return getOperand(0); }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4844.12354.patch
Type: text/x-patch
Size: 1154 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140811/9b20102f/attachment.bin>
More information about the llvm-commits
mailing list