From fb337ea53d1e6fe68b24217a9ea95e9f544ef697 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 25 Nov 2015 15:25:10 +0000 Subject: Move PC-relative addressing bases to a better position. Move the platform-specific HX86ComputeBaseMethodAddress and HArmDexCacheArraysBase to the latest dominator of their uses outside any loop. This brings the base closer to the first use (previously, it was in the entry block) and relieves some pressure on the register allocator while avoiding recalculation of the base in a loop. Change-Id: I231aa81eb5b4de9af2d0167054d06b65eb18a636 --- compiler/optimizing/nodes.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'compiler/optimizing/nodes.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 0bf7734eaf..f2622034f3 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -1956,6 +1956,14 @@ class HInstruction : public ArenaObject { // Move `this` instruction before `cursor`. void MoveBefore(HInstruction* cursor); + // Move `this` before its first user and out of any loops. If there is no + // out-of-loop user that dominates all other users, move the instruction + // to the end of the out-of-loop common dominator of the user's blocks. + // + // This can be used only on non-throwing instructions with no side effects that + // have at least one use but no environment uses. + void MoveBeforeFirstUserAndOutOfLoops(); + #define INSTRUCTION_TYPE_CHECK(type, super) \ bool Is##type() const { return (As##type() != nullptr); } \ virtual const H##type* As##type() const { return nullptr; } \ -- cgit v1.2.3-59-g8ed1b