Commit 1087cd66 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[turbofan] Make value projection collection more robust.

This makes the collection logic of {Projection} nodes (i.e. value
projections for multi-value returning calls) more robust. The projection
nodes by now have a control input, which in turn can make them appear
more than once in the use list of a call. We should limit the use list
inspection to value edges only. This is in preparation of eliding any
redundant {IfSuccess} control node.

R=jarin@chromium.org

Change-Id: I9bb4cc0e2e877976be55a894af972aa83d07d7d7
Reviewed-on: https://chromium-review.googlesource.com/450244Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43608}
parent 51e4e6c5
......@@ -681,12 +681,13 @@ void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer,
buffer->output_nodes.push_back(call);
} else {
buffer->output_nodes.resize(buffer->descriptor->ReturnCount(), nullptr);
for (auto use : call->uses()) {
if (use->opcode() != IrOpcode::kProjection) continue;
size_t const index = ProjectionIndexOf(use->op());
for (Edge const edge : call->use_edges()) {
if (!NodeProperties::IsValueEdge(edge)) continue;
DCHECK(edge.from()->opcode() == IrOpcode::kProjection);
size_t const index = ProjectionIndexOf(edge.from()->op());
DCHECK_LT(index, buffer->output_nodes.size());
DCHECK(!buffer->output_nodes[index]);
buffer->output_nodes[index] = use;
buffer->output_nodes[index] = edge.from();
}
}
......
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