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

Side by Side Diff: src/IceRegAlloc.cpp

Issue 734053006: Subzero: Use std::vector<> instead of std::list for live range segments. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years 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/IceOperand.cpp ('k') | no next file » | 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/IceRegAlloc.cpp - Linear-scan implementation -----------===// 1 //===- subzero/src/IceRegAlloc.cpp - Linear-scan implementation -----------===//
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 // This file implements the LinearScan class, which performs the 10 // This file implements the LinearScan class, which performs the
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 void LinearScan::scan(const llvm::SmallBitVector &RegMaskFull) { 261 void LinearScan::scan(const llvm::SmallBitVector &RegMaskFull) {
262 TimerMarker T(TimerStack::TT_linearScan, Func); 262 TimerMarker T(TimerStack::TT_linearScan, Func);
263 assert(RegMaskFull.any()); // Sanity check 263 assert(RegMaskFull.any()); // Sanity check
264 Ostream &Str = Func->getContext()->getStrDump(); 264 Ostream &Str = Func->getContext()->getStrDump();
265 const bool Verbose = 265 const bool Verbose =
266 ALLOW_DUMP && Func->getContext()->isVerbose(IceV_LinearScan); 266 ALLOW_DUMP && Func->getContext()->isVerbose(IceV_LinearScan);
267 Func->resetCurrentNode(); 267 Func->resetCurrentNode();
268 VariablesMetadata *VMetadata = Func->getVMetadata(); 268 VariablesMetadata *VMetadata = Func->getVMetadata();
269 269
270 // Build a LiveRange representing the Kills list. 270 // Build a LiveRange representing the Kills list.
271 LiveRange KillsRange; 271 LiveRange KillsRange(Kills);
272 for (InstNumberT I : Kills)
273 KillsRange.addSegment(I, I);
274 KillsRange.untrim(); 272 KillsRange.untrim();
275 273
276 // RegUses[I] is the number of live ranges (variables) that register 274 // RegUses[I] is the number of live ranges (variables) that register
277 // I is currently assigned to. It can be greater than 1 as a result 275 // I is currently assigned to. It can be greater than 1 as a result
278 // of AllowOverlap inference below. 276 // of AllowOverlap inference below.
279 std::vector<int> RegUses(RegMaskFull.size()); 277 std::vector<int> RegUses(RegMaskFull.size());
280 // Unhandled is already set to all ranges in increasing order of 278 // Unhandled is already set to all ranges in increasing order of
281 // start points. 279 // start points.
282 assert(Active.empty()); 280 assert(Active.empty());
283 assert(Inactive.empty()); 281 assert(Inactive.empty());
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 Str << "\n"; 718 Str << "\n";
721 } 719 }
722 Str << "++++++ Inactive:\n"; 720 Str << "++++++ Inactive:\n";
723 for (const Variable *Item : Inactive) { 721 for (const Variable *Item : Inactive) {
724 dumpLiveRange(Item, Func); 722 dumpLiveRange(Item, Func);
725 Str << "\n"; 723 Str << "\n";
726 } 724 }
727 } 725 }
728 726
729 } // end of namespace Ice 727 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceOperand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698