[PATCH] D57593: Fix a bug in the definition of isUnordered on MachineMemOperand

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 1 11:08:57 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL352898: Fix a bug in the definition of isUnordered on MachineMemOperand (authored by reames, committed by ).
Herald added a project: LLVM.

Changed prior to commit:
  https://reviews.llvm.org/D57593?vs=184761&id=184797#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57593/new/

https://reviews.llvm.org/D57593

Files:
  llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h


Index: llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h
===================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h
+++ llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h
@@ -266,13 +266,13 @@
   bool isAtomic() const { return getOrdering() != AtomicOrdering::NotAtomic; }
 
   /// 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(); }
+  /// constraints other than normal aliasing. Volatile and (ordered) atomic
+  /// memory operations can't be reordered. 
+  bool isUnordered() const {
+    return (getOrdering() == AtomicOrdering::NotAtomic ||
+            getOrdering() == AtomicOrdering::Unordered) &&
+           !isVolatile();
+  }
 
   /// 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57593.184797.patch
Type: text/x-patch
Size: 1226 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190201/f8754ac7/attachment.bin>


More information about the llvm-commits mailing list