[PATCH] Add two helper functions: isAtLeastAcquire, isAtLeastRelease

Robin Morisset morisset at google.com
Mon Aug 11 10:37:02 PDT 2014


Hi jfb, reames,

These methods are available to loads/stores respectively, and will be used
in a later separate patch.
This is patch 2/3 of the work started in D4797, but should be completely independent.

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,10 @@
   bool isUnordered() const {
     return getOrdering() <= Unordered && !isVolatile();
   }
+  bool isAtLeastAcquire() const {
+    return (getOrdering() == Acquire
+        || getOrdering() == SequentiallyConsistent);
+  }
 
   Value *getPointerOperand() { return getOperand(0); }
   const Value *getPointerOperand() const { return getOperand(0); }
@@ -356,6 +360,10 @@
   bool isUnordered() const {
     return getOrdering() <= Unordered && !isVolatile();
   }
+  bool isAtLeastRelease() const {
+    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.12349.patch
Type: text/x-patch
Size: 914 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140811/f66869d8/attachment.bin>


More information about the llvm-commits mailing list