LLVM API Documentation

MipsSEISelLowering.h
Go to the documentation of this file.
00001 //===-- MipsSEISelLowering.h - MipsSE DAG Lowering Interface ----*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // Subclass of MipsTargetLowering specialized for mips32/64.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_LIB_TARGET_MIPS_MIPSSEISELLOWERING_H
00015 #define LLVM_LIB_TARGET_MIPS_MIPSSEISELLOWERING_H
00016 
00017 #include "MipsISelLowering.h"
00018 #include "MipsRegisterInfo.h"
00019 
00020 namespace llvm {
00021   class MipsSETargetLowering : public MipsTargetLowering  {
00022   public:
00023     explicit MipsSETargetLowering(MipsTargetMachine &TM,
00024                                   const MipsSubtarget &STI);
00025 
00026     /// \brief Enable MSA support for the given integer type and Register
00027     /// class.
00028     void addMSAIntType(MVT::SimpleValueType Ty, const TargetRegisterClass *RC);
00029     /// \brief Enable MSA support for the given floating-point type and
00030     /// Register class.
00031     void addMSAFloatType(MVT::SimpleValueType Ty,
00032                          const TargetRegisterClass *RC);
00033 
00034     bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AS = 0,
00035                                         unsigned Align = 1,
00036                                         bool *Fast = nullptr) const override;
00037 
00038     SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
00039 
00040     SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
00041 
00042     MachineBasicBlock *
00043     EmitInstrWithCustomInserter(MachineInstr *MI,
00044                                 MachineBasicBlock *MBB) const override;
00045 
00046     bool isShuffleMaskLegal(const SmallVectorImpl<int> &Mask,
00047                             EVT VT) const override {
00048       return false;
00049     }
00050 
00051     const TargetRegisterClass *getRepRegClassFor(MVT VT) const override;
00052 
00053   private:
00054     bool isEligibleForTailCallOptimization(const MipsCC &MipsCCInfo,
00055                                      unsigned NextStackOffset,
00056                                      const MipsFunctionInfo& FI) const override;
00057 
00058     void
00059     getOpndList(SmallVectorImpl<SDValue> &Ops,
00060                 std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
00061                 bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage,
00062                 CallLoweringInfo &CLI, SDValue Callee,
00063                 SDValue Chain) const override;
00064 
00065     SDValue lowerLOAD(SDValue Op, SelectionDAG &DAG) const;
00066     SDValue lowerSTORE(SDValue Op, SelectionDAG &DAG) const;
00067 
00068     SDValue lowerMulDiv(SDValue Op, unsigned NewOpc, bool HasLo, bool HasHi,
00069                         SelectionDAG &DAG) const;
00070 
00071     SDValue lowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
00072     SDValue lowerINTRINSIC_W_CHAIN(SDValue Op, SelectionDAG &DAG) const;
00073     SDValue lowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG) const;
00074     SDValue lowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
00075     SDValue lowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const;
00076     /// \brief Lower VECTOR_SHUFFLE into one of a number of instructions
00077     /// depending on the indices in the shuffle.
00078     SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) const;
00079 
00080     MachineBasicBlock *emitBPOSGE32(MachineInstr *MI,
00081                                     MachineBasicBlock *BB) const;
00082     MachineBasicBlock *emitMSACBranchPseudo(MachineInstr *MI,
00083                                             MachineBasicBlock *BB,
00084                                             unsigned BranchOp) const;
00085     /// \brief Emit the COPY_FW pseudo instruction
00086     MachineBasicBlock *emitCOPY_FW(MachineInstr *MI,
00087                                    MachineBasicBlock *BB) const;
00088     /// \brief Emit the COPY_FD pseudo instruction
00089     MachineBasicBlock *emitCOPY_FD(MachineInstr *MI,
00090                                    MachineBasicBlock *BB) const;
00091     /// \brief Emit the INSERT_FW pseudo instruction
00092     MachineBasicBlock *emitINSERT_FW(MachineInstr *MI,
00093                                      MachineBasicBlock *BB) const;
00094     /// \brief Emit the INSERT_FD pseudo instruction
00095     MachineBasicBlock *emitINSERT_FD(MachineInstr *MI,
00096                                      MachineBasicBlock *BB) const;
00097     /// \brief Emit the INSERT_([BHWD]|F[WD])_VIDX pseudo instruction
00098     MachineBasicBlock *emitINSERT_DF_VIDX(MachineInstr *MI,
00099                                           MachineBasicBlock *BB,
00100                                           unsigned EltSizeInBytes,
00101                                           bool IsFP) const;
00102     /// \brief Emit the FILL_FW pseudo instruction
00103     MachineBasicBlock *emitFILL_FW(MachineInstr *MI,
00104                                    MachineBasicBlock *BB) const;
00105     /// \brief Emit the FILL_FD pseudo instruction
00106     MachineBasicBlock *emitFILL_FD(MachineInstr *MI,
00107                                    MachineBasicBlock *BB) const;
00108     /// \brief Emit the FEXP2_W_1 pseudo instructions.
00109     MachineBasicBlock *emitFEXP2_W_1(MachineInstr *MI,
00110                                      MachineBasicBlock *BB) const;
00111     /// \brief Emit the FEXP2_D_1 pseudo instructions.
00112     MachineBasicBlock *emitFEXP2_D_1(MachineInstr *MI,
00113                                      MachineBasicBlock *BB) const;
00114   };
00115 }
00116 
00117 #endif