]> granicus.if.org Git - llvm/commitdiff
[SDAG] Minor code cleanup/standardization of atomic accessors [NFC]
authorPhilip Reames <listmail@philipreames.com>
Thu, 15 Aug 2019 22:21:14 +0000 (22:21 +0000)
committerPhilip Reames <listmail@philipreames.com>
Thu, 15 Aug 2019 22:21:14 +0000 (22:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369057 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAGNodes.h
lib/Target/AArch64/AArch64InstructionSelector.cpp
lib/Target/ARM/ARMInstructionSelector.cpp

index c88afe19712f18e856511c0b004758bbedd1c7d0..62764004d77c71c8fc0e052a95e78621e0733b7a 100644 (file)
@@ -1351,6 +1351,14 @@ public:
   /// store occurs.
   AtomicOrdering getOrdering() const { return MMO->getOrdering(); }
 
+  /// Return true if the memory operation ordering is Unordered or higher.
+  bool isAtomic() const { return MMO->isAtomic(); }
+
+  /// Returns true if the memory operation doesn't imply any ordering
+  /// constraints on surrounding memory operations beyond the normal memory
+  /// aliasing rules.
+  bool isUnordered() const { return MMO->isUnordered(); }
+
   /// Return the type of the in-memory value.
   EVT getMemoryVT() const { return MemoryVT; }
 
index 88d522ea7238803c8e12d0b447f55a32bc290378..0c808bcb0a152654f0e950b0c3bad44a1eae87b5 100644 (file)
@@ -1237,7 +1237,7 @@ bool AArch64InstructionSelector::earlySelectLoad(
 
   // Don't handle atomic loads/stores yet.
   auto &MemOp = **I.memoperands_begin();
-  if (MemOp.getOrdering() != AtomicOrdering::NotAtomic) {
+  if (MemOp.isAtomic()) {
     LLVM_DEBUG(dbgs() << "Atomic load/store not supported yet\n");
     return false;
   }
@@ -1739,7 +1739,7 @@ bool AArch64InstructionSelector::select(MachineInstr &I) {
     }
 
     auto &MemOp = **I.memoperands_begin();
-    if (MemOp.getOrdering() != AtomicOrdering::NotAtomic) {
+    if (MemOp.isAtomic()) {
       // For now we just support s8 acquire loads to be able to compile stack
       // protector code.
       if (MemOp.getOrdering() == AtomicOrdering::Acquire &&
index 4696404047a49043c7d2422537e50610ccd553be..8e5e474c0f59e19a969661c9b34243295536d32c 100644 (file)
@@ -1076,7 +1076,7 @@ bool ARMInstructionSelector::select(MachineInstr &I) {
   case G_STORE:
   case G_LOAD: {
     const auto &MemOp = **I.memoperands_begin();
-    if (MemOp.getOrdering() != AtomicOrdering::NotAtomic) {
+    if (MemOp.isAtomic()) {
       LLVM_DEBUG(dbgs() << "Atomic load/store not supported yet\n");
       return false;
     }