]> granicus.if.org Git - llvm/commitdiff
[Lanai] Be super conservative about atomics
authorPhilip Reames <listmail@philipreames.com>
Mon, 25 Feb 2019 17:36:10 +0000 (17:36 +0000)
committerPhilip Reames <listmail@philipreames.com>
Mon, 25 Feb 2019 17:36:10 +0000 (17:36 +0000)
As requested during review of D57601 <https://reviews.llvm.org/D57601>, be equally conservative for atomic MMOs as for volatile MMOs in all in tree backends. At the moment, all atomic MMOs are also volatile, but I'm about to change that.

Reviewed as part of https://reviews.llvm.org/D58490, with other backends still pending review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354800 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Lanai/LanaiMemAluCombiner.cpp

index ed5b6c4fd4a47238f3f81f71b7639dc2cc61239a..a69dcddfc25e17e897e848815f5448e2800deac2 100644 (file)
@@ -158,7 +158,8 @@ bool isNonVolatileMemoryOp(const MachineInstr &MI) {
   const MachineMemOperand *MemOperand = *MI.memoperands_begin();
 
   // Don't move volatile memory accesses
-  if (MemOperand->isVolatile())
+  // TODO: unclear if we need to be as conservative about atomics
+  if (MemOperand->isVolatile() || MemOperand->isAtomic())
     return false;
 
   return true;