Commit d4177d11 authored by Kanghua Yu's avatar Kanghua Yu Committed by Commit Bot

[turbofan][x64] Reduce reg-to-reg moving instruction for LoadRootsRegister IR

This results in a roughly 10KB reduction in snapshot_blob.bin on x64.

Change-Id: I72aab2db4e3b2a896f624c3c2afc1ac2e9610e23
Reviewed-on: https://chromium-review.googlesource.com/981911Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Kanghua Yu <kanghua.yu@intel.com>
Cr-Commit-Position: refs/heads/master@{#52264}
parent 41aad4bc
......@@ -178,6 +178,17 @@ class X64OperandGenerator final : public OperandGenerator {
}
}
}
if (operand->InputCount() == 2) {
Node* left = operand->InputAt(0);
Node* right = operand->InputAt(1);
if (left->opcode() == IrOpcode::kLoadRootsPointer &&
right->opcode() == IrOpcode::kInt64Constant) {
int64_t offset = OpParameter<int64_t>(right->op());
DCHECK(is_int32(offset));
inputs[(*input_count)++] = TempImmediate(static_cast<int32_t>(offset));
return kMode_Root;
}
}
BaseWithIndexAndDisplacement64Matcher m(operand, AddressOption::kAllowAll);
DCHECK(m.matches());
if (m.displacement() == nullptr || CanBeImmediate(m.displacement())) {
......
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