From 3ac17fcce8773388512ce72cb491b202872ca1c1 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 6 Aug 2014 23:02:54 +0100 Subject: Fix SsaDeadPhiElimination in the presence of dependent phis. This fixes the problem of having a dead loop phi taking as back-edge input a phi that also has this loop phi as input. Walking backwards does not solve the problem because the loop phi will be visited last. Most of the time, dex removes dead locals like this. Change-Id: I797198cf9c15f8faa6585cca157810e23aaa4940 --- compiler/optimizing/nodes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'compiler/optimizing/nodes.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index cb3dd0f69f..bb699e47c3 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -501,6 +501,7 @@ class HInstruction : public ArenaObject { void SetBlock(HBasicBlock* block) { block_ = block; } bool IsInBlock() const { return block_ != nullptr; } bool IsInLoop() const { return block_->IsInLoop(); } + bool IsLoopHeaderPhi() { return IsPhi() && block_->IsLoopHeader(); } virtual size_t InputCount() const = 0; virtual HInstruction* InputAt(size_t i) const = 0; -- cgit v1.2.3-59-g8ed1b