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 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 } | 708 } |
709 } | 709 } |
710 } | 710 } |
711 } | 711 } |
712 | 712 |
713 void TargetLowering::addFakeDefUses(const Inst *Instr) { | 713 void TargetLowering::addFakeDefUses(const Inst *Instr) { |
714 FOREACH_VAR_IN_INST(Var, *Instr) { | 714 FOREACH_VAR_IN_INST(Var, *Instr) { |
715 if (auto *Var64 = llvm::dyn_cast<Variable64On32>(Var)) { | 715 if (auto *Var64 = llvm::dyn_cast<Variable64On32>(Var)) { |
716 Context.insert<InstFakeUse>(Var64->getLo()); | 716 Context.insert<InstFakeUse>(Var64->getLo()); |
717 Context.insert<InstFakeUse>(Var64->getHi()); | 717 Context.insert<InstFakeUse>(Var64->getHi()); |
| 718 } else if (auto *VarVec = llvm::dyn_cast<VariableVecOn32>(Var)) { |
| 719 for (Variable *Var : VarVec->getContainers()) { |
| 720 Context.insert<InstFakeUse>(Var); |
| 721 } |
718 } else { | 722 } else { |
719 Context.insert<InstFakeUse>(Var); | 723 Context.insert<InstFakeUse>(Var); |
720 } | 724 } |
721 } | 725 } |
722 Variable *Dest = Instr->getDest(); | 726 Variable *Dest = Instr->getDest(); |
723 if (Dest == nullptr) | 727 if (Dest == nullptr) |
724 return; | 728 return; |
725 if (auto *Var64 = llvm::dyn_cast<Variable64On32>(Dest)) { | 729 if (auto *Var64 = llvm::dyn_cast<Variable64On32>(Dest)) { |
726 Context.insert<InstFakeDef>(Var64->getLo()); | 730 Context.insert<InstFakeDef>(Var64->getLo()); |
727 Context.insert<InstFakeDef>(Var64->getHi()); | 731 Context.insert<InstFakeDef>(Var64->getHi()); |
| 732 } else if (auto *VarVec = llvm::dyn_cast<VariableVecOn32>(Dest)) { |
| 733 for (Variable *Var : VarVec->getContainers()) { |
| 734 Context.insert<InstFakeDef>(Var); |
| 735 } |
728 } else { | 736 } else { |
729 Context.insert<InstFakeDef>(Dest); | 737 Context.insert<InstFakeDef>(Dest); |
730 } | 738 } |
731 } | 739 } |
732 | 740 |
733 void TargetLowering::sortVarsByAlignment(VarList &Dest, | 741 void TargetLowering::sortVarsByAlignment(VarList &Dest, |
734 const VarList &Source) const { | 742 const VarList &Source) const { |
735 Dest = Source; | 743 Dest = Source; |
736 // Instead of std::sort, we could do a bucket sort with log2(alignment) as | 744 // Instead of std::sort, we could do a bucket sort with log2(alignment) as |
737 // the buckets, if performance is an issue. | 745 // the buckets, if performance is an issue. |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 case TARGET_LOWERING_CLASS_FOR(X): \ | 1099 case TARGET_LOWERING_CLASS_FOR(X): \ |
1092 return ::X::createTargetHeaderLowering(Ctx); | 1100 return ::X::createTargetHeaderLowering(Ctx); |
1093 #include "SZTargets.def" | 1101 #include "SZTargets.def" |
1094 #undef SUBZERO_TARGET | 1102 #undef SUBZERO_TARGET |
1095 } | 1103 } |
1096 } | 1104 } |
1097 | 1105 |
1098 TargetHeaderLowering::~TargetHeaderLowering() = default; | 1106 TargetHeaderLowering::~TargetHeaderLowering() = default; |
1099 | 1107 |
1100 } // end of namespace Ice | 1108 } // end of namespace Ice |
OLD | NEW |