LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions | Variables
MipsISelLowering.cpp File Reference
#include "MipsISelLowering.h"
#include "InstPrinter/MipsInstPrinter.h"
#include "MCTargetDesc/MipsBaseInfo.h"
#include "MipsMachineFunction.h"
#include "MipsSubtarget.h"
#include "MipsTargetMachine.h"
#include "MipsTargetObjectFile.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/CodeGen/CallingConvLower.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <cctype>
#include "MipsGenCallingConv.inc"
Include dependency graph for MipsISelLowering.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "mips-lower"
 

Functions

 STATISTIC (NumTailCalls,"Number of tail calls")
 
static bool isShiftedMask (uint64_t I, uint64_t &Pos, uint64_t &Size)
 
static SDValue performDivRemCombine (SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget *Subtarget)
 
static Mips::CondCode condCodeToFCC (ISD::CondCode CC)
 
static bool invertFPCondCodeUser (Mips::CondCode CC)
 
static SDValue createFPCmp (SelectionDAG &DAG, const SDValue &Op)
 
static SDValue createCMovFP (SelectionDAG &DAG, SDValue Cond, SDValue True, SDValue False, SDLoc DL)
 
static SDValue performSELECTCombine (SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget *Subtarget)
 
static SDValue performANDCombine (SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget *Subtarget)
 
static SDValue performORCombine (SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget *Subtarget)
 
static SDValue performADDCombine (SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget *Subtarget)
 
static unsigned addLiveIn (MachineFunction &MF, unsigned PReg, const TargetRegisterClass *RC)
 
static MachineBasicBlockexpandPseudoDIV (MachineInstr *MI, MachineBasicBlock &MBB, const TargetInstrInfo &TII, bool Is64Bit)
 
static SDValue lowerFCOPYSIGN32 (SDValue Op, SelectionDAG &DAG, bool HasExtractInsert)
 
static SDValue lowerFCOPYSIGN64 (SDValue Op, SelectionDAG &DAG, bool HasExtractInsert)
 
static SDValue lowerFABS32 (SDValue Op, SelectionDAG &DAG, bool HasExtractInsert)
 
static SDValue lowerFABS64 (SDValue Op, SelectionDAG &DAG, bool HasExtractInsert)
 
static SDValue createLoadLR (unsigned Opc, SelectionDAG &DAG, LoadSDNode *LD, SDValue Chain, SDValue Src, unsigned Offset)
 
static SDValue createStoreLR (unsigned Opc, SelectionDAG &DAG, StoreSDNode *SD, SDValue Chain, unsigned Offset)
 
static SDValue lowerUnalignedIntStore (StoreSDNode *SD, SelectionDAG &DAG, bool IsLittle)
 
static SDValue lowerFP_TO_SINT_STORE (StoreSDNode *SD, SelectionDAG &DAG)
 
static bool CC_MipsO32 (unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State, const uint16_t *F64Regs)
 
static bool CC_MipsO32_FP32 (unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
 
static bool CC_MipsO32_FP64 (unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
 
static unsigned getNextIntArgReg (unsigned Reg)
 
static std::pair< bool, boolparsePhysicalReg (const StringRef &C, std::string &Prefix, unsigned long long &Reg)
 
static bool isF128SoftLibCall (const char *CallSym)
 This function returns true if CallSym is a long double emulation routine. More...
 
static bool originalTypeIsF128 (const Type *Ty, const SDNode *CallNode)
 

Variables

static cl::opt< boolLargeGOT ("mxgot", cl::Hidden, cl::desc("MIPS: Enable GOT larger than 64k."), cl::init(false))
 
static cl::opt< boolNoZeroDivCheck ("mno-check-zero-division", cl::Hidden, cl::desc("MIPS: Don't trap on integer division by zero."), cl::init(false))
 
static const uint16_t O32IntRegs [4]
 
static const uint16_t Mips64IntRegs [8]
 
static const uint16_t Mips64DPRegs [8]
 

Macro Definition Documentation

#define DEBUG_TYPE   "mips-lower"

Definition at line 14 of file MipsISelLowering.cpp.

Function Documentation

static unsigned addLiveIn ( MachineFunction MF,
unsigned  PReg,
const TargetRegisterClass RC 
)
static
static bool CC_MipsO32 ( unsigned  ValNo,
MVT  ValVT,
MVT  LocVT,
CCValAssign::LocInfo  LocInfo,
ISD::ArgFlagsTy  ArgFlags,
CCState State,
const uint16_t *  F64Regs 
)
static
static bool CC_MipsO32_FP32 ( unsigned  ValNo,
MVT  ValVT,
MVT  LocVT,
CCValAssign::LocInfo  LocInfo,
ISD::ArgFlagsTy  ArgFlags,
CCState State 
)
static

Definition at line 2200 of file MipsISelLowering.cpp.

References CC_MipsO32().

static bool CC_MipsO32_FP64 ( unsigned  ValNo,
MVT  ValVT,
MVT  LocVT,
CCValAssign::LocInfo  LocInfo,
ISD::ArgFlagsTy  ArgFlags,
CCState State 
)
static

Definition at line 2208 of file MipsISelLowering.cpp.

References CC_MipsO32().

static Mips::CondCode condCodeToFCC ( ISD::CondCode  CC)
static
static SDValue createCMovFP ( SelectionDAG DAG,
SDValue  Cond,
SDValue  True,
SDValue  False,
SDLoc  DL 
)
static
static SDValue createFPCmp ( SelectionDAG DAG,
const SDValue Op 
)
static
static SDValue createLoadLR ( unsigned  Opc,
SelectionDAG DAG,
LoadSDNode LD,
SDValue  Chain,
SDValue  Src,
unsigned  Offset 
)
static
static SDValue createStoreLR ( unsigned  Opc,
SelectionDAG DAG,
StoreSDNode SD,
SDValue  Chain,
unsigned  Offset 
)
static
static MachineBasicBlock* expandPseudoDIV ( MachineInstr MI,
MachineBasicBlock MBB,
const TargetInstrInfo TII,
bool  Is64Bit 
)
static
static unsigned getNextIntArgReg ( unsigned  Reg)
static

Definition at line 2223 of file MipsISelLowering.cpp.

static bool invertFPCondCodeUser ( Mips::CondCode  CC)
static

This function returns true if the floating point conditional branches and conditional moves which use condition code CC should be inverted.

Definition at line 476 of file MipsISelLowering.cpp.

References llvm::Mips::FCOND_F, llvm::Mips::FCOND_GT, llvm::Mips::FCOND_NGT, and llvm::Mips::FCOND_T.

Referenced by createCMovFP().

static bool isF128SoftLibCall ( const char *  CallSym)
static

This function returns true if CallSym is a long double emulation routine.

Definition at line 3172 of file MipsISelLowering.cpp.

References llvm::array_lengthof(), and I.

Referenced by originalTypeIsF128().

static bool isShiftedMask ( uint64_t  I,
uint64_t &  Pos,
uint64_t &  Size 
)
static
static SDValue lowerFABS32 ( SDValue  Op,
SelectionDAG DAG,
bool  HasExtractInsert 
)
static
static SDValue lowerFABS64 ( SDValue  Op,
SelectionDAG DAG,
bool  HasExtractInsert 
)
static
static SDValue lowerFCOPYSIGN32 ( SDValue  Op,
SelectionDAG DAG,
bool  HasExtractInsert 
)
static
static SDValue lowerFCOPYSIGN64 ( SDValue  Op,
SelectionDAG DAG,
bool  HasExtractInsert 
)
static
static SDValue lowerFP_TO_SINT_STORE ( StoreSDNode SD,
SelectionDAG DAG 
)
static
static SDValue lowerUnalignedIntStore ( StoreSDNode SD,
SelectionDAG DAG,
bool  IsLittle 
)
static
static bool originalTypeIsF128 ( const Type Ty,
const SDNode CallNode 
)
static

This function returns true if Ty is fp128 or i128 which was originally a fp128.

Definition at line 3199 of file MipsISelLowering.cpp.

References llvm::ExternalSymbolSDNode::getSymbol(), isF128SoftLibCall(), llvm::Type::isFP128Ty(), and llvm::Type::isIntegerTy().

static std::pair<bool, bool> parsePhysicalReg ( const StringRef C,
std::string &  Prefix,
unsigned long long &  Reg 
)
static

This is a helper function to parse a physical register string and split it into non-numeric and numeric parts (Prefix and Reg). The first boolean flag that is returned indicates whether parsing was successful. The second flag is true if the numeric part exists.

Definition at line 2867 of file MipsISelLowering.cpp.

References llvm::StringRef::back(), llvm::StringRef::begin(), llvm::StringRef::end(), llvm::StringRef::front(), llvm::getAsUnsignedInteger(), I, and llvm::LibFunc::isdigit.

static SDValue performADDCombine ( SDNode N,
SelectionDAG DAG,
TargetLowering::DAGCombinerInfo DCI,
const MipsSubtarget Subtarget 
)
static
static SDValue performANDCombine ( SDNode N,
SelectionDAG DAG,
TargetLowering::DAGCombinerInfo DCI,
const MipsSubtarget Subtarget 
)
static
static SDValue performDivRemCombine ( SDNode N,
SelectionDAG DAG,
TargetLowering::DAGCombinerInfo DCI,
const MipsSubtarget Subtarget 
)
static
static SDValue performORCombine ( SDNode N,
SelectionDAG DAG,
TargetLowering::DAGCombinerInfo DCI,
const MipsSubtarget Subtarget 
)
static
static SDValue performSELECTCombine ( SDNode N,
SelectionDAG DAG,
TargetLowering::DAGCombinerInfo DCI,
const MipsSubtarget Subtarget 
)
static
STATISTIC ( NumTailCalls  ,
"Number of tail calls"   
)

Variable Documentation

cl::opt<bool> LargeGOT("mxgot", cl::Hidden, cl::desc("MIPS: Enable GOT larger than 64k."), cl::init(false))
static
const uint16_t Mips64DPRegs[8]
static
Initial value:
= {
Mips::D12_64, Mips::D13_64, Mips::D14_64, Mips::D15_64,
Mips::D16_64, Mips::D17_64, Mips::D18_64, Mips::D19_64
}

Definition at line 62 of file MipsISelLowering.cpp.

const uint16_t Mips64IntRegs[8]
static
Initial value:
= {
Mips::A0_64, Mips::A1_64, Mips::A2_64, Mips::A3_64,
Mips::T0_64, Mips::T1_64, Mips::T2_64, Mips::T3_64
}

Definition at line 57 of file MipsISelLowering.cpp.

Referenced by llvm::MipsTargetLowering::MipsCC::intArgRegs(), and llvm::MipsTargetLowering::MipsCC::numIntArgRegs().

cl::opt<bool> NoZeroDivCheck("mno-check-zero-division", cl::Hidden, cl::desc("MIPS: Don't trap on integer division by zero."), cl::init(false))
static

Referenced by expandPseudoDIV().

const uint16_t O32IntRegs[4]
static
Initial value:
= {
Mips::A0, Mips::A1, Mips::A2, Mips::A3
}

Definition at line 53 of file MipsISelLowering.cpp.

Referenced by llvm::MipsTargetLowering::MipsCC::intArgRegs(), and llvm::MipsTargetLowering::MipsCC::numIntArgRegs().