aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2011-11-08 18:42:53 +0000
committerPete Cooper <peter_cooper@apple.com>2011-11-08 18:42:53 +0000
commitd752e0f7e64585839cb3a458ef52456eaebbea3c (patch)
tree79cfeacd373fe93faadfc504b54da791046bd87d /lib/CodeGen/MachineInstr.cpp
parent30b4d8b83b7b3995ac1b53f35d3110d48676b187 (diff)
downloadexternal_llvm-d752e0f7e64585839cb3a458ef52456eaebbea3c.zip
external_llvm-d752e0f7e64585839cb3a458ef52456eaebbea3c.tar.gz
external_llvm-d752e0f7e64585839cb3a458ef52456eaebbea3c.tar.bz2
Added invariant field to the DAG.getLoad method and changed all calls.
When this field is true it means that the load is from constant (runt-time or compile-time) and so can be hoisted from loops or moved around other memory accesses git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r--lib/CodeGen/MachineInstr.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index a240667..b0ef9d4 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -1253,6 +1253,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 (const Value *V = (*I)->getValue()) {
// A load from a constant PseudoSourceValue is invariant.