Index: src/hydrogen-load-elimination.cc |
diff --git a/src/hydrogen-load-elimination.cc b/src/hydrogen-load-elimination.cc |
index ea12df865d7b0d91a43eb6f7162374e538509afb..634d75d8620f5ec866048f9794b8e2ff87a5a0a2 100644 |
--- a/src/hydrogen-load-elimination.cc |
+++ b/src/hydrogen-load-elimination.cc |
@@ -203,9 +203,12 @@ class HLoadEliminationTable : public ZoneObject { |
// Load is not redundant. Fill out a new entry. |
approx->last_value_ = instr; |
return instr; |
- } else { |
+ } else if (approx->last_value_->block()->EqualToOrDominates( |
+ instr->block())) { |
// Eliminate the load. Reuse previously stored value or load instruction. |
return approx->last_value_; |
+ } else { |
+ return instr; |
} |
} |