Commit 498be7bd authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[x64] Remove TruncateInt64ToInt32 before ChangeInt32ToInt64

There is no need to truncate if we are going to extend it again.

At first glance it looks like we can eliminate both steps but
unfortunately the Change is still needed since it will write on the
top bits.

Change-Id: I06d9776384a76f7b2a4454a9176926b3bcef2f2a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2010111Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65886}
parent 5a05383a
......@@ -1243,6 +1243,12 @@ void InstructionSelector::VisitBitcastWord32ToWord64(Node* node) {
}
void InstructionSelector::VisitChangeInt32ToInt64(Node* node) {
DCHECK_EQ(node->InputCount(), 1);
Node* input = node->InputAt(0);
if (input->opcode() == IrOpcode::kTruncateInt64ToInt32) {
node->ReplaceInput(0, input->InputAt(0));
}
X64OperandGenerator g(this);
Node* const value = node->InputAt(0);
if (value->opcode() == IrOpcode::kLoad && CanCover(node, value)) {
......
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