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

Unified Diff: src/compiler/instruction-selector-impl.h

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/instruction.cc ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector-impl.h
diff --git a/src/compiler/instruction-selector-impl.h b/src/compiler/instruction-selector-impl.h
index b34a914efcca285a4a80aa6470be2b16a7d8893b..0dde2a4e6c4e405d0edad075ce390eb2f0cc83e6 100644
--- a/src/compiler/instruction-selector-impl.h
+++ b/src/compiler/instruction-selector-impl.h
@@ -75,15 +75,29 @@ class OperandGenerator {
}
InstructionOperand Use(Node* node) {
- return Use(node, UnallocatedOperand(UnallocatedOperand::NONE,
- UnallocatedOperand::USED_AT_START,
- GetVReg(node)));
+ IrOpcode::Value opcode = node->opcode();
+ if (opcode == IrOpcode::kLoadFramePointer) {
+ return FramePointerOperand();
+ } else if (opcode == IrOpcode::kLoadStackPointer) {
+ return StackPointerOperand();
+ } else {
+ return Use(node, UnallocatedOperand(UnallocatedOperand::NONE,
+ UnallocatedOperand::USED_AT_START,
+ GetVReg(node)));
+ }
}
InstructionOperand UseRegister(Node* node) {
- return Use(node, UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER,
- UnallocatedOperand::USED_AT_START,
- GetVReg(node)));
+ IrOpcode::Value opcode = node->opcode();
+ if (opcode == IrOpcode::kLoadFramePointer) {
+ return FramePointerOperand();
+ } else if (opcode == IrOpcode::kLoadStackPointer) {
+ return StackPointerOperand();
+ } else {
+ return Use(node, UnallocatedOperand(
+ UnallocatedOperand::MUST_HAVE_REGISTER,
+ UnallocatedOperand::USED_AT_START, GetVReg(node)));
+ }
}
InstructionOperand UseUniqueSlot(Node* node) {
« no previous file with comments | « src/compiler/instruction.cc ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698