OLD | NEW |
---|---|
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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
356 // function. In that case, basic blocks may be revisited, and variables local | 356 // function. In that case, basic blocks may be revisited, and variables local |
357 // to those basic blocks are actually live until after the called function | 357 // to those basic blocks are actually live until after the called function |
358 // returns a second time. | 358 // returns a second time. |
359 const bool SimpleCoalescing = !callsReturnsTwice(); | 359 const bool SimpleCoalescing = !callsReturnsTwice(); |
360 | 360 |
361 std::vector<size_t> LocalsSize(Func->getNumNodes()); | 361 std::vector<size_t> LocalsSize(Func->getNumNodes()); |
362 const VarList &Variables = Func->getVariables(); | 362 const VarList &Variables = Func->getVariables(); |
363 VarList SpilledVariables; | 363 VarList SpilledVariables; |
364 for (Variable *Var : Variables) { | 364 for (Variable *Var : Variables) { |
365 if (Var->hasReg()) { | 365 if (Var->hasReg()) { |
366 RegsUsed[Var->getRegNum()] = true; | 366 // Rematerializable uses of stack/frame do not count as uses for spilling. |
Jim Stichnoth
2015/11/16 22:47:18
stack/frame pointer
| |
367 if (!Var->isRematerializable()) | |
368 RegsUsed[Var->getRegNum()] = true; | |
367 continue; | 369 continue; |
368 } | 370 } |
369 // An argument either does not need a stack slot (if passed in a register) | 371 // An argument either does not need a stack slot (if passed in a register) |
370 // or already has one (if passed on the stack). | 372 // or already has one (if passed on the stack). |
371 if (Var->getIsArg()) | 373 if (Var->getIsArg()) |
372 continue; | 374 continue; |
373 // An unreferenced variable doesn't need a stack slot. | 375 // An unreferenced variable doesn't need a stack slot. |
374 if (!IsVarReferenced[Var->getIndex()]) | 376 if (!IsVarReferenced[Var->getIndex()]) |
375 continue; | 377 continue; |
376 // Check a target-specific variable (it may end up sharing stack slots) and | 378 // Check a target-specific variable (it may end up sharing stack slots) and |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
643 if (Target == Target_##X) \ | 645 if (Target == Target_##X) \ |
644 return TargetHeader##X::create(Ctx); | 646 return TargetHeader##X::create(Ctx); |
645 #include "llvm/Config/SZTargets.def" | 647 #include "llvm/Config/SZTargets.def" |
646 | 648 |
647 llvm::report_fatal_error("Unsupported target header lowering"); | 649 llvm::report_fatal_error("Unsupported target header lowering"); |
648 } | 650 } |
649 | 651 |
650 TargetHeaderLowering::~TargetHeaderLowering() = default; | 652 TargetHeaderLowering::~TargetHeaderLowering() = default; |
651 | 653 |
652 } // end of namespace Ice | 654 } // end of namespace Ice |
OLD | NEW |