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

Side by Side Diff: src/IceTargetLoweringX8664.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: 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
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLoweringX8664.cpp - x86-64 lowering -----------===// 1 //===- subzero/src/IceTargetLoweringX8664.cpp - x86-64 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 uint32_t LocalsSlotsAlignmentBytes = 0; 442 uint32_t LocalsSlotsAlignmentBytes = 0;
443 // The entire spill locations area gets aligned to largest natural 443 // The entire spill locations area gets aligned to largest natural
444 // alignment of the variables that have a spill slot. 444 // alignment of the variables that have a spill slot.
445 uint32_t SpillAreaAlignmentBytes = 0; 445 uint32_t SpillAreaAlignmentBytes = 0;
446 // A spill slot linked to a variable with a stack slot should reuse 446 // A spill slot linked to a variable with a stack slot should reuse
447 // that stack slot. 447 // that stack slot.
448 std::function<bool(Variable *)> TargetVarHook = 448 std::function<bool(Variable *)> TargetVarHook =
449 [&VariablesLinkedToSpillSlots](Variable *Var) { 449 [&VariablesLinkedToSpillSlots](Variable *Var) {
450 if (auto *SpillVar = 450 if (auto *SpillVar =
451 llvm::dyn_cast<typename Traits::SpillVariable>(Var)) { 451 llvm::dyn_cast<typename Traits::SpillVariable>(Var)) {
452 assert(Var->getWeight().isZero()); 452 assert(Var->mustNotHaveReg());
453 if (SpillVar->getLinkedTo() && !SpillVar->getLinkedTo()->hasReg()) { 453 if (SpillVar->getLinkedTo() && !SpillVar->getLinkedTo()->hasReg()) {
454 VariablesLinkedToSpillSlots.push_back(Var); 454 VariablesLinkedToSpillSlots.push_back(Var);
455 return true; 455 return true;
456 } 456 }
457 } 457 }
458 return false; 458 return false;
459 }; 459 };
460 460
461 // Compute the list of spilled variables and bounds for GlobalsSize, etc. 461 // Compute the list of spilled variables and bounds for GlobalsSize, etc.
462 getVarStackSlotParams(SortedSpilledVariables, RegsUsed, &GlobalsSize, 462 getVarStackSlotParams(SortedSpilledVariables, RegsUsed, &GlobalsSize,
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 // entries in case the high-level table has extra entries. 956 // entries in case the high-level table has extra entries.
957 #define X(tag, sizeLog2, align, elts, elty, str) \ 957 #define X(tag, sizeLog2, align, elts, elty, str) \
958 static_assert(_table1_##tag == _table2_##tag, \ 958 static_assert(_table1_##tag == _table2_##tag, \
959 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE"); 959 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE");
960 ICETYPE_TABLE 960 ICETYPE_TABLE
961 #undef X 961 #undef X
962 } // end of namespace dummy3 962 } // end of namespace dummy3
963 } // end of anonymous namespace 963 } // end of anonymous namespace
964 964
965 } // end of namespace Ice 965 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698