Commit 1debc0ca authored by Manos Koukoutos's avatar Manos Koukoutos Committed by Commit Bot

[wasm] Remove dead branch from PrepareForLoop

The code already checks wether decoder.failed(), so checking whether
AnalyzeLoopAssignment returned null is redundant.

Change-Id: Ia6e8b22011b28c76974aca8a6119466fe343079e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2492329Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70728}
parent 9586aa1f
......@@ -1085,33 +1085,20 @@ class WasmGraphBuildingInterface {
BitVector* assigned = WasmDecoder<validate>::AnalyzeLoopAssignment(
decoder, decoder->pc(), decoder->num_locals() + 1, decoder->zone());
if (decoder->failed()) return;
if (assigned != nullptr) {
// Only introduce phis for variables assigned in this loop.
int instance_cache_index = decoder->num_locals();
for (int i = decoder->num_locals() - 1; i >= 0; i--) {
if (!assigned->Contains(i)) continue;
TFNode* inputs[] = {ssa_env_->locals[i], control()};
ssa_env_->locals[i] = builder_->Phi(decoder->local_type(i), 1, inputs);
}
// Introduce phis for instance cache pointers if necessary.
if (assigned->Contains(instance_cache_index)) {
builder_->PrepareInstanceCacheForLoop(&ssa_env_->instance_cache,
control());
}
DCHECK_NOT_NULL(assigned);
SetEnv(Split(decoder->zone(), ssa_env_));
builder_->StackCheck(decoder->position());
return;
}
// Conservatively introduce phis for all local variables.
// Only introduce phis for variables assigned in this loop.
int instance_cache_index = decoder->num_locals();
for (int i = decoder->num_locals() - 1; i >= 0; i--) {
if (!assigned->Contains(i)) continue;
TFNode* inputs[] = {ssa_env_->locals[i], control()};
ssa_env_->locals[i] = builder_->Phi(decoder->local_type(i), 1, inputs);
}
// Conservatively introduce phis for instance cache.
builder_->PrepareInstanceCacheForLoop(&ssa_env_->instance_cache, control());
// Introduce phis for instance cache pointers if necessary.
if (assigned->Contains(instance_cache_index)) {
builder_->PrepareInstanceCacheForLoop(&ssa_env_->instance_cache,
control());
}
SetEnv(Split(decoder->zone(), ssa_env_));
builder_->StackCheck(decoder->position());
......
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