OLD | NEW |
1 //===- subzero/src/IceTargetLoweringX8632.h - x86-32 lowering ---*- C++ -*-===// | 1 //===- subzero/src/IceTargetLoweringX8632.h - x86-32 lowering ---*- C++ -*-===// |
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 declares the TargetLoweringX8632 class, which | 10 // This file declares the TargetLoweringX8632 class, which |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 class TargetX8632 : public TargetLowering { | 94 class TargetX8632 : public TargetLowering { |
95 TargetX8632() = delete; | 95 TargetX8632() = delete; |
96 TargetX8632(const TargetX8632 &) = delete; | 96 TargetX8632(const TargetX8632 &) = delete; |
97 TargetX8632 &operator=(const TargetX8632 &) = delete; | 97 TargetX8632 &operator=(const TargetX8632 &) = delete; |
98 | 98 |
99 public: | 99 public: |
100 static TargetX8632 *create(Cfg *Func) { return new TargetX8632(Func); } | 100 static TargetX8632 *create(Cfg *Func) { return new TargetX8632(Func); } |
101 | 101 |
102 void translateOm1() override; | 102 void translateOm1() override; |
103 void translateO2() override; | 103 void translateO2() override; |
| 104 void doLoadOpt(); |
104 bool doBranchOpt(Inst *I, const CfgNode *NextNode) override; | 105 bool doBranchOpt(Inst *I, const CfgNode *NextNode) override; |
105 | 106 |
106 SizeT getNumRegisters() const override { return RegX8632::Reg_NUM; } | 107 SizeT getNumRegisters() const override { return RegX8632::Reg_NUM; } |
107 Variable *getPhysicalRegister(SizeT RegNum, Type Ty = IceType_void) override; | 108 Variable *getPhysicalRegister(SizeT RegNum, Type Ty = IceType_void) override; |
108 IceString getRegName(SizeT RegNum, Type Ty) const override; | 109 IceString getRegName(SizeT RegNum, Type Ty) const override; |
109 llvm::SmallBitVector getRegisterSet(RegSetMask Include, | 110 llvm::SmallBitVector getRegisterSet(RegSetMask Include, |
110 RegSetMask Exclude) const override; | 111 RegSetMask Exclude) const override; |
111 const llvm::SmallBitVector &getRegisterSetForType(Type Ty) const override { | 112 const llvm::SmallBitVector &getRegisterSetForType(Type Ty) const override { |
112 return TypeToRegisterSet[Ty]; | 113 return TypeToRegisterSet[Ty]; |
113 } | 114 } |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 }; | 223 }; |
223 typedef uint32_t LegalMask; | 224 typedef uint32_t LegalMask; |
224 Operand *legalize(Operand *From, LegalMask Allowed = Legal_All, | 225 Operand *legalize(Operand *From, LegalMask Allowed = Legal_All, |
225 int32_t RegNum = Variable::NoRegister); | 226 int32_t RegNum = Variable::NoRegister); |
226 Variable *legalizeToVar(Operand *From, int32_t RegNum = Variable::NoRegister); | 227 Variable *legalizeToVar(Operand *From, int32_t RegNum = Variable::NoRegister); |
227 // Legalize the first source operand for use in the cmp instruction. | 228 // Legalize the first source operand for use in the cmp instruction. |
228 Operand *legalizeSrc0ForCmp(Operand *Src0, Operand *Src1); | 229 Operand *legalizeSrc0ForCmp(Operand *Src0, Operand *Src1); |
229 // Turn a pointer operand into a memory operand that can be | 230 // Turn a pointer operand into a memory operand that can be |
230 // used by a real load/store operation. Legalizes the operand as well. | 231 // used by a real load/store operation. Legalizes the operand as well. |
231 // This is a nop if the operand is already a legal memory operand. | 232 // This is a nop if the operand is already a legal memory operand. |
232 OperandX8632Mem *formMemoryOperand(Operand *Ptr, Type Ty); | 233 OperandX8632Mem *formMemoryOperand(Operand *Ptr, Type Ty, |
| 234 bool DoLegalize = true); |
233 | 235 |
234 Variable *makeReg(Type Ty, int32_t RegNum = Variable::NoRegister); | 236 Variable *makeReg(Type Ty, int32_t RegNum = Variable::NoRegister); |
235 static Type stackSlotType(); | 237 static Type stackSlotType(); |
236 | 238 |
237 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); | 239 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); |
238 | 240 |
239 // Returns a vector in a register with the given constant entries. | 241 // Returns a vector in a register with the given constant entries. |
240 Variable *makeVectorOfZeros(Type Ty, int32_t RegNum = Variable::NoRegister); | 242 Variable *makeVectorOfZeros(Type Ty, int32_t RegNum = Variable::NoRegister); |
241 Variable *makeVectorOfOnes(Type Ty, int32_t RegNum = Variable::NoRegister); | 243 Variable *makeVectorOfOnes(Type Ty, int32_t RegNum = Variable::NoRegister); |
242 Variable *makeVectorOfMinusOnes(Type Ty, | 244 Variable *makeVectorOfMinusOnes(Type Ty, |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 | 593 |
592 private: | 594 private: |
593 void lowerGlobal(const VariableDeclaration &Var) const; | 595 void lowerGlobal(const VariableDeclaration &Var) const; |
594 ~TargetDataX8632() override {} | 596 ~TargetDataX8632() override {} |
595 template <typename T> static void emitConstantPool(GlobalContext *Ctx); | 597 template <typename T> static void emitConstantPool(GlobalContext *Ctx); |
596 }; | 598 }; |
597 | 599 |
598 } // end of namespace Ice | 600 } // end of namespace Ice |
599 | 601 |
600 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 602 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
OLD | NEW |