aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2019-02-11 23:34:33 +0000
committerPhilip Reames <listmail@philipreames.com>2019-02-11 23:34:33 +0000
commit5906a6591cdc3aefe6c9cd67831724cae7978471 (patch)
tree730afc97bb0ae915da962d6ebcd554a850facb6d /llvm/lib/CodeGen/MachineInstr.cpp
parente3cd735ea6378e5dd7765828f560ed49be845a95 (diff)
downloadllvm-5906a6591cdc3aefe6c9cd67831724cae7978471.zip
llvm-5906a6591cdc3aefe6c9cd67831724cae7978471.tar.gz
llvm-5906a6591cdc3aefe6c9cd67831724cae7978471.tar.bz2
Be conservative about unordered accesses for the moment
Background: As described in https://reviews.llvm.org/D57601, I'm working towards separating volatile and atomic in the MMO uses for atomic instructions. In https://reviews.llvm.org/D57593, I fixed a bug where isUnordered was returning the wrong result, but didn't account for the fact I was getting slightly ahead of myself. While both uses of isUnordered are correct (as far as I can tell), we don't have tests to demonstrate this and being aggressive gets in the way of having the removal of volatile truly be non-functional. Once D57601 lands, I will return to these call sites, revert this patch, and add the appropriate tests to show the expected behaviour. Differential Revision: https://reviews.llvm.org/D57802 llvm-svn: 353766
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 4c80b7b..0b8e9ca 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -1291,8 +1291,10 @@ bool MachineInstr::hasOrderedMemoryRef() const {
return true;
// Check if any of our memory operands are ordered.
+ // TODO: This should probably be be isUnordered (see D57601), but the callers
+ // need audited and test cases written to be sure.
return llvm::any_of(memoperands(), [](const MachineMemOperand *MMO) {
- return !MMO->isUnordered();
+ return MMO->isVolatile() || MMO->isAtomic();
});
}