From d31cf3d55a0847c018c4eaa2b349b8eea509de64 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Mon, 8 Sep 2014 17:30:24 +0100 Subject: First optimization in new compiler: simple GVN. Change-Id: Ibe0efa4e84fd020a53ded310a92e0b4363f91b12 --- compiler/optimizing/nodes.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/optimizing/nodes.cc') diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index 376d1af3ef..1a24677261 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -124,6 +124,7 @@ void HGraph::VisitBlockForDominatorTree(HBasicBlock* block, // dominator of the block. We can then start visiting its successors. if (visits->Get(block->GetBlockId()) == block->GetPredecessors().Size() - block->NumberOfBackEdges()) { + block->GetDominator()->AddDominatedBlock(block); reverse_post_order_.Add(block); for (size_t i = 0; i < block->GetSuccessors().Size(); i++) { VisitBlockForDominatorTree(block->GetSuccessors().Get(i), block, visits); @@ -543,6 +544,7 @@ bool HCondition::NeedsMaterialization() const { bool HInstruction::Equals(HInstruction* other) const { if (!InstructionTypeEquals(other)) return false; + DCHECK_EQ(GetKind(), other->GetKind()); if (!InstructionDataEquals(other)) return false; if (GetType() != other->GetType()) return false; if (InputCount() != other->InputCount()) return false; @@ -550,6 +552,7 @@ bool HInstruction::Equals(HInstruction* other) const { for (size_t i = 0, e = InputCount(); i < e; ++i) { if (InputAt(i) != other->InputAt(i)) return false; } + DCHECK_EQ(ComputeHashCode(), other->ComputeHashCode()); return true; } -- cgit v1.2.3-59-g8ed1b