Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: src/compiler/register-allocator.cc

Issue 1242303005: [turbofan]: Elide extra move when accessing stack or frame register (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: src/compiler/code-generator.cc Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/mips64/code-generator-mips64.cc ('k') | src/compiler/register-allocator-verifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/register-allocator.cc
diff --git a/src/compiler/register-allocator.cc b/src/compiler/register-allocator.cc
index 5bf858a86cf6e7551ce7a033603cc7c17990cbe2..3c775efdbc4f2d386745e2d6b0853fa34717b296 100644
--- a/src/compiler/register-allocator.cc
+++ b/src/compiler/register-allocator.cc
@@ -166,6 +166,8 @@ UsePositionHintType UsePosition::HintTypeForOperand(
switch (op.kind()) {
case InstructionOperand::CONSTANT:
case InstructionOperand::IMMEDIATE:
+ case InstructionOperand::STACK_POINTER:
+ case InstructionOperand::FRAME_POINTER:
return UsePositionHintType::kNone;
case InstructionOperand::UNALLOCATED:
return UsePositionHintType::kUnresolved;
@@ -1245,7 +1247,10 @@ void ConstraintBuilder::MeetConstraintsBefore(int instr_index) {
// Handle fixed input operands of second instruction.
for (size_t i = 0; i < second->InputCount(); i++) {
auto input = second->InputAt(i);
- if (input->IsImmediate()) continue; // Ignore immediates.
+ if (input->IsImmediate() || input->IsStackPointer() ||
+ input->IsFramePointer()) {
+ continue; // Ignore immediates and special registers
+ }
auto cur_input = UnallocatedOperand::cast(input);
if (cur_input->HasFixedPolicy()) {
int input_vreg = cur_input->virtual_register();
@@ -1518,7 +1523,10 @@ void LiveRangeBuilder::ProcessInstructions(const InstructionBlock* block,
for (size_t i = 0; i < instr->InputCount(); i++) {
auto input = instr->InputAt(i);
- if (input->IsImmediate()) continue; // Ignore immediates.
+ if (input->IsImmediate() || input->IsStackPointer() ||
+ input->IsFramePointer()) {
+ continue; // Ignore immediates and special registers
+ }
LifetimePosition use_pos;
if (input->IsUnallocated() &&
UnallocatedOperand::cast(input)->IsUsedAtStart()) {
« no previous file with comments | « src/compiler/mips64/code-generator-mips64.cc ('k') | src/compiler/register-allocator-verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698