summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2015-10-29 21:00:17 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-10-29 21:00:17 +0000
commitc65d1f3d26a47e2fce3c3f8872e7942fec23f9b9 (patch)
tree1b81ca0d711ca0561e933563aee255b516a4191f /compiler/optimizing/nodes.h
parent5ad27592e2317b4c7932885eff702099f7cbe0f1 (diff)
parent73f1f3be46652d3f6df61b4234c366ebbf81274a (diff)
Merge "Move loop invariant utility to more general place."
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 6028d4b6fa..7df586692b 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);