| OLD | NEW |
| 1 // | 1 // |
| 2 // The Subzero Code Generator | 2 // The Subzero Code Generator |
| 3 // | 3 // |
| 4 // This file is distributed under the University of Illinois Open Source | 4 // This file is distributed under the University of Illinois Open Source |
| 5 // License. See LICENSE.TXT for details. | 5 // License. See LICENSE.TXT for details. |
| 6 // | 6 // |
| 7 //===----------------------------------------------------------------------===// | 7 //===----------------------------------------------------------------------===// |
| 8 /// | 8 /// |
| 9 /// \file | 9 /// \file |
| 10 /// \brief Implements the TargetLoweringMIPS32 class, which consists almost | 10 /// \brief Implements the TargetLoweringMIPS32 class, which consists almost |
| (...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1222 // bit-manipulation problems below. | 1222 // bit-manipulation problems below. |
| 1223 const uint32_t AlignmentParam = std::max(1u, Instr->getAlignInBytes()); | 1223 const uint32_t AlignmentParam = std::max(1u, Instr->getAlignInBytes()); |
| 1224 | 1224 |
| 1225 // LLVM enforces power of 2 alignment. | 1225 // LLVM enforces power of 2 alignment. |
| 1226 assert(llvm::isPowerOf2_32(AlignmentParam)); | 1226 assert(llvm::isPowerOf2_32(AlignmentParam)); |
| 1227 assert(llvm::isPowerOf2_32(MIPS32_STACK_ALIGNMENT_BYTES)); | 1227 assert(llvm::isPowerOf2_32(MIPS32_STACK_ALIGNMENT_BYTES)); |
| 1228 | 1228 |
| 1229 const uint32_t Alignment = | 1229 const uint32_t Alignment = |
| 1230 std::max(AlignmentParam, MIPS32_STACK_ALIGNMENT_BYTES); | 1230 std::max(AlignmentParam, MIPS32_STACK_ALIGNMENT_BYTES); |
| 1231 const bool OverAligned = Alignment > MIPS32_STACK_ALIGNMENT_BYTES; | 1231 const bool OverAligned = Alignment > MIPS32_STACK_ALIGNMENT_BYTES; |
| 1232 const bool OptM1 = getFlags().getOptLevel() == Opt_m1; | 1232 const bool OptM1 = Func->getOptLevel() == Opt_m1; |
| 1233 const bool AllocaWithKnownOffset = Instr->getKnownFrameOffset(); | 1233 const bool AllocaWithKnownOffset = Instr->getKnownFrameOffset(); |
| 1234 const bool UseFramePointer = | 1234 const bool UseFramePointer = |
| 1235 hasFramePointer() || OverAligned || !AllocaWithKnownOffset || OptM1; | 1235 hasFramePointer() || OverAligned || !AllocaWithKnownOffset || OptM1; |
| 1236 | 1236 |
| 1237 if (UseFramePointer) | 1237 if (UseFramePointer) |
| 1238 setHasFramePointer(); | 1238 setHasFramePointer(); |
| 1239 | 1239 |
| 1240 Variable *SP = getPhysicalRegister(RegMIPS32::Reg_SP); | 1240 Variable *SP = getPhysicalRegister(RegMIPS32::Reg_SP); |
| 1241 | 1241 |
| 1242 Variable *Dest = Instr->getDest(); | 1242 Variable *Dest = Instr->getDest(); |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2327 } | 2327 } |
| 2328 | 2328 |
| 2329 // Turn an i64 Phi instruction into a pair of i32 Phi instructions, to preserve | 2329 // Turn an i64 Phi instruction into a pair of i32 Phi instructions, to preserve |
| 2330 // integrity of liveness analysis. Undef values are also turned into zeroes, | 2330 // integrity of liveness analysis. Undef values are also turned into zeroes, |
| 2331 // since loOperand() and hiOperand() don't expect Undef input. | 2331 // since loOperand() and hiOperand() don't expect Undef input. |
| 2332 void TargetMIPS32::prelowerPhis() { | 2332 void TargetMIPS32::prelowerPhis() { |
| 2333 PhiLowering::prelowerPhis32Bit<TargetMIPS32>(this, Context.getNode(), Func); | 2333 PhiLowering::prelowerPhis32Bit<TargetMIPS32>(this, Context.getNode(), Func); |
| 2334 } | 2334 } |
| 2335 | 2335 |
| 2336 void TargetMIPS32::postLower() { | 2336 void TargetMIPS32::postLower() { |
| 2337 if (getFlags().getOptLevel() == Opt_m1) | 2337 if (Func->getOptLevel() == Opt_m1) |
| 2338 return; | 2338 return; |
| 2339 // TODO(rkotler): Find two-address non-SSA instructions where Dest==Src0, | 2339 // TODO(rkotler): Find two-address non-SSA instructions where Dest==Src0, |
| 2340 // and set the IsDestRedefined flag to keep liveness analysis consistent. | 2340 // and set the IsDestRedefined flag to keep liveness analysis consistent. |
| 2341 UnimplementedError(getFlags()); | 2341 UnimplementedError(getFlags()); |
| 2342 } | 2342 } |
| 2343 | 2343 |
| 2344 void TargetMIPS32::makeRandomRegisterPermutation( | 2344 void TargetMIPS32::makeRandomRegisterPermutation( |
| 2345 llvm::SmallVectorImpl<RegNumT> &Permutation, | 2345 llvm::SmallVectorImpl<RegNumT> &Permutation, |
| 2346 const SmallBitVector &ExcludeRegisters, uint64_t Salt) const { | 2346 const SmallBitVector &ExcludeRegisters, uint64_t Salt) const { |
| 2347 (void)Permutation; | 2347 (void)Permutation; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2571 Str << "\t.set\t" | 2571 Str << "\t.set\t" |
| 2572 << "nomips16\n"; | 2572 << "nomips16\n"; |
| 2573 } | 2573 } |
| 2574 | 2574 |
| 2575 SmallBitVector TargetMIPS32::TypeToRegisterSet[RCMIPS32_NUM]; | 2575 SmallBitVector TargetMIPS32::TypeToRegisterSet[RCMIPS32_NUM]; |
| 2576 SmallBitVector TargetMIPS32::TypeToRegisterSetUnfiltered[RCMIPS32_NUM]; | 2576 SmallBitVector TargetMIPS32::TypeToRegisterSetUnfiltered[RCMIPS32_NUM]; |
| 2577 SmallBitVector TargetMIPS32::RegisterAliases[RegMIPS32::Reg_NUM]; | 2577 SmallBitVector TargetMIPS32::RegisterAliases[RegMIPS32::Reg_NUM]; |
| 2578 | 2578 |
| 2579 } // end of namespace MIPS32 | 2579 } // end of namespace MIPS32 |
| 2580 } // end of namespace Ice | 2580 } // end of namespace Ice |
| OLD | NEW |