| OLD | NEW |
| 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 static Type stackSlotType(); | 454 static Type stackSlotType(); |
| 455 Variable *copyToReg(Operand *Src, RegNumT RegNum = RegNumT()); | 455 Variable *copyToReg(Operand *Src, RegNumT RegNum = RegNumT()); |
| 456 | 456 |
| 457 void unsetIfNonLeafFunc(); | 457 void unsetIfNonLeafFunc(); |
| 458 | 458 |
| 459 // Iterates over the CFG and determines the maximum outgoing stack arguments | 459 // Iterates over the CFG and determines the maximum outgoing stack arguments |
| 460 // bytes. This information is later used during addProlog() to pre-allocate | 460 // bytes. This information is later used during addProlog() to pre-allocate |
| 461 // the outargs area | 461 // the outargs area |
| 462 void findMaxStackOutArgsSize(); | 462 void findMaxStackOutArgsSize(); |
| 463 | 463 |
| 464 void postLowerLegalization(); |
| 465 |
| 464 void addProlog(CfgNode *Node) override; | 466 void addProlog(CfgNode *Node) override; |
| 465 void addEpilog(CfgNode *Node) override; | 467 void addEpilog(CfgNode *Node) override; |
| 466 | 468 |
| 467 // Ensure that a 64-bit Variable has been split into 2 32-bit | 469 // Ensure that a 64-bit Variable has been split into 2 32-bit |
| 468 // Variables, creating them if necessary. This is needed for all | 470 // Variables, creating them if necessary. This is needed for all |
| 469 // I64 operations. | 471 // I64 operations. |
| 470 void split64(Variable *Var); | 472 void split64(Variable *Var); |
| 471 Operand *loOperand(Operand *Operand); | 473 Operand *loOperand(Operand *Operand); |
| 472 Operand *hiOperand(Operand *Operand); | 474 Operand *hiOperand(Operand *Operand); |
| 473 | 475 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 void doAddressOptStore() override; | 554 void doAddressOptStore() override; |
| 553 void randomlyInsertNop(float Probability, | 555 void randomlyInsertNop(float Probability, |
| 554 RandomNumberGenerator &RNG) override; | 556 RandomNumberGenerator &RNG) override; |
| 555 void | 557 void |
| 556 makeRandomRegisterPermutation(llvm::SmallVectorImpl<RegNumT> &Permutation, | 558 makeRandomRegisterPermutation(llvm::SmallVectorImpl<RegNumT> &Permutation, |
| 557 const SmallBitVector &ExcludeRegisters, | 559 const SmallBitVector &ExcludeRegisters, |
| 558 uint64_t Salt) const override; | 560 uint64_t Salt) const override; |
| 559 | 561 |
| 560 OperandMIPS32Mem *formMemoryOperand(Operand *Ptr, Type Ty); | 562 OperandMIPS32Mem *formMemoryOperand(Operand *Ptr, Type Ty); |
| 561 | 563 |
| 564 class PostLoweringLegalizer { |
| 565 PostLoweringLegalizer() = delete; |
| 566 PostLoweringLegalizer(const PostLoweringLegalizer &) = delete; |
| 567 PostLoweringLegalizer &operator=(const PostLoweringLegalizer &) = delete; |
| 568 |
| 569 public: |
| 570 explicit PostLoweringLegalizer(TargetMIPS32 *Target) |
| 571 : Target(Target), StackOrFrameReg(Target->getPhysicalRegister( |
| 572 Target->getFrameOrStackReg())) {} |
| 573 |
| 574 /// Legalizes Mov if its Source (or Destination) is a spilled Variable, or |
| 575 /// if its Source is a Rematerializable variable (this form is used in lieu |
| 576 /// of lea, which is not available in MIPS.) |
| 577 /// |
| 578 /// Moves to memory become store instructions, and moves from memory, loads. |
| 579 void legalizeMov(InstMIPS32Mov *Mov); |
| 580 |
| 581 private: |
| 582 /// Creates a new Base register centered around [Base, +/- Offset]. |
| 583 Variable *newBaseRegister(Variable *Base, int32_t Offset, |
| 584 RegNumT ScratchRegNum); |
| 585 |
| 586 TargetMIPS32 *const Target; |
| 587 Variable *const StackOrFrameReg; |
| 588 }; |
| 589 |
| 562 bool UsesFramePointer = false; | 590 bool UsesFramePointer = false; |
| 563 bool NeedsStackAlignment = false; | 591 bool NeedsStackAlignment = false; |
| 564 bool MaybeLeafFunc = true; | 592 bool MaybeLeafFunc = true; |
| 565 bool PrologEmitsFixedAllocas = false; | 593 bool PrologEmitsFixedAllocas = false; |
| 566 bool VariableAllocaUsed = false; | 594 bool VariableAllocaUsed = false; |
| 567 uint32_t MaxOutArgsSizeBytes = 0; | 595 uint32_t MaxOutArgsSizeBytes = 0; |
| 568 uint32_t TotalStackSizeBytes = 0; | 596 uint32_t TotalStackSizeBytes = 0; |
| 569 static SmallBitVector TypeToRegisterSet[RCMIPS32_NUM]; | 597 static SmallBitVector TypeToRegisterSet[RCMIPS32_NUM]; |
| 570 static SmallBitVector TypeToRegisterSetUnfiltered[RCMIPS32_NUM]; | 598 static SmallBitVector TypeToRegisterSetUnfiltered[RCMIPS32_NUM]; |
| 571 static SmallBitVector RegisterAliases[RegMIPS32::Reg_NUM]; | 599 static SmallBitVector RegisterAliases[RegMIPS32::Reg_NUM]; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 explicit TargetHeaderMIPS32(GlobalContext *Ctx); | 710 explicit TargetHeaderMIPS32(GlobalContext *Ctx); |
| 683 | 711 |
| 684 private: | 712 private: |
| 685 ~TargetHeaderMIPS32() = default; | 713 ~TargetHeaderMIPS32() = default; |
| 686 }; | 714 }; |
| 687 | 715 |
| 688 } // end of namespace MIPS32 | 716 } // end of namespace MIPS32 |
| 689 } // end of namespace Ice | 717 } // end of namespace Ice |
| 690 | 718 |
| 691 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H | 719 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H |
| OLD | NEW |