[Lanai] Be super conservative about atomics

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.

llvm-svn: 354800
This commit is contained in:
Philip Reames 2019-02-25 17:36:10 +00:00
parent 2a4c1f3e5b
commit a64de6720b
1 changed files with 2 additions and 1 deletions

View 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;