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

Side by Side Diff: src/IceTargetLoweringX8632.cpp

Issue 1312433004: Weight variables by their number of uses for register allocation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Don't count a use if used as dest. Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 uint32_t LocalsSlotsAlignmentBytes = 0; 422 uint32_t LocalsSlotsAlignmentBytes = 0;
423 // The entire spill locations area gets aligned to largest natural 423 // The entire spill locations area gets aligned to largest natural
424 // alignment of the variables that have a spill slot. 424 // alignment of the variables that have a spill slot.
425 uint32_t SpillAreaAlignmentBytes = 0; 425 uint32_t SpillAreaAlignmentBytes = 0;
426 // A spill slot linked to a variable with a stack slot should reuse 426 // A spill slot linked to a variable with a stack slot should reuse
427 // that stack slot. 427 // that stack slot.
428 std::function<bool(Variable *)> TargetVarHook = 428 std::function<bool(Variable *)> TargetVarHook =
429 [&VariablesLinkedToSpillSlots](Variable *Var) { 429 [&VariablesLinkedToSpillSlots](Variable *Var) {
430 if (auto *SpillVar = 430 if (auto *SpillVar =
431 llvm::dyn_cast<typename Traits::SpillVariable>(Var)) { 431 llvm::dyn_cast<typename Traits::SpillVariable>(Var)) {
432 assert(Var->getWeight().isZero()); 432 assert(Var->mustNotHaveReg());
433 if (SpillVar->getLinkedTo() && !SpillVar->getLinkedTo()->hasReg()) { 433 if (SpillVar->getLinkedTo() && !SpillVar->getLinkedTo()->hasReg()) {
434 VariablesLinkedToSpillSlots.push_back(Var); 434 VariablesLinkedToSpillSlots.push_back(Var);
435 return true; 435 return true;
436 } 436 }
437 } 437 }
438 return false; 438 return false;
439 }; 439 };
440 440
441 // Compute the list of spilled variables and bounds for GlobalsSize, etc. 441 // Compute the list of spilled variables and bounds for GlobalsSize, etc.
442 getVarStackSlotParams(SortedSpilledVariables, RegsUsed, &GlobalsSize, 442 getVarStackSlotParams(SortedSpilledVariables, RegsUsed, &GlobalsSize,
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 // entries in case the high-level table has extra entries. 948 // entries in case the high-level table has extra entries.
949 #define X(tag, sizeLog2, align, elts, elty, str) \ 949 #define X(tag, sizeLog2, align, elts, elty, str) \
950 static_assert(_table1_##tag == _table2_##tag, \ 950 static_assert(_table1_##tag == _table2_##tag, \
951 "Inconsistency between ICETYPEX8632_TABLE and ICETYPE_TABLE"); 951 "Inconsistency between ICETYPEX8632_TABLE and ICETYPE_TABLE");
952 ICETYPE_TABLE 952 ICETYPE_TABLE
953 #undef X 953 #undef X
954 } // end of namespace dummy3 954 } // end of namespace dummy3
955 } // end of anonymous namespace 955 } // end of anonymous namespace
956 956
957 } // end of namespace Ice 957 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698