Commit 4fb20c97 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[instruction-selector-x64] Fix bug in instruction selector

A node short-cutting optimization was not updating uses correctly. This
fix makes sure that there are no other users of the node, thus making the
use update unnecessary.

This fix might have negative performance implications.

Change-Id: Ie9bd23caf4434eb2137e111dc5e7c143fd97521c
Reviewed-on: https://chromium-review.googlesource.com/c/1299019
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57001}
parent a34ef5cf
......@@ -1671,10 +1671,15 @@ void VisitWordCompare(InstructionSelector* selector, Node* node,
// The 32-bit comparisons automatically truncate Word64
// values to Word32 range, no need to do that explicitly.
if (opcode == kX64Cmp32 || opcode == kX64Test32) {
while (left->opcode() == IrOpcode::kTruncateInt64ToInt32) {
if (left->opcode() == IrOpcode::kTruncateInt64ToInt32 &&
selector->CanCover(node, left) &&
selector->CanCover(left, left->InputAt(0))) {
left = left->InputAt(0);
}
while (right->opcode() == IrOpcode::kTruncateInt64ToInt32) {
if (right->opcode() == IrOpcode::kTruncateInt64ToInt32 &&
selector->CanCover(node, right) &&
selector->CanCover(right, right->InputAt(0))) {
right = right->InputAt(0);
}
}
......
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