Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: src/IceTargetLoweringMIPS32.h

Issue 2411193003: [SubZero] Legalize load, store for MIPS post lower (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressed review comments Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 //===- subzero/src/IceTargetLoweringMIPS32.h - MIPS32 lowering ---*- C++-*-===// 1 //===- subzero/src/IceTargetLoweringMIPS32.h - MIPS32 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 /// \file 10 /// \file
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 const SmallBitVector &getAliasesForRegister(RegNumT Reg) const override { 83 const SmallBitVector &getAliasesForRegister(RegNumT Reg) const override {
84 return RegisterAliases[Reg]; 84 return RegisterAliases[Reg];
85 } 85 }
86 bool hasFramePointer() const override { return UsesFramePointer; } 86 bool hasFramePointer() const override { return UsesFramePointer; }
87 void setHasFramePointer() override { UsesFramePointer = true; } 87 void setHasFramePointer() override { UsesFramePointer = true; }
88 RegNumT getStackReg() const override { return RegMIPS32::Reg_SP; } 88 RegNumT getStackReg() const override { return RegMIPS32::Reg_SP; }
89 RegNumT getFrameReg() const override { return RegMIPS32::Reg_FP; } 89 RegNumT getFrameReg() const override { return RegMIPS32::Reg_FP; }
90 RegNumT getFrameOrStackReg() const override { 90 RegNumT getFrameOrStackReg() const override {
91 return UsesFramePointer ? getFrameReg() : getStackReg(); 91 return UsesFramePointer ? getFrameReg() : getStackReg();
92 } 92 }
93 RegNumT getReservedTmpReg() const { return RegMIPS32::Reg_AT; }
93 size_t typeWidthInBytesOnStack(Type Ty) const override { 94 size_t typeWidthInBytesOnStack(Type Ty) const override {
94 // Round up to the next multiple of 4 bytes. In particular, i1, i8, and i16 95 // Round up to the next multiple of 4 bytes. In particular, i1, i8, and i16
95 // are rounded up to 4 bytes. 96 // are rounded up to 4 bytes.
96 return (typeWidthInBytes(Ty) + 3) & ~3; 97 return (typeWidthInBytes(Ty) + 3) & ~3;
97 } 98 }
98 uint32_t getStackAlignment() const override; 99 uint32_t getStackAlignment() const override;
99 void reserveFixedAllocaArea(size_t Size, size_t Align) override { 100 void reserveFixedAllocaArea(size_t Size, size_t Align) override {
100 FixedAllocaSizeBytes = Size; 101 FixedAllocaSizeBytes = Size;
101 assert(llvm::isPowerOf2_32(Align)); 102 assert(llvm::isPowerOf2_32(Align));
102 FixedAllocaAlignBytes = Align; 103 FixedAllocaAlignBytes = Align;
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 class PostLoweringLegalizer { 720 class PostLoweringLegalizer {
720 PostLoweringLegalizer() = delete; 721 PostLoweringLegalizer() = delete;
721 PostLoweringLegalizer(const PostLoweringLegalizer &) = delete; 722 PostLoweringLegalizer(const PostLoweringLegalizer &) = delete;
722 PostLoweringLegalizer &operator=(const PostLoweringLegalizer &) = delete; 723 PostLoweringLegalizer &operator=(const PostLoweringLegalizer &) = delete;
723 724
724 public: 725 public:
725 explicit PostLoweringLegalizer(TargetMIPS32 *Target) 726 explicit PostLoweringLegalizer(TargetMIPS32 *Target)
726 : Target(Target), StackOrFrameReg(Target->getPhysicalRegister( 727 : Target(Target), StackOrFrameReg(Target->getPhysicalRegister(
727 Target->getFrameOrStackReg())) {} 728 Target->getFrameOrStackReg())) {}
728 729
730 /// Legalizes Mem. if Mem.Base is a rematerializable variable,
731 /// Mem.Offset is fixed up.
732 OperandMIPS32Mem *legalizeMemOperand(OperandMIPS32Mem *Mem);
733
729 /// Legalizes Mov if its Source (or Destination) is a spilled Variable, or 734 /// Legalizes Mov if its Source (or Destination) is a spilled Variable, or
730 /// if its Source is a Rematerializable variable (this form is used in lieu 735 /// if its Source is a Rematerializable variable (this form is used in lieu
731 /// of lea, which is not available in MIPS.) 736 /// of lea, which is not available in MIPS.)
732 /// 737 ///
733 /// Moves to memory become store instructions, and moves from memory, loads. 738 /// Moves to memory become store instructions, and moves from memory, loads.
734 void legalizeMov(InstMIPS32Mov *Mov); 739 void legalizeMov(InstMIPS32Mov *Mov);
735 740
736 private: 741 private:
737 /// Creates a new Base register centered around [Base, +/- Offset]. 742 /// Creates a new Base register centered around [Base, +/- Offset].
738 Variable *newBaseRegister(Variable *Base, int32_t Offset, 743 Variable *newBaseRegister(Variable *Base, int32_t Offset,
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 explicit TargetHeaderMIPS32(GlobalContext *Ctx); 873 explicit TargetHeaderMIPS32(GlobalContext *Ctx);
869 874
870 private: 875 private:
871 ~TargetHeaderMIPS32() = default; 876 ~TargetHeaderMIPS32() = default;
872 }; 877 };
873 878
874 } // end of namespace MIPS32 879 } // end of namespace MIPS32
875 } // end of namespace Ice 880 } // end of namespace Ice
876 881
877 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H 882 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H
OLDNEW
« no previous file with comments | « no previous file | src/IceTargetLoweringMIPS32.cpp » ('j') | tests_lit/llvm2ice_tests/mips-legalization.ll » ('J')

Powered by Google App Engine
This is Rietveld 408576698