[PATCH] D58490: [ARM, Lanai] Be super conservative about atomics
John Brawn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 25 04:40:08 PST 2019
john.brawn added inline comments.
================
Comment at: lib/Target/ARM/ARMLoadStoreOptimizer.cpp:1584
+ // TODO: Unclear whether we need to be as defense about atomic operations.
+ if (MMO.isVolatile() || MMO.isAtomic())
return false;
----------------
chill wrote:
> How about using `MachineMemOperand::isUnordered()` instead?
While it's probably valid to combine multiple unordered loads/stores into an ldm/stm (and also monotonic ones as well I think) the atomicity gets lost and the ldm/stm is not marked as atomic. I don't know if that actually leads to any problems, but I think we should be safe and just reject all atomic instructions for now. Maybe the TODO should be changed to something like
```
// TODO: We could allow unordered and monotonic atomics here, but we need to make sure the resulting ldm/stm is correctly marked as atomic.
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58490/new/
https://reviews.llvm.org/D58490
More information about the llvm-commits
mailing list