Call HuntForOriginalReference to get to the null.
The null constant might be hiding under a HBoundType
(which we could clean up in instruction simplifier, but
that is orthogonal).
bug:27683874
Change-Id: Ide8ec5bcd439ec0fca5e54175ebeedc5a9f679a3
diff --git a/compiler/optimizing/load_store_elimination.cc b/compiler/optimizing/load_store_elimination.cc
index 561dcfb..9601b06 100644
--- a/compiler/optimizing/load_store_elimination.cc
+++ b/compiler/optimizing/load_store_elimination.cc
@@ -738,10 +738,12 @@
DCHECK(instruction->IsArrayGet()) << instruction->DebugName();
HInstruction* array = instruction->AsArrayGet()->GetArray();
DCHECK(array->IsNullCheck()) << array->DebugName();
- DCHECK(array->InputAt(0)->IsNullConstant()) << array->InputAt(0)->DebugName();
+ HInstruction* input = HuntForOriginalReference(array->InputAt(0));
+ DCHECK(input->IsNullConstant()) << input->DebugName();
array = heap_value->AsArrayGet()->GetArray();
DCHECK(array->IsNullCheck()) << array->DebugName();
- DCHECK(array->InputAt(0)->IsNullConstant()) << array->InputAt(0)->DebugName();
+ input = HuntForOriginalReference(array->InputAt(0));
+ DCHECK(input->IsNullConstant()) << input->DebugName();
}
return;
}