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

Unified Diff: src/compiler/register-allocator-verifier.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/register-allocator-verifier.h ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/register-allocator-verifier.cc
diff --git a/src/compiler/register-allocator-verifier.cc b/src/compiler/register-allocator-verifier.cc
index f23d24433f8dcfea5e1c45f1556046f20794af16..7272bc8b0faa49e5a2b322c164253923bb0b4cc8 100644
--- a/src/compiler/register-allocator-verifier.cc
+++ b/src/compiler/register-allocator-verifier.cc
@@ -48,7 +48,8 @@ void VerifyAllocatedGaps(const Instruction* instr) {
void RegisterAllocatorVerifier::VerifyInput(
const OperandConstraint& constraint) {
CHECK_NE(kSameAsFirst, constraint.type_);
- if (constraint.type_ != kImmediate) {
+ if (constraint.type_ != kImmediate &&
+ constraint.type_ != kStandardFrameRegister) {
CHECK_NE(InstructionOperand::kInvalidVirtualRegister,
constraint.virtual_register_);
}
@@ -149,6 +150,8 @@ void RegisterAllocatorVerifier::BuildConstraint(const InstructionOperand* op,
: imm->indexed_value();
constraint->type_ = kImmediate;
constraint->value_ = value;
+ } else if (op->IsStackPointer() || op->IsFramePointer()) {
+ constraint->type_ = kStandardFrameRegister;
} else {
CHECK(op->IsUnallocated());
const auto* unallocated = UnallocatedOperand::cast(op);
@@ -217,6 +220,8 @@ void RegisterAllocatorVerifier::CheckConstraint(
CHECK_EQ(value, constraint->value_);
return;
}
+ case kStandardFrameRegister:
+ return;
case kRegister:
CHECK(op->IsRegister());
return;
@@ -680,7 +685,9 @@ void RegisterAllocatorVerifier::VerifyGapMoves(BlockMaps* block_maps,
const auto op_constraints = instr_constraint.operand_constraints_;
size_t count = 0;
for (size_t i = 0; i < instr->InputCount(); ++i, ++count) {
- if (op_constraints[count].type_ == kImmediate) continue;
+ if (op_constraints[count].type_ == kImmediate ||
+ op_constraints[count].type_ == kStandardFrameRegister)
+ continue;
int virtual_register = op_constraints[count].virtual_register_;
auto op = instr->InputAt(i);
if (!block_maps->IsPhi(virtual_register)) {
« no previous file with comments | « src/compiler/register-allocator-verifier.h ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698