Commit e6e32315 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Eliminate redundant elements kind transitions.

A TransitionElementsKind operation is redundant if we already know that
the object has the target_map (independent of what the source_map might
be).

R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2233403003
Cr-Commit-Position: refs/heads/master@{#38597}
parent b8c05042
......@@ -393,6 +393,11 @@ Reduction LoadElimination::ReduceTransitionElementsKind(Node* node) {
AbstractState const* state = node_states_.Get(effect);
if (state == nullptr) return NoChange();
if (Node* const object_map = state->LookupField(object, 0)) {
if (target_map == object_map) {
// The {object} already has the {target_map}, so this TransitionElements
// {node} is fully redundant (independent of what {source_map} is).
return Replace(effect);
}
state = state->KillField(object, 0, zone());
if (source_map == object_map) {
state = state->AddField(object, 0, target_map, zone());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment