Chromium Code Reviews| 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 = 0; | |
|
Jim Stichnoth
2016/09/29 16:50:25
Since this is likely to be MIPS-specific, maybe pr
jaydeep.patil
2016/09/30 07:02:51
Done.
| |
| 261 | |
| 259 bool hasComputedFrame() const { return HasComputedFrame; } | 262 bool hasComputedFrame() const { return HasComputedFrame; } |
| 260 /// Returns true if this function calls a function that has the "returns | 263 /// Returns true if this function calls a function that has the "returns |
| 261 /// twice" attribute. | 264 /// twice" attribute. |
| 262 bool callsReturnsTwice() const { return CallsReturnsTwice; } | 265 bool callsReturnsTwice() const { return CallsReturnsTwice; } |
| 263 void setCallsReturnsTwice(bool RetTwice) { CallsReturnsTwice = RetTwice; } | 266 void setCallsReturnsTwice(bool RetTwice) { CallsReturnsTwice = RetTwice; } |
| 264 SizeT makeNextLabelNumber() { return NextLabelNumber++; } | 267 SizeT makeNextLabelNumber() { return NextLabelNumber++; } |
| 265 SizeT makeNextJumpTableNumber() { return NextJumpTableNumber++; } | 268 SizeT makeNextJumpTableNumber() { return NextJumpTableNumber++; } |
| 266 LoweringContext &getContext() { return Context; } | 269 LoweringContext &getContext() { return Context; } |
| 267 Cfg *getFunc() const { return Func; } | 270 Cfg *getFunc() const { return Func; } |
| 268 GlobalContext *getGlobalContext() const { return Ctx; } | 271 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, | 499 void scalarizeInstruction(Variable *Dest, F insertScalarInstruction, |
| 497 Operands *... Srcs) { | 500 Operands *... Srcs) { |
| 498 assert(GeneratingTargetHelpers && | 501 assert(GeneratingTargetHelpers && |
| 499 "scalarizeInstruction called during incorrect phase"); | 502 "scalarizeInstruction called during incorrect phase"); |
| 500 const Type DestTy = Dest->getType(); | 503 const Type DestTy = Dest->getType(); |
| 501 assert(isVectorType(DestTy)); | 504 assert(isVectorType(DestTy)); |
| 502 const Type DestElementTy = typeElementType(DestTy); | 505 const Type DestElementTy = typeElementType(DestTy); |
| 503 const SizeT NumElements = typeNumElements(DestTy); | 506 const SizeT NumElements = typeNumElements(DestTy); |
| 504 | 507 |
| 505 Variable *T = Func->makeVariable(DestTy); | 508 Variable *T = Func->makeVariable(DestTy); |
| 509 if (auto *VarVecOn32 = llvm::dyn_cast<VariableVecOn32>(T)) { | |
| 510 VarVecOn32->initVecElement(Func, DestTy); | |
| 511 } | |
| 506 Context.insert<InstFakeDef>(T); | 512 Context.insert<InstFakeDef>(T); |
| 507 | 513 |
| 508 for (SizeT I = 0; I < NumElements; ++I) { | 514 for (SizeT I = 0; I < NumElements; ++I) { |
| 509 auto *Index = Ctx->getConstantInt32(I); | 515 auto *Index = Ctx->getConstantInt32(I); |
| 510 | 516 |
| 511 auto makeExtractThunk = [this, Index, NumElements](Operand *Src) { | 517 auto makeExtractThunk = [this, Index, NumElements](Operand *Src) { |
| 512 return [this, Index, NumElements, Src]() { | 518 return [this, Index, NumElements, Src]() { |
| 513 assert(typeNumElements(Src->getType()) == NumElements); | 519 assert(typeNumElements(Src->getType()) == NumElements); |
| 514 | 520 |
| 515 const auto ElementTy = typeElementType(Src->getType()); | 521 const auto ElementTy = typeElementType(Src->getType()); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 633 virtual void lower() {} | 639 virtual void lower() {} |
| 634 | 640 |
| 635 protected: | 641 protected: |
| 636 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 642 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
| 637 GlobalContext *Ctx; | 643 GlobalContext *Ctx; |
| 638 }; | 644 }; |
| 639 | 645 |
| 640 } // end of namespace Ice | 646 } // end of namespace Ice |
| 641 | 647 |
| 642 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 648 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
| OLD | NEW |