Have HInstruction::StrictlyDominates compute strict dominance.
Change-Id: I3a4fa133268615fb4ce54a0bcb43e0c2458cc865
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index aee2177..10c6014 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -472,7 +472,11 @@
return true;
}
-bool HInstruction::Dominates(HInstruction* other_instruction) const {
+bool HInstruction::StrictlyDominates(HInstruction* other_instruction) const {
+ if (other_instruction == this) {
+ // An instruction does not strictly dominate itself.
+ return false;
+ }
HBasicBlock* block = GetBlock();
HBasicBlock* other_block = other_instruction->GetBlock();
if (block != other_block) {