Commit 1a77a9f4 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[turbofan] Teach the LoopVariableOptimizer about ToNumber.

Bug: chromium:819298, chromium:820729
Change-Id: I3a1bccfe889ca409085396e2e1c4ae991093d0ea
Reviewed-on: https://chromium-review.googlesource.com/960321
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51910}
parent 49a1a9a4
......@@ -239,7 +239,12 @@ InductionVariable* LoopVariableOptimizer::TryGetInductionVariable(Node* phi) {
}
// TODO(jarin) Support both sides.
if (arith->InputAt(0) != phi) return nullptr;
Node* input = arith->InputAt(0);
if (input->opcode() == IrOpcode::kSpeculativeToNumber ||
input->opcode() == IrOpcode::kJSToNumber) {
input = input->InputAt(0);
}
if (input != phi) return nullptr;
Node* effect_phi = nullptr;
for (Node* use : loop->uses()) {
......
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