summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2015-05-07 09:59:30 +0100
committerDavid Brazdil <dbrazdil@google.com>2015-05-13 10:02:07 +0100
commite8ff50df01c89e1b5264a5a900cfebdde87a9b44 (patch)
treea2c0cc80afcf4cbce0f2293e09c49cee98e5a4bb /compiler/optimizing/nodes.h
parent6185884829333f0035de0488b1c4a2e84c7dd38b (diff)
downloadandroid_art-e8ff50df01c89e1b5264a5a900cfebdde87a9b44.tar.gz
android_art-e8ff50df01c89e1b5264a5a900cfebdde87a9b44.tar.bz2
android_art-e8ff50df01c89e1b5264a5a900cfebdde87a9b44.zip
ART: Rediscover loops after deleting blocks in DCE
The way DCE currently updates loop information does not cover all cases. This patch removes the logic, resets loop information of live blocks to pre-SSA state and reanalyzes the affected loops. Change-Id: I0b996a70235b95a8db0de9a23a03f71db57a21b8 (cherry picked from commit a4b8c21dae70ae34aee13628632c39a675c06022)
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 031761e7f7..77b587e74f 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -436,6 +436,12 @@ class HLoopInformation : public ArenaObject<kArenaAllocMisc> {
// that is the header dominates the back edge.
bool Populate();
+ // Reanalyzes the loop by removing loop info from its blocks and re-running
+ // Populate(). If there are no back edges left, the loop info is completely
+ // removed as well as its SuspendCheck instruction. It must be run on nested
+ // inner loops first.
+ void Update();
+
// Returns whether this loop information contains `block`.
// Note that this loop information *must* be populated before entering this function.
bool Contains(const HBasicBlock& block) const;
@@ -705,14 +711,9 @@ class HBasicBlock : public ArenaObject<kArenaAllocMisc> {
loop_information_ = info;
}
- // Checks if the loop information points to a valid loop. If the loop has been
- // dismantled (does not have a back edge any more), loop information is
- // removed or replaced with the information of the first valid outer loop.
- void UpdateLoopInformation();
-
bool IsInLoop() const { return loop_information_ != nullptr; }
- // Returns wheter this block dominates the blocked passed as parameter.
+ // Returns whether this block dominates the blocked passed as parameter.
bool Dominates(HBasicBlock* block) const;
size_t GetLifetimeStart() const { return lifetime_start_; }