summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2015-10-28 15:28:08 -0700
committer Aart Bik <ajcbik@google.com> 2015-10-29 13:29:50 -0700
commit73f1f3be46652d3f6df61b4234c366ebbf81274a (patch)
tree0d6c2f9eb2331fd5de5aa4c43ebcb45e857a4682 /compiler/optimizing/nodes.h
parentf7b7f9984da66149e5fe05713845961d7b069a23 (diff)
Move loop invariant utility to more general place.
Change-Id: I15ebfbf9684f0fcce9e63d078ff8dc1381fd1ca3
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 7ac39d1a8e..0565c9a1cb 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -551,6 +551,12 @@ class HLoopInformation : public ArenaObject<kArenaAllocLoopInfo> {
// Note that `other` *must* be populated before entering this function.
bool IsIn(const HLoopInformation& other) const;
+ // Returns true if instruction is not defined within this loop or any loop nested inside
+ // this loop. If must_dominate is set, only definitions that actually dominate the loop
+ // header can be invariant. Otherwise, any definition outside the loop, including
+ // definitions that appear after the loop, is invariant.
+ bool IsLoopInvariant(HInstruction* instruction, bool must_dominate) const;
+
const ArenaBitVector& GetBlocks() const { return blocks_; }
void Add(HBasicBlock* block);