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 |
11 /// \brief Implements the skeleton of the TargetLowering class. | 11 /// \brief Implements the skeleton of the TargetLowering class. |
12 /// | 12 /// |
13 /// Specifically this invokes the appropriate lowering method for a given | 13 /// Specifically this invokes the appropriate lowering method for a given |
14 /// instruction kind and driving global register allocation. It also implements | 14 /// instruction kind and driving global register allocation. It also implements |
15 /// the non-deleted instruction iteration in LoweringContext. | 15 /// the non-deleted instruction iteration in LoweringContext. |
16 /// | 16 /// |
17 //===----------------------------------------------------------------------===// | 17 //===----------------------------------------------------------------------===// |
18 | 18 |
19 #include "IceTargetLowering.h" | 19 #include "IceTargetLowering.h" |
20 | 20 |
| 21 #include "IceBitVector.h" |
21 #include "IceCfg.h" // setError() | 22 #include "IceCfg.h" // setError() |
22 #include "IceCfgNode.h" | 23 #include "IceCfgNode.h" |
23 #include "IceGlobalContext.h" | 24 #include "IceGlobalContext.h" |
24 #include "IceGlobalInits.h" | 25 #include "IceGlobalInits.h" |
25 #include "IceInstVarIter.h" | 26 #include "IceInstVarIter.h" |
26 #include "IceOperand.h" | 27 #include "IceOperand.h" |
27 #include "IceRegAlloc.h" | 28 #include "IceRegAlloc.h" |
28 | 29 |
29 // We prevent target-specific implementation details from leaking outside their | 30 // We prevent target-specific implementation details from leaking outside their |
30 // implementations by forbidding #include of target-specific header files | 31 // implementations by forbidding #include of target-specific header files |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 typeWidthInBytesOnStack(V2->getType()); | 537 typeWidthInBytesOnStack(V2->getType()); |
537 }); | 538 }); |
538 } | 539 } |
539 | 540 |
540 void TargetLowering::getVarStackSlotParams( | 541 void TargetLowering::getVarStackSlotParams( |
541 VarList &SortedSpilledVariables, SmallBitVector &RegsUsed, | 542 VarList &SortedSpilledVariables, SmallBitVector &RegsUsed, |
542 size_t *GlobalsSize, size_t *SpillAreaSizeBytes, | 543 size_t *GlobalsSize, size_t *SpillAreaSizeBytes, |
543 uint32_t *SpillAreaAlignmentBytes, uint32_t *LocalsSlotsAlignmentBytes, | 544 uint32_t *SpillAreaAlignmentBytes, uint32_t *LocalsSlotsAlignmentBytes, |
544 std::function<bool(Variable *)> TargetVarHook) { | 545 std::function<bool(Variable *)> TargetVarHook) { |
545 const VariablesMetadata *VMetadata = Func->getVMetadata(); | 546 const VariablesMetadata *VMetadata = Func->getVMetadata(); |
546 llvm::BitVector IsVarReferenced(Func->getNumVariables()); | 547 BitVector IsVarReferenced(Func->getNumVariables()); |
547 for (CfgNode *Node : Func->getNodes()) { | 548 for (CfgNode *Node : Func->getNodes()) { |
548 for (Inst &Instr : Node->getInsts()) { | 549 for (Inst &Instr : Node->getInsts()) { |
549 if (Instr.isDeleted()) | 550 if (Instr.isDeleted()) |
550 continue; | 551 continue; |
551 if (const Variable *Var = Instr.getDest()) | 552 if (const Variable *Var = Instr.getDest()) |
552 IsVarReferenced[Var->getIndex()] = true; | 553 IsVarReferenced[Var->getIndex()] = true; |
553 FOREACH_VAR_IN_INST(Var, Instr) { | 554 FOREACH_VAR_IN_INST(Var, Instr) { |
554 IsVarReferenced[Var->getIndex()] = true; | 555 IsVarReferenced[Var->getIndex()] = true; |
555 } | 556 } |
556 } | 557 } |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 case Target_##X: \ | 884 case Target_##X: \ |
884 return ::X::createTargetHeaderLowering(Ctx); | 885 return ::X::createTargetHeaderLowering(Ctx); |
885 #include "llvm/Config/SZTargets.def" | 886 #include "llvm/Config/SZTargets.def" |
886 #undef SUBZERO_TARGET | 887 #undef SUBZERO_TARGET |
887 } | 888 } |
888 } | 889 } |
889 | 890 |
890 TargetHeaderLowering::~TargetHeaderLowering() = default; | 891 TargetHeaderLowering::~TargetHeaderLowering() = default; |
891 | 892 |
892 } // end of namespace Ice | 893 } // end of namespace Ice |
OLD | NEW |