OLD | NEW |
1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===// | 1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- 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 /// \file | 10 /// \file |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 virtual RegNumT getFrameOrStackReg() const = 0; | 249 virtual RegNumT getFrameOrStackReg() const = 0; |
250 virtual size_t typeWidthInBytesOnStack(Type Ty) const = 0; | 250 virtual size_t typeWidthInBytesOnStack(Type Ty) const = 0; |
251 virtual uint32_t getStackAlignment() const = 0; | 251 virtual uint32_t getStackAlignment() const = 0; |
252 virtual void reserveFixedAllocaArea(size_t Size, size_t Align) = 0; | 252 virtual void reserveFixedAllocaArea(size_t Size, size_t Align) = 0; |
253 virtual int32_t getFrameFixedAllocaOffset() const = 0; | 253 virtual int32_t getFrameFixedAllocaOffset() const = 0; |
254 virtual uint32_t maxOutArgsSizeBytes() const { return 0; } | 254 virtual uint32_t maxOutArgsSizeBytes() const { return 0; } |
255 | 255 |
256 /// Return whether a 64-bit Variable should be split into a Variable64On32. | 256 /// Return whether a 64-bit Variable should be split into a Variable64On32. |
257 virtual bool shouldSplitToVariable64On32(Type Ty) const = 0; | 257 virtual bool shouldSplitToVariable64On32(Type Ty) const = 0; |
258 | 258 |
| 259 /// Return whether a Vector Variable should be split into a VariableVecOn32. |
| 260 virtual bool shouldSplitToVariableVecOn32(Type Ty) const { |
| 261 (void)Ty; |
| 262 return false; |
| 263 } |
| 264 |
259 bool hasComputedFrame() const { return HasComputedFrame; } | 265 bool hasComputedFrame() const { return HasComputedFrame; } |
260 /// Returns true if this function calls a function that has the "returns | 266 /// Returns true if this function calls a function that has the "returns |
261 /// twice" attribute. | 267 /// twice" attribute. |
262 bool callsReturnsTwice() const { return CallsReturnsTwice; } | 268 bool callsReturnsTwice() const { return CallsReturnsTwice; } |
263 void setCallsReturnsTwice(bool RetTwice) { CallsReturnsTwice = RetTwice; } | 269 void setCallsReturnsTwice(bool RetTwice) { CallsReturnsTwice = RetTwice; } |
264 SizeT makeNextLabelNumber() { return NextLabelNumber++; } | 270 SizeT makeNextLabelNumber() { return NextLabelNumber++; } |
265 SizeT makeNextJumpTableNumber() { return NextJumpTableNumber++; } | 271 SizeT makeNextJumpTableNumber() { return NextJumpTableNumber++; } |
266 LoweringContext &getContext() { return Context; } | 272 LoweringContext &getContext() { return Context; } |
267 Cfg *getFunc() const { return Func; } | 273 Cfg *getFunc() const { return Func; } |
268 GlobalContext *getGlobalContext() const { return Ctx; } | 274 GlobalContext *getGlobalContext() const { return Ctx; } |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 void scalarizeInstruction(Variable *Dest, F insertScalarInstruction, | 502 void scalarizeInstruction(Variable *Dest, F insertScalarInstruction, |
497 Operands *... Srcs) { | 503 Operands *... Srcs) { |
498 assert(GeneratingTargetHelpers && | 504 assert(GeneratingTargetHelpers && |
499 "scalarizeInstruction called during incorrect phase"); | 505 "scalarizeInstruction called during incorrect phase"); |
500 const Type DestTy = Dest->getType(); | 506 const Type DestTy = Dest->getType(); |
501 assert(isVectorType(DestTy)); | 507 assert(isVectorType(DestTy)); |
502 const Type DestElementTy = typeElementType(DestTy); | 508 const Type DestElementTy = typeElementType(DestTy); |
503 const SizeT NumElements = typeNumElements(DestTy); | 509 const SizeT NumElements = typeNumElements(DestTy); |
504 | 510 |
505 Variable *T = Func->makeVariable(DestTy); | 511 Variable *T = Func->makeVariable(DestTy); |
| 512 if (auto *VarVecOn32 = llvm::dyn_cast<VariableVecOn32>(T)) { |
| 513 VarVecOn32->initVecElement(Func); |
| 514 } |
506 Context.insert<InstFakeDef>(T); | 515 Context.insert<InstFakeDef>(T); |
507 | 516 |
508 for (SizeT I = 0; I < NumElements; ++I) { | 517 for (SizeT I = 0; I < NumElements; ++I) { |
509 auto *Index = Ctx->getConstantInt32(I); | 518 auto *Index = Ctx->getConstantInt32(I); |
510 | 519 |
511 auto makeExtractThunk = [this, Index, NumElements](Operand *Src) { | 520 auto makeExtractThunk = [this, Index, NumElements](Operand *Src) { |
512 return [this, Index, NumElements, Src]() { | 521 return [this, Index, NumElements, Src]() { |
513 assert(typeNumElements(Src->getType()) == NumElements); | 522 assert(typeNumElements(Src->getType()) == NumElements); |
514 | 523 |
515 const auto ElementTy = typeElementType(Src->getType()); | 524 const auto ElementTy = typeElementType(Src->getType()); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 virtual void lower() {} | 642 virtual void lower() {} |
634 | 643 |
635 protected: | 644 protected: |
636 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 645 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
637 GlobalContext *Ctx; | 646 GlobalContext *Ctx; |
638 }; | 647 }; |
639 | 648 |
640 } // end of namespace Ice | 649 } // end of namespace Ice |
641 | 650 |
642 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 651 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
OLD | NEW |