summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mingyao Yang <mingyao@google.com> 2017-09-12 14:42:29 -0700
committer Mingyao Yang <mingyao@google.com> 2017-09-12 17:20:04 -0700
commit73b326ea1c1a58a5017f33286e511e1aa020de1c (patch)
treeb8bb8bc74508f619b7746c0167ae3572a6da2c2f
parent6b411fc9fd94da3c552d8b96cee14f6414e7b734 (diff)
Add a DCHECK for BCE.
A MonotonicValueRange should only be assigned for a loop header phi. Test: host run-test. Change-Id: Idd990670f5449c6b6b9c4a162522e960c34902de
-rw-r--r--compiler/optimizing/bounds_check_elimination.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/optimizing/bounds_check_elimination.cc b/compiler/optimizing/bounds_check_elimination.cc
index 6b832da2bb..a170734ff2 100644
--- a/compiler/optimizing/bounds_check_elimination.cc
+++ b/compiler/optimizing/bounds_check_elimination.cc
@@ -596,6 +596,7 @@ class BCEVisitor : public HGraphVisitor {
// Helper method to assign a new range to an instruction in given basic block.
void AssignRange(HBasicBlock* basic_block, HInstruction* instruction, ValueRange* range) {
+ DCHECK(!range->IsMonotonicValueRange() || instruction->IsLoopHeaderPhi());
GetValueRangeMap(basic_block)->Overwrite(instruction->GetId(), range);
}