LLVM  5.0.0
Macros | Functions | Variables
MipsISelLowering.cpp File Reference
#include "MipsISelLowering.h"
#include "InstPrinter/MipsInstPrinter.h"
#include "MCTargetDesc/MipsBaseInfo.h"
#include "MipsCCState.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/FunctionLoweringInfo.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.

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)
 This function returns true if the floating point conditional branches and conditional moves which use condition code CC should be inverted. More...
 
static SDValue createFPCmp (SelectionDAG &DAG, const SDValue &Op)
 
static SDValue createCMovFP (SelectionDAG &DAG, SDValue Cond, SDValue True, SDValue False, const SDLoc &DL)
 
static SDValue performSELECTCombine (SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
 
static SDValue performCMovFPCombine (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 performMADD_MSUBCombine (SDNode *ROOTNode, SelectionDAG &CurDAG, const MipsSubtarget &Subtarget)
 
static SDValue performSUBCombine (SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
 
static SDValue performADDCombine (SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
 
static SDValue performAssertZextCombine (SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
 
static SDValue performSHLCombine (SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const MipsSubtarget &Subtarget)
 
static unsigned addLiveIn (MachineFunction &MF, unsigned PReg, const TargetRegisterClass *RC)
 
static MachineBasicBlock * insertDivByZeroTrap (MachineInstr &MI, MachineBasicBlock &MBB, const TargetInstrInfo &TII, bool Is64Bit, bool IsMicroMips)
 
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, ArrayRef< 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 bool CC_MipsO32 (unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State) LLVM_ATTRIBUTE_UNUSED
 
static unsigned getNextIntArgReg (unsigned Reg)
 
static SDValue UnpackFromArgumentSlot (SDValue Val, const CCValAssign &VA, EVT ArgVT, const SDLoc &DL, SelectionDAG &DAG)
 
static std::pair< bool, bool > parsePhysicalReg (StringRef C, StringRef &Prefix, unsigned long long &Reg)
 This is a helper function to parse a physical register string and split it into non-numeric and numeric parts (Prefix and Reg). More...
 

Variables

static cl::opt< bool > LargeGOT ("mxgot", cl::Hidden, cl::desc("MIPS: Enable GOT larger than 64k."), cl::init(false))
 
static 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 const MCPhysReg Mips64DPRegs [8]
 

Macro Definition Documentation

#define DEBUG_TYPE   "mips-lower"

Definition at line 44 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,
ArrayRef< MCPhysReg >  F64Regs 
)
static
static bool CC_MipsO32 ( unsigned  ValNo,
MVT  ValVT,
MVT  LocVT,
CCValAssign::LocInfo  LocInfo,
ISD::ArgFlagsTy  ArgFlags,
CCState &  State 
)
static
static bool CC_MipsO32_FP32 ( unsigned  ValNo,
MVT  ValVT,
MVT  LocVT,
CCValAssign::LocInfo  LocInfo,
ISD::ArgFlagsTy  ArgFlags,
CCState &  State 
)
static

Definition at line 2851 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 2859 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,
const 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 2878 of file MipsISelLowering.cpp.

References assert().

static MachineBasicBlock* insertDivByZeroTrap ( MachineInstr &  MI,
MachineBasicBlock &  MBB,
const TargetInstrInfo &  TII,
bool  Is64Bit,
bool  IsMicroMips 
)
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 609 of file MipsISelLowering.cpp.

References assert(), llvm::Mips::FCOND_F, llvm::Mips::FCOND_GT, llvm::Mips::FCOND_NGT, and llvm::Mips::FCOND_T.

Referenced by createCMovFP().

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 std::pair<bool, bool> parsePhysicalReg ( StringRef  C,
StringRef &  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 3749 of file MipsISelLowering.cpp.

References B, llvm::StringRef::back(), llvm::StringRef::begin(), E, llvm::StringRef::end(), llvm::find_if(), llvm::StringRef::front(), llvm::getAsUnsignedInteger(), and I.

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 performAssertZextCombine ( SDNode *  N,
SelectionDAG &  DAG,
TargetLowering::DAGCombinerInfo &  DCI,
const MipsSubtarget &  Subtarget 
)
static
static SDValue performCMovFPCombine ( 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 performMADD_MSUBCombine ( SDNode *  ROOTNode,
SelectionDAG &  CurDAG,
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
static SDValue performSHLCombine ( SDNode *  N,
SelectionDAG &  DAG,
TargetLowering::DAGCombinerInfo &  DCI,
const MipsSubtarget &  Subtarget 
)
static
static SDValue performSUBCombine ( SDNode *  N,
SelectionDAG &  DAG,
TargetLowering::DAGCombinerInfo &  DCI,
const MipsSubtarget &  Subtarget 
)
static
STATISTIC ( NumTailCalls  ,
"Number of tail calls"   
)
static SDValue UnpackFromArgumentSlot ( SDValue  Val,
const CCValAssign &  VA,
EVT  ArgVT,
const SDLoc &  DL,
SelectionDAG &  DAG 
)
static

Variable Documentation

cl::opt<bool> LargeGOT("mxgot", cl::Hidden, cl::desc("MIPS: Enable GOT larger than 64k."), cl::init(false))
static
const MCPhysReg 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 57 of file MipsISelLowering.cpp.

Referenced by llvm::MipsTargetLowering::HandleByVal().

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