summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-07-13 22:34:50 +0000
committerJustin Lebar <jlebar@google.com>2016-07-13 22:34:50 +0000
commitdfd358f597cea078061476991bfeea06b9c3a7d4 (patch)
tree25400ad93e7f2735e38ac313f4effbe3a6e1fc17 /llvm/lib/CodeGen/MachineInstr.cpp
parent7d2aecbc76f7591ff0f85daf9fd9ec4cbc3b29f6 (diff)
downloadbcm5719-llvm-dfd358f597cea078061476991bfeea06b9c3a7d4.tar.gz
bcm5719-llvm-dfd358f597cea078061476991bfeea06b9c3a7d4.zip
[MI] Fix MachineInstr::isInvariantLoad.
Summary: Previously it would say we had an invariant load if any of the memory operands were invariant. But the load should be invariant only if *all* the memory operands are invariant. No testcase because this has proven to be very difficult to tickle in practice. As just one example, ARM's ldrd instruction, which loads 64 bits into two 32-bit regs, is theoretically affected by this. But when it's produced, it loses its memoperands' invariance bits! Reviewers: jfb Subscribers: llvm-commits, aemerson Differential Revision: http://reviews.llvm.org/D22318 llvm-svn: 275331
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 0b55d2e0b43..0b107c0abe5 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -1585,8 +1585,7 @@ bool MachineInstr::isInvariantLoad(AliasAnalysis *AA) const {
E = memoperands_end(); I != E; ++I) {
if ((*I)->isVolatile()) return false;
if ((*I)->isStore()) return false;
- if ((*I)->isInvariant()) return true;
-
+ if ((*I)->isInvariant()) continue;
// A load from a constant PseudoSourceValue is invariant.
if (const PseudoSourceValue *PSV = (*I)->getPseudoValue())
OpenPOWER on IntegriCloud