summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-29 21:08:52 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-29 21:08:52 +0000
commit23793141a1ea05f443541f580ad061225fa47052 (patch)
treeb698f414b53737be5ab11043ea67eaa5bdace7d4
parentc6a0be00ab36d2ea2df739a5718be865e2894735 (diff)
downloadbcm5719-llvm-23793141a1ea05f443541f580ad061225fa47052.tar.gz
bcm5719-llvm-23793141a1ea05f443541f580ad061225fa47052.zip
Add MachineMemOperand::isUnordered().
This means the same as LoadInst/StoreInst::isUnordered(), and implies !isVolatile(). Atomic loads and stored are also ordered, and this is the right method to check if it is safe to reorder memory operations. Ordered atomics can't be reordered wrt normal loads and stores, which is a stronger constraint than volatile. llvm-svn: 162859
-rw-r--r--llvm/include/llvm/CodeGen/MachineMemOperand.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineMemOperand.h b/llvm/include/llvm/CodeGen/MachineMemOperand.h
index 1ac9080b75d..ddb127120f2 100644
--- a/llvm/include/llvm/CodeGen/MachineMemOperand.h
+++ b/llvm/include/llvm/CodeGen/MachineMemOperand.h
@@ -151,6 +151,15 @@ public:
bool isNonTemporal() const { return Flags & MONonTemporal; }
bool isInvariant() const { return Flags & MOInvariant; }
+ /// isUnordered - Returns true if this memory operation doesn't have any
+ /// ordering constraints other than normal aliasing. Volatile and atomic
+ /// memory operations can't be reordered.
+ ///
+ /// Currently, we don't model the difference between volatile and atomic
+ /// operations. They should retain their ordering relative to all memory
+ /// operations.
+ bool isUnordered() const { return !isVolatile(); }
+
/// refineAlignment - Update this MachineMemOperand to reflect the alignment
/// of MMO, if it has a greater alignment. This must only be used when the
/// new alignment applies to all users of this MachineMemOperand.
OpenPOWER on IntegriCloud