Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 // This file implements the TargetLoweringX8632 class, which | 10 // This file implements the TargetLoweringX8632 class, which |
| (...skipping 2503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2514 Reg->setWeightInfinite(); | 2514 Reg->setWeightInfinite(); |
| 2515 else | 2515 else |
| 2516 Reg->setRegNum(RegNum); | 2516 Reg->setRegNum(RegNum); |
| 2517 return Reg; | 2517 return Reg; |
| 2518 } | 2518 } |
| 2519 | 2519 |
| 2520 void TargetX8632::postLower() { | 2520 void TargetX8632::postLower() { |
| 2521 if (Ctx->getOptLevel() != Opt_m1) | 2521 if (Ctx->getOptLevel() != Opt_m1) |
| 2522 return; | 2522 return; |
| 2523 // TODO: Avoid recomputing WhiteList every instruction. | 2523 // TODO: Avoid recomputing WhiteList every instruction. |
| 2524 llvm::SmallBitVector WhiteList = getRegisterSet(RegSet_All, RegSet_None); | 2524 RegSetMask RegInclude = RegSet_All; |
| 2525 RegSetMask RegExclude = RegSet_None | RegSet_StackPointer; | |
|
Jim Stichnoth
2014/07/02 23:03:36
Could probably just use
RegSetMask RegExclude =
Jim Stichnoth
2014/07/02 23:23:44
Actually, it would be even better to use RegSet_No
jvoung (off chromium)
2014/07/02 23:43:38
Okay so the idea is mark esp as a non-int register
| |
| 2526 if (hasFramePointer()) | |
| 2527 RegExclude |= RegSet_FramePointer; | |
| 2528 llvm::SmallBitVector WhiteList = getRegisterSet(RegInclude, RegExclude); | |
| 2525 // Make one pass to black-list pre-colored registers. TODO: If | 2529 // Make one pass to black-list pre-colored registers. TODO: If |
| 2526 // there was some prior register allocation pass that made register | 2530 // there was some prior register allocation pass that made register |
| 2527 // assignments, those registers need to be black-listed here as | 2531 // assignments, those registers need to be black-listed here as |
| 2528 // well. | 2532 // well. |
| 2529 for (InstList::iterator I = Context.getCur(), E = Context.getEnd(); I != E; | 2533 for (InstList::iterator I = Context.getCur(), E = Context.getEnd(); I != E; |
| 2530 ++I) { | 2534 ++I) { |
| 2531 const Inst *Inst = *I; | 2535 const Inst *Inst = *I; |
| 2532 if (Inst->isDeleted()) | 2536 if (Inst->isDeleted()) |
| 2533 continue; | 2537 continue; |
| 2534 if (llvm::isa<InstFakeKill>(Inst)) | 2538 if (llvm::isa<InstFakeKill>(Inst)) |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2681 for (SizeT i = 0; i < Size; ++i) { | 2685 for (SizeT i = 0; i < Size; ++i) { |
| 2682 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n"; | 2686 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n"; |
| 2683 } | 2687 } |
| 2684 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; | 2688 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; |
| 2685 } | 2689 } |
| 2686 Str << "\t" << (IsInternal ? ".local" : ".global") << "\t" << MangledName | 2690 Str << "\t" << (IsInternal ? ".local" : ".global") << "\t" << MangledName |
| 2687 << "\n"; | 2691 << "\n"; |
| 2688 } | 2692 } |
| 2689 | 2693 |
| 2690 } // end of namespace Ice | 2694 } // end of namespace Ice |
| OLD | NEW |