17330f729Sjoerg //===-- MipsSubtarget.h - Define Subtarget for the Mips ---------*- C++ -*-===// 27330f729Sjoerg // 37330f729Sjoerg // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 47330f729Sjoerg // See https://llvm.org/LICENSE.txt for license information. 57330f729Sjoerg // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 67330f729Sjoerg // 77330f729Sjoerg //===----------------------------------------------------------------------===// 87330f729Sjoerg // 97330f729Sjoerg // This file declares the Mips specific subclass of TargetSubtargetInfo. 107330f729Sjoerg // 117330f729Sjoerg //===----------------------------------------------------------------------===// 127330f729Sjoerg 137330f729Sjoerg #ifndef LLVM_LIB_TARGET_MIPS_MIPSSUBTARGET_H 147330f729Sjoerg #define LLVM_LIB_TARGET_MIPS_MIPSSUBTARGET_H 157330f729Sjoerg 167330f729Sjoerg #include "MCTargetDesc/MipsABIInfo.h" 177330f729Sjoerg #include "MipsFrameLowering.h" 187330f729Sjoerg #include "MipsISelLowering.h" 197330f729Sjoerg #include "MipsInstrInfo.h" 207330f729Sjoerg #include "llvm/CodeGen/SelectionDAGTargetInfo.h" 217330f729Sjoerg #include "llvm/CodeGen/TargetSubtargetInfo.h" 227330f729Sjoerg #include "llvm/CodeGen/GlobalISel/CallLowering.h" 237330f729Sjoerg #include "llvm/CodeGen/GlobalISel/LegalizerInfo.h" 247330f729Sjoerg #include "llvm/CodeGen/GlobalISel/RegisterBankInfo.h" 257330f729Sjoerg #include "llvm/CodeGen/GlobalISel/InstructionSelector.h" 267330f729Sjoerg #include "llvm/IR/DataLayout.h" 277330f729Sjoerg #include "llvm/MC/MCInstrItineraries.h" 287330f729Sjoerg #include "llvm/Support/ErrorHandling.h" 297330f729Sjoerg #include <string> 307330f729Sjoerg 317330f729Sjoerg #define GET_SUBTARGETINFO_HEADER 327330f729Sjoerg #include "MipsGenSubtargetInfo.inc" 337330f729Sjoerg 347330f729Sjoerg namespace llvm { 357330f729Sjoerg class StringRef; 367330f729Sjoerg 377330f729Sjoerg class MipsTargetMachine; 387330f729Sjoerg 397330f729Sjoerg class MipsSubtarget : public MipsGenSubtargetInfo { 407330f729Sjoerg virtual void anchor(); 417330f729Sjoerg 427330f729Sjoerg enum MipsArchEnum { 437330f729Sjoerg MipsDefault, 447330f729Sjoerg Mips1, Mips2, Mips32, Mips32r2, Mips32r3, Mips32r5, Mips32r6, Mips32Max, 457330f729Sjoerg Mips3, Mips4, Mips5, Mips64, Mips64r2, Mips64r3, Mips64r5, Mips64r6 467330f729Sjoerg }; 477330f729Sjoerg 487330f729Sjoerg enum class CPU { P5600 }; 497330f729Sjoerg 507330f729Sjoerg // Used to avoid printing dsp warnings multiple times. 517330f729Sjoerg static bool DspWarningPrinted; 527330f729Sjoerg 537330f729Sjoerg // Used to avoid printing msa warnings multiple times. 547330f729Sjoerg static bool MSAWarningPrinted; 557330f729Sjoerg 567330f729Sjoerg // Used to avoid printing crc warnings multiple times. 577330f729Sjoerg static bool CRCWarningPrinted; 587330f729Sjoerg 597330f729Sjoerg // Used to avoid printing ginv warnings multiple times. 607330f729Sjoerg static bool GINVWarningPrinted; 617330f729Sjoerg 627330f729Sjoerg // Used to avoid printing virt warnings multiple times. 637330f729Sjoerg static bool VirtWarningPrinted; 647330f729Sjoerg 657330f729Sjoerg // Mips architecture version 667330f729Sjoerg MipsArchEnum MipsArchVersion; 677330f729Sjoerg 687330f729Sjoerg // Processor implementation (unused but required to exist by 697330f729Sjoerg // tablegen-erated code). 707330f729Sjoerg CPU ProcImpl; 717330f729Sjoerg 727330f729Sjoerg // IsLittle - The target is Little Endian 737330f729Sjoerg bool IsLittle; 747330f729Sjoerg 757330f729Sjoerg // IsSoftFloat - The target does not support any floating point instructions. 767330f729Sjoerg bool IsSoftFloat; 777330f729Sjoerg 787330f729Sjoerg // IsSingleFloat - The target only supports single precision float 797330f729Sjoerg // point operations. This enable the target to use all 32 32-bit 807330f729Sjoerg // floating point registers instead of only using even ones. 817330f729Sjoerg bool IsSingleFloat; 827330f729Sjoerg 837330f729Sjoerg // IsFPXX - MIPS O32 modeless ABI. 847330f729Sjoerg bool IsFPXX; 857330f729Sjoerg 867330f729Sjoerg // NoABICalls - Disable SVR4-style position-independent code. 877330f729Sjoerg bool NoABICalls; 887330f729Sjoerg 897330f729Sjoerg // Abs2008 - Use IEEE 754-2008 abs.fmt instruction. 907330f729Sjoerg bool Abs2008; 917330f729Sjoerg 927330f729Sjoerg // IsFP64bit - The target processor has 64-bit floating point registers. 937330f729Sjoerg bool IsFP64bit; 947330f729Sjoerg 957330f729Sjoerg /// Are odd single-precision registers permitted? 967330f729Sjoerg /// This corresponds to -modd-spreg and -mno-odd-spreg 977330f729Sjoerg bool UseOddSPReg; 987330f729Sjoerg 997330f729Sjoerg // IsNan2008 - IEEE 754-2008 NaN encoding. 1007330f729Sjoerg bool IsNaN2008bit; 1017330f729Sjoerg 1027330f729Sjoerg // IsGP64bit - General-purpose registers are 64 bits wide 1037330f729Sjoerg bool IsGP64bit; 1047330f729Sjoerg 1057330f729Sjoerg // IsPTR64bit - Pointers are 64 bit wide 1067330f729Sjoerg bool IsPTR64bit; 1077330f729Sjoerg 1087330f729Sjoerg // HasVFPU - Processor has a vector floating point unit. 1097330f729Sjoerg bool HasVFPU; 1107330f729Sjoerg 1117330f729Sjoerg // CPU supports cnMIPS (Cavium Networks Octeon CPU). 1127330f729Sjoerg bool HasCnMips; 1137330f729Sjoerg 114*82d56013Sjoerg // CPU supports cnMIPSP (Cavium Networks Octeon+ CPU). 115*82d56013Sjoerg bool HasCnMipsP; 116*82d56013Sjoerg 1177330f729Sjoerg // isLinux - Target system is Linux. Is false we consider ELFOS for now. 1187330f729Sjoerg bool IsLinux; 1197330f729Sjoerg 1207330f729Sjoerg // UseSmallSection - Small section is used. 1217330f729Sjoerg bool UseSmallSection; 1227330f729Sjoerg 1237330f729Sjoerg /// Features related to the presence of specific instructions. 1247330f729Sjoerg 1257330f729Sjoerg // HasMips3_32 - The subset of MIPS-III instructions added to MIPS32 1267330f729Sjoerg bool HasMips3_32; 1277330f729Sjoerg 1287330f729Sjoerg // HasMips3_32r2 - The subset of MIPS-III instructions added to MIPS32r2 1297330f729Sjoerg bool HasMips3_32r2; 1307330f729Sjoerg 1317330f729Sjoerg // HasMips4_32 - Has the subset of MIPS-IV present in MIPS32 1327330f729Sjoerg bool HasMips4_32; 1337330f729Sjoerg 1347330f729Sjoerg // HasMips4_32r2 - Has the subset of MIPS-IV present in MIPS32r2 1357330f729Sjoerg bool HasMips4_32r2; 1367330f729Sjoerg 1377330f729Sjoerg // HasMips5_32r2 - Has the subset of MIPS-V present in MIPS32r2 1387330f729Sjoerg bool HasMips5_32r2; 1397330f729Sjoerg 1407330f729Sjoerg // InMips16 -- can process Mips16 instructions 1417330f729Sjoerg bool InMips16Mode; 1427330f729Sjoerg 1437330f729Sjoerg // Mips16 hard float 1447330f729Sjoerg bool InMips16HardFloat; 1457330f729Sjoerg 1467330f729Sjoerg // InMicroMips -- can process MicroMips instructions 1477330f729Sjoerg bool InMicroMipsMode; 1487330f729Sjoerg 1497330f729Sjoerg // HasDSP, HasDSPR2, HasDSPR3 -- supports DSP ASE. 1507330f729Sjoerg bool HasDSP, HasDSPR2, HasDSPR3; 1517330f729Sjoerg 152*82d56013Sjoerg // Has3D -- Supports Mips3D ASE. 153*82d56013Sjoerg bool Has3D; 154*82d56013Sjoerg 1557330f729Sjoerg // Allow mixed Mips16 and Mips32 in one source file 1567330f729Sjoerg bool AllowMixed16_32; 1577330f729Sjoerg 1587330f729Sjoerg // Optimize for space by compiling all functions as Mips 16 unless 1597330f729Sjoerg // it needs floating point. Functions needing floating point are 1607330f729Sjoerg // compiled as Mips32 1617330f729Sjoerg bool Os16; 1627330f729Sjoerg 1637330f729Sjoerg // HasMSA -- supports MSA ASE. 1647330f729Sjoerg bool HasMSA; 1657330f729Sjoerg 1667330f729Sjoerg // UseTCCInDIV -- Enables the use of trapping in the assembler. 1677330f729Sjoerg bool UseTCCInDIV; 1687330f729Sjoerg 1697330f729Sjoerg // Sym32 -- On Mips64 symbols are 32 bits. 1707330f729Sjoerg bool HasSym32; 1717330f729Sjoerg 1727330f729Sjoerg // HasEVA -- supports EVA ASE. 1737330f729Sjoerg bool HasEVA; 1747330f729Sjoerg 1757330f729Sjoerg // nomadd4 - disables generation of 4-operand madd.s, madd.d and 1767330f729Sjoerg // related instructions. 1777330f729Sjoerg bool DisableMadd4; 1787330f729Sjoerg 1797330f729Sjoerg // HasMT -- support MT ASE. 1807330f729Sjoerg bool HasMT; 1817330f729Sjoerg 1827330f729Sjoerg // HasCRC -- supports R6 CRC ASE 1837330f729Sjoerg bool HasCRC; 1847330f729Sjoerg 1857330f729Sjoerg // HasVirt -- supports Virtualization ASE 1867330f729Sjoerg bool HasVirt; 1877330f729Sjoerg 1887330f729Sjoerg // HasGINV -- supports R6 Global INValidate ASE 1897330f729Sjoerg bool HasGINV; 1907330f729Sjoerg 1917330f729Sjoerg // Use hazard variants of the jump register instructions for indirect 1927330f729Sjoerg // function calls and jump tables. 1937330f729Sjoerg bool UseIndirectJumpsHazard; 1947330f729Sjoerg 1957330f729Sjoerg // Disable use of the `jal` instruction. 1967330f729Sjoerg bool UseLongCalls = false; 1977330f729Sjoerg 1987330f729Sjoerg // Assume 32-bit GOT. 1997330f729Sjoerg bool UseXGOT = false; 2007330f729Sjoerg 2017330f729Sjoerg /// The minimum alignment known to hold of the stack frame on 2027330f729Sjoerg /// entry to the function and which must be maintained by every function. 2037330f729Sjoerg Align stackAlignment; 2047330f729Sjoerg 2057330f729Sjoerg /// The overridden stack alignment. 2067330f729Sjoerg MaybeAlign StackAlignOverride; 2077330f729Sjoerg 2087330f729Sjoerg InstrItineraryData InstrItins; 2097330f729Sjoerg 2107330f729Sjoerg // We can override the determination of whether we are in mips16 mode 2117330f729Sjoerg // as from the command line 2127330f729Sjoerg enum {NoOverride, Mips16Override, NoMips16Override} OverrideMode; 2137330f729Sjoerg 2147330f729Sjoerg const MipsTargetMachine &TM; 2157330f729Sjoerg 2167330f729Sjoerg Triple TargetTriple; 2177330f729Sjoerg 2187330f729Sjoerg const SelectionDAGTargetInfo TSInfo; 2197330f729Sjoerg std::unique_ptr<const MipsInstrInfo> InstrInfo; 2207330f729Sjoerg std::unique_ptr<const MipsFrameLowering> FrameLowering; 2217330f729Sjoerg std::unique_ptr<const MipsTargetLowering> TLInfo; 2227330f729Sjoerg 2237330f729Sjoerg public: 2247330f729Sjoerg bool isPositionIndependent() const; 2257330f729Sjoerg /// This overrides the PostRAScheduler bit in the SchedModel for each CPU. 2267330f729Sjoerg bool enablePostRAScheduler() const override; 2277330f729Sjoerg void getCriticalPathRCs(RegClassVector &CriticalPathRCs) const override; 2287330f729Sjoerg CodeGenOpt::Level getOptLevelToEnablePostRAScheduler() const override; 2297330f729Sjoerg 2307330f729Sjoerg bool isABI_N64() const; 2317330f729Sjoerg bool isABI_N32() const; 2327330f729Sjoerg bool isABI_O32() const; 2337330f729Sjoerg const MipsABIInfo &getABI() const; isABI_FPXX()2347330f729Sjoerg bool isABI_FPXX() const { return isABI_O32() && IsFPXX; } 2357330f729Sjoerg 2367330f729Sjoerg /// This constructor initializes the data members to match that 2377330f729Sjoerg /// of the specified triple. 2387330f729Sjoerg MipsSubtarget(const Triple &TT, StringRef CPU, StringRef FS, bool little, 2397330f729Sjoerg const MipsTargetMachine &TM, MaybeAlign StackAlignOverride); 2407330f729Sjoerg 2417330f729Sjoerg /// ParseSubtargetFeatures - Parses features string setting specified 2427330f729Sjoerg /// subtarget options. Definition of function is auto generated by tblgen. 243*82d56013Sjoerg void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS); 2447330f729Sjoerg hasMips1()2457330f729Sjoerg bool hasMips1() const { return MipsArchVersion >= Mips1; } hasMips2()2467330f729Sjoerg bool hasMips2() const { return MipsArchVersion >= Mips2; } hasMips3()2477330f729Sjoerg bool hasMips3() const { return MipsArchVersion >= Mips3; } hasMips4()2487330f729Sjoerg bool hasMips4() const { return MipsArchVersion >= Mips4; } hasMips5()2497330f729Sjoerg bool hasMips5() const { return MipsArchVersion >= Mips5; } hasMips4_32()2507330f729Sjoerg bool hasMips4_32() const { return HasMips4_32; } hasMips4_32r2()2517330f729Sjoerg bool hasMips4_32r2() const { return HasMips4_32r2; } hasMips32()2527330f729Sjoerg bool hasMips32() const { 2537330f729Sjoerg return (MipsArchVersion >= Mips32 && MipsArchVersion < Mips32Max) || 2547330f729Sjoerg hasMips64(); 2557330f729Sjoerg } hasMips32r2()2567330f729Sjoerg bool hasMips32r2() const { 2577330f729Sjoerg return (MipsArchVersion >= Mips32r2 && MipsArchVersion < Mips32Max) || 2587330f729Sjoerg hasMips64r2(); 2597330f729Sjoerg } hasMips32r3()2607330f729Sjoerg bool hasMips32r3() const { 2617330f729Sjoerg return (MipsArchVersion >= Mips32r3 && MipsArchVersion < Mips32Max) || 2627330f729Sjoerg hasMips64r2(); 2637330f729Sjoerg } hasMips32r5()2647330f729Sjoerg bool hasMips32r5() const { 2657330f729Sjoerg return (MipsArchVersion >= Mips32r5 && MipsArchVersion < Mips32Max) || 2667330f729Sjoerg hasMips64r5(); 2677330f729Sjoerg } hasMips32r6()2687330f729Sjoerg bool hasMips32r6() const { 2697330f729Sjoerg return (MipsArchVersion >= Mips32r6 && MipsArchVersion < Mips32Max) || 2707330f729Sjoerg hasMips64r6(); 2717330f729Sjoerg } hasMips64()2727330f729Sjoerg bool hasMips64() const { return MipsArchVersion >= Mips64; } hasMips64r2()2737330f729Sjoerg bool hasMips64r2() const { return MipsArchVersion >= Mips64r2; } hasMips64r3()2747330f729Sjoerg bool hasMips64r3() const { return MipsArchVersion >= Mips64r3; } hasMips64r5()2757330f729Sjoerg bool hasMips64r5() const { return MipsArchVersion >= Mips64r5; } hasMips64r6()2767330f729Sjoerg bool hasMips64r6() const { return MipsArchVersion >= Mips64r6; } 2777330f729Sjoerg hasCnMips()2787330f729Sjoerg bool hasCnMips() const { return HasCnMips; } hasCnMipsP()279*82d56013Sjoerg bool hasCnMipsP() const { return HasCnMipsP; } 2807330f729Sjoerg isLittle()2817330f729Sjoerg bool isLittle() const { return IsLittle; } isABICalls()2827330f729Sjoerg bool isABICalls() const { return !NoABICalls; } isFPXX()2837330f729Sjoerg bool isFPXX() const { return IsFPXX; } isFP64bit()2847330f729Sjoerg bool isFP64bit() const { return IsFP64bit; } useOddSPReg()2857330f729Sjoerg bool useOddSPReg() const { return UseOddSPReg; } noOddSPReg()2867330f729Sjoerg bool noOddSPReg() const { return !UseOddSPReg; } isNaN2008()2877330f729Sjoerg bool isNaN2008() const { return IsNaN2008bit; } inAbs2008Mode()2887330f729Sjoerg bool inAbs2008Mode() const { return Abs2008; } isGP64bit()2897330f729Sjoerg bool isGP64bit() const { return IsGP64bit; } isGP32bit()2907330f729Sjoerg bool isGP32bit() const { return !IsGP64bit; } getGPRSizeInBytes()2917330f729Sjoerg unsigned getGPRSizeInBytes() const { return isGP64bit() ? 8 : 4; } isPTR64bit()2927330f729Sjoerg bool isPTR64bit() const { return IsPTR64bit; } isPTR32bit()2937330f729Sjoerg bool isPTR32bit() const { return !IsPTR64bit; } hasSym32()2947330f729Sjoerg bool hasSym32() const { 2957330f729Sjoerg return (HasSym32 && isABI_N64()) || isABI_N32() || isABI_O32(); 2967330f729Sjoerg } isSingleFloat()2977330f729Sjoerg bool isSingleFloat() const { return IsSingleFloat; } isTargetELF()2987330f729Sjoerg bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); } hasVFPU()2997330f729Sjoerg bool hasVFPU() const { return HasVFPU; } inMips16Mode()3007330f729Sjoerg bool inMips16Mode() const { return InMips16Mode; } inMips16ModeDefault()3017330f729Sjoerg bool inMips16ModeDefault() const { 3027330f729Sjoerg return InMips16Mode; 3037330f729Sjoerg } 3047330f729Sjoerg // Hard float for mips16 means essentially to compile as soft float 3057330f729Sjoerg // but to use a runtime library for soft float that is written with 3067330f729Sjoerg // native mips32 floating point instructions (those runtime routines 3077330f729Sjoerg // run in mips32 hard float mode). inMips16HardFloat()3087330f729Sjoerg bool inMips16HardFloat() const { 3097330f729Sjoerg return inMips16Mode() && InMips16HardFloat; 3107330f729Sjoerg } inMicroMipsMode()3117330f729Sjoerg bool inMicroMipsMode() const { return InMicroMipsMode && !InMips16Mode; } inMicroMips32r6Mode()3127330f729Sjoerg bool inMicroMips32r6Mode() const { 3137330f729Sjoerg return inMicroMipsMode() && hasMips32r6(); 3147330f729Sjoerg } hasDSP()3157330f729Sjoerg bool hasDSP() const { return HasDSP; } hasDSPR2()3167330f729Sjoerg bool hasDSPR2() const { return HasDSPR2; } hasDSPR3()3177330f729Sjoerg bool hasDSPR3() const { return HasDSPR3; } has3D()318*82d56013Sjoerg bool has3D() const { return Has3D; } hasMSA()3197330f729Sjoerg bool hasMSA() const { return HasMSA; } disableMadd4()3207330f729Sjoerg bool disableMadd4() const { return DisableMadd4; } hasEVA()3217330f729Sjoerg bool hasEVA() const { return HasEVA; } hasMT()3227330f729Sjoerg bool hasMT() const { return HasMT; } hasCRC()3237330f729Sjoerg bool hasCRC() const { return HasCRC; } hasVirt()3247330f729Sjoerg bool hasVirt() const { return HasVirt; } hasGINV()3257330f729Sjoerg bool hasGINV() const { return HasGINV; } useIndirectJumpsHazard()3267330f729Sjoerg bool useIndirectJumpsHazard() const { 3277330f729Sjoerg return UseIndirectJumpsHazard && hasMips32r2(); 3287330f729Sjoerg } useSmallSection()3297330f729Sjoerg bool useSmallSection() const { return UseSmallSection; } 3307330f729Sjoerg hasStandardEncoding()3317330f729Sjoerg bool hasStandardEncoding() const { return !InMips16Mode && !InMicroMipsMode; } 3327330f729Sjoerg useSoftFloat()3337330f729Sjoerg bool useSoftFloat() const { return IsSoftFloat; } 3347330f729Sjoerg useLongCalls()3357330f729Sjoerg bool useLongCalls() const { return UseLongCalls; } 3367330f729Sjoerg useXGOT()3377330f729Sjoerg bool useXGOT() const { return UseXGOT; } 3387330f729Sjoerg enableLongBranchPass()3397330f729Sjoerg bool enableLongBranchPass() const { 3407330f729Sjoerg return hasStandardEncoding() || inMicroMipsMode() || allowMixed16_32(); 3417330f729Sjoerg } 3427330f729Sjoerg 3437330f729Sjoerg /// Features related to the presence of specific instructions. hasExtractInsert()3447330f729Sjoerg bool hasExtractInsert() const { return !inMips16Mode() && hasMips32r2(); } hasMTHC1()3457330f729Sjoerg bool hasMTHC1() const { return hasMips32r2(); } 3467330f729Sjoerg allowMixed16_32()3477330f729Sjoerg bool allowMixed16_32() const { return inMips16ModeDefault() | 3487330f729Sjoerg AllowMixed16_32; } 3497330f729Sjoerg os16()3507330f729Sjoerg bool os16() const { return Os16; } 3517330f729Sjoerg isTargetNaCl()3527330f729Sjoerg bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); } 3537330f729Sjoerg isXRaySupported()3547330f729Sjoerg bool isXRaySupported() const override { return true; } 3557330f729Sjoerg 3567330f729Sjoerg // for now constant islands are on for the whole compilation unit but we only 3577330f729Sjoerg // really use them if in addition we are in mips16 mode 3587330f729Sjoerg static bool useConstantIslands(); 3597330f729Sjoerg getStackAlignment()3607330f729Sjoerg Align getStackAlignment() const { return stackAlignment; } 3617330f729Sjoerg 3627330f729Sjoerg // Grab relocation model 3637330f729Sjoerg Reloc::Model getRelocationModel() const; 3647330f729Sjoerg 3657330f729Sjoerg MipsSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS, 3667330f729Sjoerg const TargetMachine &TM); 3677330f729Sjoerg 3687330f729Sjoerg /// Does the system support unaligned memory access. 3697330f729Sjoerg /// 3707330f729Sjoerg /// MIPS32r6/MIPS64r6 require full unaligned access support but does not 3717330f729Sjoerg /// specify which component of the system provides it. Hardware, software, and 3727330f729Sjoerg /// hybrid implementations are all valid. systemSupportsUnalignedAccess()3737330f729Sjoerg bool systemSupportsUnalignedAccess() const { return hasMips32r6(); } 3747330f729Sjoerg 3757330f729Sjoerg // Set helper classes 3767330f729Sjoerg void setHelperClassesMips16(); 3777330f729Sjoerg void setHelperClassesMipsSE(); 3787330f729Sjoerg getSelectionDAGInfo()3797330f729Sjoerg const SelectionDAGTargetInfo *getSelectionDAGInfo() const override { 3807330f729Sjoerg return &TSInfo; 3817330f729Sjoerg } getInstrInfo()3827330f729Sjoerg const MipsInstrInfo *getInstrInfo() const override { return InstrInfo.get(); } getFrameLowering()3837330f729Sjoerg const TargetFrameLowering *getFrameLowering() const override { 3847330f729Sjoerg return FrameLowering.get(); 3857330f729Sjoerg } getRegisterInfo()3867330f729Sjoerg const MipsRegisterInfo *getRegisterInfo() const override { 3877330f729Sjoerg return &InstrInfo->getRegisterInfo(); 3887330f729Sjoerg } getTargetLowering()3897330f729Sjoerg const MipsTargetLowering *getTargetLowering() const override { 3907330f729Sjoerg return TLInfo.get(); 3917330f729Sjoerg } getInstrItineraryData()3927330f729Sjoerg const InstrItineraryData *getInstrItineraryData() const override { 3937330f729Sjoerg return &InstrItins; 3947330f729Sjoerg } 3957330f729Sjoerg 3967330f729Sjoerg protected: 3977330f729Sjoerg // GlobalISel related APIs. 3987330f729Sjoerg std::unique_ptr<CallLowering> CallLoweringInfo; 3997330f729Sjoerg std::unique_ptr<LegalizerInfo> Legalizer; 4007330f729Sjoerg std::unique_ptr<RegisterBankInfo> RegBankInfo; 4017330f729Sjoerg std::unique_ptr<InstructionSelector> InstSelector; 4027330f729Sjoerg 4037330f729Sjoerg public: 4047330f729Sjoerg const CallLowering *getCallLowering() const override; 4057330f729Sjoerg const LegalizerInfo *getLegalizerInfo() const override; 4067330f729Sjoerg const RegisterBankInfo *getRegBankInfo() const override; 4077330f729Sjoerg InstructionSelector *getInstructionSelector() const override; 4087330f729Sjoerg }; 4097330f729Sjoerg } // End llvm namespace 4107330f729Sjoerg 4117330f729Sjoerg #endif 412