[PATCH] D58490: [ARM] Be super conservative about atomics

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 25 20:30:04 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL354845: [ARM] Be super conservative about atomics (authored by reames, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D58490?vs=188209&id=188303#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D58490

Files:
  llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp


Index: llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
===================================================================
--- llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
+++ llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
@@ -1580,7 +1580,9 @@
   const MachineMemOperand &MMO = **MI.memoperands_begin();
 
   // Don't touch volatile memory accesses - we may be changing their order.
-  if (MMO.isVolatile())
+  // TODO: We could allow unordered and monotonic atomics here, but we need to
+  // make sure the resulting ldm/stm is correctly marked as atomic. 
+  if (MMO.isVolatile() || MMO.isAtomic())
     return false;
 
   // Unaligned ldr/str is emulated by some kernels, but unaligned ldm/stm is
@@ -2144,7 +2146,8 @@
   // At the moment, we ignore the memoryoperand's value.
   // If we want to use AliasAnalysis, we should check it accordingly.
   if (!Op0->hasOneMemOperand() ||
-      (*Op0->memoperands_begin())->isVolatile())
+      (*Op0->memoperands_begin())->isVolatile() ||
+      (*Op0->memoperands_begin())->isAtomic())
     return false;
 
   unsigned Align = (*Op0->memoperands_begin())->getAlignment();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58490.188303.patch
Type: text/x-patch
Size: 1139 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190226/2ff25153/attachment.bin>


More information about the llvm-commits mailing list