LLVM  8.0.1
Macros | Functions | Variables
RISCVISelLowering.cpp File Reference
#include "RISCVISelLowering.h"
#include "RISCV.h"
#include "RISCVMachineFunctionInfo.h"
#include "RISCVRegisterInfo.h"
#include "RISCVSubtarget.h"
#include "RISCVTargetMachine.h"
#include "llvm/ADT/Statistic.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/TargetLoweringObjectFileImpl.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/DiagnosticPrinter.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
Include dependency graph for RISCVISelLowering.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "riscv-lower"
 

Functions

 STATISTIC (NumTailCalls, "Number of tail calls")
 
static void normaliseSetCC (SDValue &LHS, SDValue &RHS, ISD::CondCode &CC)
 
static unsigned getBranchOpcodeForIntCondCode (ISD::CondCode CC)
 
static bool isVariableShift (SDValue Val)
 
static bool isVariableSDivUDivURem (SDValue Val)
 
static MachineBasicBlockemitSplitF64Pseudo (MachineInstr &MI, MachineBasicBlock *BB)
 
static MachineBasicBlockemitBuildPairF64Pseudo (MachineInstr &MI, MachineBasicBlock *BB)
 
static bool CC_RISCVAssign2XLen (unsigned XLen, CCState &State, CCValAssign VA1, ISD::ArgFlagsTy ArgFlags1, unsigned ValNo2, MVT ValVT2, MVT LocVT2, ISD::ArgFlagsTy ArgFlags2)
 
static bool CC_RISCV (const DataLayout &DL, unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State, bool IsFixed, bool IsRet, Type *OrigTy)
 
static SDValue convertLocVTToValVT (SelectionDAG &DAG, SDValue Val, const CCValAssign &VA, const SDLoc &DL)
 
static SDValue unpackFromRegLoc (SelectionDAG &DAG, SDValue Chain, const CCValAssign &VA, const SDLoc &DL)
 
static SDValue convertValVTToLocVT (SelectionDAG &DAG, SDValue Val, const CCValAssign &VA, const SDLoc &DL)
 
static SDValue unpackFromMemLoc (SelectionDAG &DAG, SDValue Chain, const CCValAssign &VA, const SDLoc &DL)
 
static SDValue unpackF64OnRV32DSoftABI (SelectionDAG &DAG, SDValue Chain, const CCValAssign &VA, const SDLoc &DL)
 
static Intrinsic::ID getIntrinsicForMaskedAtomicRMWBinOp32 (AtomicRMWInst::BinOp BinOp)
 

Variables

static const MCPhysReg ArgGPRs []
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "riscv-lower"

Definition at line 38 of file RISCVISelLowering.cpp.

Function Documentation

◆ CC_RISCV()

static bool CC_RISCV ( const DataLayout DL,
unsigned  ValNo,
MVT  ValVT,
MVT  LocVT,
CCValAssign::LocInfo  LocInfo,
ISD::ArgFlagsTy  ArgFlags,
CCState State,
bool  IsFixed,
bool  IsRet,
Type OrigTy 
)
static

◆ CC_RISCVAssign2XLen()

static bool CC_RISCVAssign2XLen ( unsigned  XLen,
CCState State,
CCValAssign  VA1,
ISD::ArgFlagsTy  ArgFlags1,
unsigned  ValNo2,
MVT  ValVT2,
MVT  LocVT2,
ISD::ArgFlagsTy  ArgFlags2 
)
static

◆ convertLocVTToValVT()

static SDValue convertLocVTToValVT ( SelectionDAG DAG,
SDValue  Val,
const CCValAssign VA,
const SDLoc DL 
)
static

◆ convertValVTToLocVT()

static SDValue convertValVTToLocVT ( SelectionDAG DAG,
SDValue  Val,
const CCValAssign VA,
const SDLoc DL 
)
static

◆ emitBuildPairF64Pseudo()

static MachineBasicBlock* emitBuildPairF64Pseudo ( MachineInstr MI,
MachineBasicBlock BB 
)
static

◆ emitSplitF64Pseudo()

static MachineBasicBlock* emitSplitF64Pseudo ( MachineInstr MI,
MachineBasicBlock BB 
)
static

◆ getBranchOpcodeForIntCondCode()

static unsigned getBranchOpcodeForIntCondCode ( ISD::CondCode  CC)
static

◆ getIntrinsicForMaskedAtomicRMWBinOp32()

static Intrinsic::ID getIntrinsicForMaskedAtomicRMWBinOp32 ( AtomicRMWInst::BinOp  BinOp)
static

◆ isVariableSDivUDivURem()

static bool isVariableSDivUDivURem ( SDValue  Val)
static

◆ isVariableShift()

static bool isVariableShift ( SDValue  Val)
static

◆ normaliseSetCC()

static void normaliseSetCC ( SDValue LHS,
SDValue RHS,
ISD::CondCode CC 
)
static

◆ STATISTIC()

STATISTIC ( NumTailCalls  ,
"Number of tail calls  
)

◆ unpackF64OnRV32DSoftABI()

static SDValue unpackF64OnRV32DSoftABI ( SelectionDAG DAG,
SDValue  Chain,
const CCValAssign VA,
const SDLoc DL 
)
static

Definition at line 1052 of file RISCVISelLowering.cpp.

References llvm::ISD::ADD, llvm::MachineRegisterInfo::addLiveIn(), llvm::Address, llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, Arg, llvm::Function::arg_empty(), ArgGPRs, assert(), llvm::RISCVISD::BuildPairF64, llvm::CallingConv::C, llvm::RISCVISD::CALL, Callee, CC_RISCV(), Context, convertLocVTToValVT(), convertValVTToLocVT(), llvm::MachineFrameInfo::CreateFixedObject(), llvm::MachineFrameInfo::CreateStackObject(), llvm::SelectionDAG::CreateStackTemporary(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::SmallVectorBase::empty(), llvm::MVT::f64, false, llvm::CallingConv::Fast, llvm::CCValAssign::Full, G, llvm::ISD::ArgFlagsTy::getByValAlign(), llvm::ISD::ArgFlagsTy::getByValSize(), llvm::RISCVRegisterInfo::getCallPreservedMask(), llvm::TargetRegisterInfo::getCallPreservedMask(), llvm::SelectionDAG::getCALLSEQ_END(), llvm::SelectionDAG::getCALLSEQ_START(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getCopyFromReg(), llvm::SelectionDAG::getCopyToReg(), llvm::SelectionDAG::getDataLayout(), llvm::MachineFunction::getDataLayout(), llvm::CCState::getFirstUnallocated(), llvm::MachinePointerInfo::getFixedStack(), llvm::Function::getFnAttribute(), llvm::SelectionDAG::getFrameIndex(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::SelectionDAG::getIntPtrConstant(), llvm::SelectionDAG::getLoad(), llvm::CCValAssign::getLocInfo(), llvm::CCValAssign::getLocMemOffset(), llvm::CCValAssign::getLocReg(), llvm::CCValAssign::getLocVT(), llvm::SelectionDAG::getMachineFunction(), llvm::SelectionDAG::getMemcpy(), llvm::CCState::getNextStackOffset(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::TargetLoweringBase::getPointerTy(), llvm::MachineFunction::getRegInfo(), llvm::SelectionDAG::getRegister(), llvm::RISCVSubtarget::getRegisterInfo(), llvm::SelectionDAG::getRegisterMask(), llvm::Function::getReturnType(), llvm::SelectionDAG::getStore(), llvm::SelectionDAG::getTargetExternalSymbol(), llvm::SelectionDAG::getTargetGlobalAddress(), llvm::SDValue::getValue(), llvm::Attribute::getValueAsString(), llvm::CCValAssign::getValVT(), llvm::SelectionDAG::getVTList(), llvm::RISCVSubtarget::getXLen(), llvm::RISCVSubtarget::getXLenVT(), llvm::MVT::Glue, llvm::GlobalValue::hasExternalWeakLinkage(), llvm::Function::hasFnAttribute(), llvm::MipsISD::Hi, I, llvm::MVT::i32, llvm::CCValAssign::Indirect, llvm::ISD::ArgFlagsTy::isByVal(), llvm::CCValAssign::isMemLoc(), llvm::CCValAssign::isRegLoc(), llvm::Type::isVoidTy(), Kind, llvm::MipsISD::Lo, llvm::makeArrayRef(), llvm::BitmaskEnumDetail::Mask(), llvm::RISCVISD::MRET_FLAG, llvm::MVT::Other, llvm::SmallVectorTemplateBase< T >::push_back(), Reg, llvm::report_fatal_error(), llvm::RISCVISD::RET_FLAG, llvm::MachineFrameInfo::setHasTailCall(), llvm::RISCVMachineFunctionInfo::setVarArgsFrameIndex(), llvm::RISCVMachineFunctionInfo::setVarArgsSaveSize(), Size, llvm::SmallVectorBase::size(), llvm::ArrayRef< T >::size(), llvm::RISCVISD::SplitF64, llvm::RISCVISD::SRET_FLAG, llvm::SPII::Store, llvm::RISCVISD::TAIL, llvm::ISD::TokenFactor, TRI, unpackFromMemLoc(), unpackFromRegLoc(), and llvm::RISCVISD::URET_FLAG.

◆ unpackFromMemLoc()

static SDValue unpackFromMemLoc ( SelectionDAG DAG,
SDValue  Chain,
const CCValAssign VA,
const SDLoc DL 
)
static

◆ unpackFromRegLoc()

static SDValue unpackFromRegLoc ( SelectionDAG DAG,
SDValue  Chain,
const CCValAssign VA,
const SDLoc DL 
)
static

Variable Documentation

◆ ArgGPRs

const MCPhysReg ArgGPRs[]
static
Initial value:
= {
RISCV::X10, RISCV::X11, RISCV::X12, RISCV::X13,
RISCV::X14, RISCV::X15, RISCV::X16, RISCV::X17
}

Definition at line 758 of file RISCVISelLowering.cpp.

Referenced by CC_RISCV(), CC_RISCVAssign2XLen(), isSortedByValueNo(), and unpackF64OnRV32DSoftABI().