LLVM API Documentation

Defines | 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/MachineJumpTableInfo.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.

Defines

#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 MachineBasicBlockinsertDivByZeroTrap (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 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 MCPhysReg *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 (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.
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))
cl::opt< boolEnableMipsFastISel ("mips-fast-isel", cl::Hidden, cl::desc("Allow mips-fast-isel to be used"), cl::init(false))
static const MCPhysReg O32IntRegs [4]
static const MCPhysReg Mips64IntRegs [8]
static const MCPhysReg Mips64DPRegs [8]

Define Documentation

#define DEBUG_TYPE   "mips-lower"

Definition at line 42 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 MCPhysReg 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 2360 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 2368 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 unsigned getNextIntArgReg ( unsigned  Reg) [static]

Definition at line 2383 of file MipsISelLowering.cpp.

static MachineBasicBlock* insertDivByZeroTrap ( MachineInstr MI,
MachineBasicBlock MBB,
const TargetInstrInfo TII,
bool  Is64Bit 
) [static]
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 501 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 3340 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 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 3367 of file MipsISelLowering.cpp.

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

static std::pair<bool, bool> parsePhysicalReg ( 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 3034 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> EnableMipsFastISel("mips-fast-isel", cl::Hidden, cl::desc("Allow mips-fast-isel to be used"), cl::init(false))
cl::opt<bool> LargeGOT("mxgot", cl::Hidden, cl::desc("MIPS: Enable GOT larger than 64k."), cl::init(false)) [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 69 of file MipsISelLowering.cpp.

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 64 of file MipsISelLowering.cpp.

Referenced by llvm::MipsTargetLowering::MipsCC::intArgRegs().

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 insertDivByZeroTrap().

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

Definition at line 60 of file MipsISelLowering.cpp.

Referenced by llvm::MipsTargetLowering::MipsCC::intArgRegs().