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

Side by Side Diff: src/IceTargetLoweringMIPS32.h

Issue 2417233002: [Subzero][MIPS32] Fix alloca alignment and offset for Om1 and O2 optimization (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Changed comment in legalizeMov() 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
« no previous file with comments | « no previous file | src/IceTargetLoweringMIPS32.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 return (typeWidthInBytes(Ty) + 3) & ~3; 96 return (typeWidthInBytes(Ty) + 3) & ~3;
97 } 97 }
98 uint32_t getStackAlignment() const override; 98 uint32_t getStackAlignment() const override;
99 void reserveFixedAllocaArea(size_t Size, size_t Align) override { 99 void reserveFixedAllocaArea(size_t Size, size_t Align) override {
100 FixedAllocaSizeBytes = Size; 100 FixedAllocaSizeBytes = Size;
101 assert(llvm::isPowerOf2_32(Align)); 101 assert(llvm::isPowerOf2_32(Align));
102 FixedAllocaAlignBytes = Align; 102 FixedAllocaAlignBytes = Align;
103 PrologEmitsFixedAllocas = true; 103 PrologEmitsFixedAllocas = true;
104 } 104 }
105 int32_t getFrameFixedAllocaOffset() const override { 105 int32_t getFrameFixedAllocaOffset() const override {
106 return FixedAllocaSizeBytes - (SpillAreaSizeBytes - MaxOutArgsSizeBytes); 106 int32_t FixedAllocaOffset =
107 Utils::applyAlignment(CurrentAllocaOffset, FixedAllocaAlignBytes);
108 return FixedAllocaOffset - MaxOutArgsSizeBytes;
107 } 109 }
108 110
109 uint32_t maxOutArgsSizeBytes() const override { return MaxOutArgsSizeBytes; } 111 uint32_t maxOutArgsSizeBytes() const override { return MaxOutArgsSizeBytes; }
110 112
111 bool shouldSplitToVariable64On32(Type Ty) const override { 113 bool shouldSplitToVariable64On32(Type Ty) const override {
112 return Ty == IceType_i64; 114 return Ty == IceType_i64;
113 } 115 }
114 116
115 bool shouldSplitToVariableVecOn32(Type Ty) const override { 117 bool shouldSplitToVariableVecOn32(Type Ty) const override {
116 return isVectorType(Ty); 118 return isVectorType(Ty);
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 void lowerInsertElement(const InstInsertElement *Instr) override; 695 void lowerInsertElement(const InstInsertElement *Instr) override;
694 void lowerLoad(const InstLoad *Instr) override; 696 void lowerLoad(const InstLoad *Instr) override;
695 void lowerPhi(const InstPhi *Instr) override; 697 void lowerPhi(const InstPhi *Instr) override;
696 void lowerRet(const InstRet *Instr) override; 698 void lowerRet(const InstRet *Instr) override;
697 void lowerSelect(const InstSelect *Instr) override; 699 void lowerSelect(const InstSelect *Instr) override;
698 void lowerShuffleVector(const InstShuffleVector *Instr) override; 700 void lowerShuffleVector(const InstShuffleVector *Instr) override;
699 void lowerStore(const InstStore *Instr) override; 701 void lowerStore(const InstStore *Instr) override;
700 void lowerSwitch(const InstSwitch *Instr) override; 702 void lowerSwitch(const InstSwitch *Instr) override;
701 void lowerUnreachable(const InstUnreachable *Instr) override; 703 void lowerUnreachable(const InstUnreachable *Instr) override;
702 void prelowerPhis() override; 704 void prelowerPhis() override;
703 uint32_t getCallStackArgumentsSizeBytes(const InstCall *Instr) override { 705 uint32_t getCallStackArgumentsSizeBytes(const InstCall *Instr) override;
704 (void)Instr;
705 return 0;
706 }
707 void genTargetHelperCallFor(Inst *Instr) override; 706 void genTargetHelperCallFor(Inst *Instr) override;
708 void doAddressOptLoad() override; 707 void doAddressOptLoad() override;
709 void doAddressOptStore() override; 708 void doAddressOptStore() override;
710 void randomlyInsertNop(float Probability, 709 void randomlyInsertNop(float Probability,
711 RandomNumberGenerator &RNG) override; 710 RandomNumberGenerator &RNG) override;
712 void 711 void
713 makeRandomRegisterPermutation(llvm::SmallVectorImpl<RegNumT> &Permutation, 712 makeRandomRegisterPermutation(llvm::SmallVectorImpl<RegNumT> &Permutation,
714 const SmallBitVector &ExcludeRegisters, 713 const SmallBitVector &ExcludeRegisters,
715 uint64_t Salt) const override; 714 uint64_t Salt) const override;
716 715
(...skipping 25 matching lines...) Expand all
742 Variable *const StackOrFrameReg; 741 Variable *const StackOrFrameReg;
743 }; 742 };
744 743
745 bool UsesFramePointer = false; 744 bool UsesFramePointer = false;
746 bool NeedsStackAlignment = false; 745 bool NeedsStackAlignment = false;
747 bool MaybeLeafFunc = true; 746 bool MaybeLeafFunc = true;
748 bool PrologEmitsFixedAllocas = false; 747 bool PrologEmitsFixedAllocas = false;
749 bool VariableAllocaUsed = false; 748 bool VariableAllocaUsed = false;
750 uint32_t MaxOutArgsSizeBytes = 0; 749 uint32_t MaxOutArgsSizeBytes = 0;
751 uint32_t TotalStackSizeBytes = 0; 750 uint32_t TotalStackSizeBytes = 0;
751 uint32_t CurrentAllocaOffset = 0;
752 static SmallBitVector TypeToRegisterSet[RCMIPS32_NUM]; 752 static SmallBitVector TypeToRegisterSet[RCMIPS32_NUM];
753 static SmallBitVector TypeToRegisterSetUnfiltered[RCMIPS32_NUM]; 753 static SmallBitVector TypeToRegisterSetUnfiltered[RCMIPS32_NUM];
754 static SmallBitVector RegisterAliases[RegMIPS32::Reg_NUM]; 754 static SmallBitVector RegisterAliases[RegMIPS32::Reg_NUM];
755 SmallBitVector RegsUsed; 755 SmallBitVector RegsUsed;
756 VarList PhysicalRegisters[IceType_NUM]; 756 VarList PhysicalRegisters[IceType_NUM];
757 VarList PreservedGPRs; 757 VarList PreservedGPRs;
758 static constexpr uint32_t CHAR_BITS = 8; 758 static constexpr uint32_t CHAR_BITS = 8;
759 static constexpr uint32_t INT32_BITS = 32; 759 static constexpr uint32_t INT32_BITS = 32;
760 size_t SpillAreaSizeBytes = 0; 760 size_t SpillAreaSizeBytes = 0;
761 size_t FixedAllocaSizeBytes = 0; 761 size_t FixedAllocaSizeBytes = 0;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 explicit TargetHeaderMIPS32(GlobalContext *Ctx); 868 explicit TargetHeaderMIPS32(GlobalContext *Ctx);
869 869
870 private: 870 private:
871 ~TargetHeaderMIPS32() = default; 871 ~TargetHeaderMIPS32() = default;
872 }; 872 };
873 873
874 } // end of namespace MIPS32 874 } // end of namespace MIPS32
875 } // end of namespace Ice 875 } // end of namespace Ice
876 876
877 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H 877 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H
OLDNEW
« no previous file with comments | « no previous file | src/IceTargetLoweringMIPS32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698