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

Side by Side Diff: src/IceTargetLowering.cpp

Issue 1448773002: Subzero: Do some cleanup on the regalloc code. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix conditional Created 5 years, 1 month 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/IceRegAlloc.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/IceTargetLowering.cpp - Basic lowering implementation --===// 1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering 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 /// \file 10 /// \file
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 RegExclude |= RegSet_FramePointer; 286 RegExclude |= RegSet_FramePointer;
287 llvm::SmallBitVector RegMask = getRegisterSet(RegInclude, RegExclude); 287 llvm::SmallBitVector RegMask = getRegisterSet(RegInclude, RegExclude);
288 bool Repeat = (Kind == RAK_Global && Ctx->getFlags().shouldRepeatRegAlloc()); 288 bool Repeat = (Kind == RAK_Global && Ctx->getFlags().shouldRepeatRegAlloc());
289 do { 289 do {
290 LinearScan.init(Kind); 290 LinearScan.init(Kind);
291 LinearScan.scan(RegMask, Ctx->getFlags().shouldRandomizeRegAlloc()); 291 LinearScan.scan(RegMask, Ctx->getFlags().shouldRandomizeRegAlloc());
292 if (!LinearScan.hasEvictions()) 292 if (!LinearScan.hasEvictions())
293 Repeat = false; 293 Repeat = false;
294 Kind = RAK_SecondChance; 294 Kind = RAK_SecondChance;
295 } while (Repeat); 295 } while (Repeat);
296 // TODO(stichnot): Run the register allocator one more time to do stack slot
297 // coalescing. The idea would be to initialize the Unhandled list with the
298 // set of Variables that have no register and a non-empty live range, and
299 // model an infinite number of registers. Maybe use the register aliasing
300 // mechanism to get better packing of narrower slots.
296 } 301 }
297 302
298 void TargetLowering::markRedefinitions() { 303 void TargetLowering::markRedefinitions() {
299 // Find (non-SSA) instructions where the Dest variable appears in some source 304 // Find (non-SSA) instructions where the Dest variable appears in some source
300 // operand, and set the IsDestRedefined flag to keep liveness analysis 305 // operand, and set the IsDestRedefined flag to keep liveness analysis
301 // consistent. 306 // consistent.
302 for (auto Inst = Context.getCur(), E = Context.getNext(); Inst != E; ++Inst) { 307 for (auto Inst = Context.getCur(), E = Context.getNext(); Inst != E; ++Inst) {
303 if (Inst->isDeleted()) 308 if (Inst->isDeleted())
304 continue; 309 continue;
305 Variable *Dest = Inst->getDest(); 310 Variable *Dest = Inst->getDest();
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 if (Target == Target_##X) \ 648 if (Target == Target_##X) \
644 return TargetHeader##X::create(Ctx); 649 return TargetHeader##X::create(Ctx);
645 #include "llvm/Config/SZTargets.def" 650 #include "llvm/Config/SZTargets.def"
646 651
647 llvm::report_fatal_error("Unsupported target header lowering"); 652 llvm::report_fatal_error("Unsupported target header lowering");
648 } 653 }
649 654
650 TargetHeaderLowering::~TargetHeaderLowering() = default; 655 TargetHeaderLowering::~TargetHeaderLowering() = default;
651 656
652 } // end of namespace Ice 657 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceRegAlloc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698