LLVM
16.0.0git
|
#include "LoongArchISelLowering.h"
#include "LoongArch.h"
#include "LoongArchMachineFunctionInfo.h"
#include "LoongArchRegisterInfo.h"
#include "LoongArchSubtarget.h"
#include "LoongArchTargetMachine.h"
#include "MCTargetDesc/LoongArchMCTargetDesc.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/ISDOpcodes.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/KnownBits.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "loongarch-isel-lowering" |
#define | NODE_NAME_CASE(node) |
Variables | |
static cl::opt< bool > | ZeroDivCheck ("loongarch-check-zero-division", cl::Hidden, cl::desc("Trap on integer division by zero."), cl::init(false)) |
const MCPhysReg | ArgGPRs [] |
const MCPhysReg | ArgFPR32s [] |
const MCPhysReg | ArgFPR64s [] |
Definition at line 28 of file LoongArchISelLowering.cpp.
#define NODE_NAME_CASE | ( | node | ) |
|
static |
Definition at line 1046 of file LoongArchISelLowering.cpp.
References ABI, llvm::LoongArchABI::ABI_ILP32D, llvm::LoongArchABI::ABI_ILP32F, llvm::LoongArchABI::ABI_ILP32S, llvm::LoongArchABI::ABI_LP64D, llvm::LoongArchABI::ABI_LP64F, llvm::LoongArchABI::ABI_LP64S, llvm::CCState::addLoc(), Align, llvm::CCState::AllocateReg(), llvm::CCState::AllocateStack(), ArgFPR32s, ArgFPR64s, ArgGPRs, llvm::array_lengthof(), assert(), llvm::CCValAssign::BCvt, CC_LoongArchAssign2GRLen(), llvm::SmallVectorImpl< T >::clear(), DL, llvm::MVT::f32, llvm::MVT::f64, llvm::CCValAssign::Full, llvm::CCState::getFirstUnallocated(), llvm::CCValAssign::getMem(), llvm::ISD::ArgFlagsTy::getNonZeroOrigAlign(), llvm::CCValAssign::getPending(), llvm::CCState::getPendingArgFlags(), llvm::CCState::getPendingLocs(), llvm::CCValAssign::getReg(), llvm::MVT::i32, llvm::MVT::i64, llvm::CCValAssign::Indirect, llvm::MVT::isFloatingPoint(), llvm::MVT::isScalarInteger(), llvm::ISD::ArgFlagsTy::isSplit(), llvm::ISD::ArgFlagsTy::isSplitEnd(), llvm_unreachable, and llvm::report_fatal_error().
Referenced by llvm::LoongArchTargetLowering::CanLowerReturn(), llvm::LoongArchTargetLowering::LowerCall(), llvm::LoongArchTargetLowering::LowerFormalArguments(), and llvm::LoongArchTargetLowering::LowerReturn().
|
static |
Definition at line 1010 of file LoongArchISelLowering.cpp.
References llvm::CCState::addLoc(), Align, llvm::CCState::AllocateReg(), llvm::CCState::AllocateStack(), ArgGPRs, llvm::CCValAssign::Full, llvm::CCValAssign::getLocVT(), llvm::CCValAssign::getMem(), llvm::ISD::ArgFlagsTy::getNonZeroOrigAlign(), llvm::CCValAssign::getReg(), llvm::CCValAssign::getValNo(), llvm::CCValAssign::getValVT(), and llvm::max().
Referenced by CC_LoongArch().
|
static |
Definition at line 1236 of file LoongArchISelLowering.cpp.
References llvm::CCValAssign::BCvt, llvm::ISD::BITCAST, DL, llvm::MVT::f32, llvm::CCValAssign::Full, llvm::CCValAssign::getLocInfo(), llvm::CCValAssign::getLocVT(), llvm::SelectionDAG::getNode(), llvm::CCValAssign::getValVT(), llvm::MVT::i64, llvm::CCValAssign::Indirect, llvm_unreachable, and llvm::LoongArchISD::MOVGR2FR_W_LA64.
Referenced by llvm::LoongArchTargetLowering::LowerCall(), and unpackFromRegLoc().
|
static |
Definition at line 1296 of file LoongArchISelLowering.cpp.
References llvm::CCValAssign::BCvt, llvm::ISD::BITCAST, DL, llvm::MVT::f32, llvm::CCValAssign::Full, llvm::CCValAssign::getLocInfo(), llvm::CCValAssign::getLocVT(), llvm::SelectionDAG::getNode(), llvm::CCValAssign::getValVT(), llvm::MVT::i64, llvm_unreachable, and llvm::LoongArchISD::MOVFR2GR_S_LA64.
Referenced by llvm::LoongArchTargetLowering::LowerCall(), and llvm::LoongArchTargetLowering::LowerReturn().
|
static |
Definition at line 395 of file LoongArchISelLowering.cpp.
References DL, getLoongArchWOpcode(), llvm::SelectionDAG::getNode(), llvm::MVT::i64, llvm_unreachable, N, and llvm::ISD::TRUNCATE.
Referenced by llvm::LoongArchTargetLowering::ReplaceNodeResults().
|
static |
Definition at line 369 of file LoongArchISelLowering.cpp.
References llvm::LoongArchISD::CLZ_W, llvm::ISD::CTLZ, llvm::ISD::CTTZ, llvm::LoongArchISD::CTZ_W, llvm_unreachable, llvm::ISD::ROTL, llvm::LoongArchISD::ROTL_W, llvm::ISD::ROTR, llvm::LoongArchISD::ROTR_W, llvm::ISD::SHL, llvm::LoongArchISD::SLL_W, llvm::ISD::SRA, llvm::LoongArchISD::SRA_W, llvm::ISD::SRL, and llvm::LoongArchISD::SRL_W.
Referenced by customLegalizeToWOp().
|
static |
Definition at line 1437 of file LoongArchISelLowering.cpp.
References llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getDataLayout(), llvm::DataLayout::getPrefTypeAlign(), and llvm::EVT::getTypeForEVT().
Referenced by llvm::SelectionDAG::CreateStackTemporary(), and llvm::LoongArchTargetLowering::LowerCall().
|
static |
Definition at line 886 of file LoongArchISelLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::MachineBasicBlock::addSuccessor(), llvm::BuildMI(), llvm::MachineFunction::CreateMachineBasicBlock(), DL, llvm::MachineBasicBlock::end(), llvm::MachineBasicBlock::getBasicBlock(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::getKillRegState(), llvm::MachineBasicBlock::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::insert(), llvm::MachineOperand::isKill(), MBB, MI, llvm::MachineOperand::setIsKill(), TII, and ZeroDivCheck.
|
static |
Definition at line 531 of file LoongArchISelLowering.cpp.
References llvm::LoongArchISD::BSTRPICK, DL, llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::EVT::getSizeInBits(), llvm::ConstantSDNode::getZExtValue(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), llvm::isShiftedMask_64(), N, llvm::ISD::SRA, and llvm::ISD::SRL.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Definition at line 854 of file LoongArchISelLowering.cpp.
References llvm::LoongArchISD::BITREV_4B, llvm::SelectionDAG::getNode(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), N, and llvm::LoongArchISD::REVB_2W.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Definition at line 635 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, llvm::LoongArchISD::BSTRINS, llvm::SelectionDAG::computeKnownBits(), llvm::dbgs(), DL, llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::ConstantSDNode::getSExtValue(), llvm::EVT::getSizeInBits(), llvm::ConstantSDNode::getZExtValue(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), llvm::isShiftedMask_64(), llvm::APInt::isSubsetOf(), LLVM_DEBUG, N, llvm::ISD::SHL, llvm::ISD::SRL, std::swap(), and llvm::KnownBits::Zero.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Definition at line 594 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, llvm::LoongArchISD::BSTRPICK, DL, llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::ConstantSDNode::getZExtValue(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), llvm::isShiftedMask_64(), and N.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Definition at line 1271 of file LoongArchISelLowering.cpp.
References llvm::CCValAssign::BCvt, llvm::MachineFrameInfo::CreateFixedObject(), DL, llvm::CCValAssign::Full, llvm::SelectionDAG::getDataLayout(), llvm::SelectionDAG::getExtLoad(), llvm::MachinePointerInfo::getFixedStack(), llvm::SelectionDAG::getFrameIndex(), llvm::MachineFunction::getFrameInfo(), llvm::MVT::getIntegerVT(), llvm::CCValAssign::getLocInfo(), llvm::CCValAssign::getLocMemOffset(), llvm::CCValAssign::getLocVT(), llvm::SelectionDAG::getMachineFunction(), llvm::DataLayout::getPointerSizeInBits(), llvm::EVT::getStoreSize(), llvm::CCValAssign::getValVT(), llvm::CCValAssign::Indirect, llvm_unreachable, and llvm::ISD::NON_EXTLOAD.
Referenced by llvm::LoongArchTargetLowering::LowerFormalArguments().
|
static |
Definition at line 1254 of file LoongArchISelLowering.cpp.
References llvm::MachineRegisterInfo::addLiveIn(), convertLocVTToValVT(), llvm::MachineRegisterInfo::createVirtualRegister(), DL, llvm::SelectionDAG::getCopyFromReg(), llvm::CCValAssign::getLocReg(), llvm::CCValAssign::getLocVT(), llvm::SelectionDAG::getMachineFunction(), llvm::TargetLoweringBase::getRegClassFor(), llvm::MachineFunction::getRegInfo(), and llvm::EVT::getSimpleVT().
Referenced by llvm::LoongArchTargetLowering::LowerFormalArguments().
const MCPhysReg ArgFPR32s[] |
Definition at line 1000 of file LoongArchISelLowering.cpp.
Referenced by CC_LoongArch().
const MCPhysReg ArgFPR64s[] |
Definition at line 1004 of file LoongArchISelLowering.cpp.
Referenced by CC_LoongArch().
const MCPhysReg ArgGPRs[] |
Definition at line 995 of file LoongArchISelLowering.cpp.
Referenced by llvm::CC_CSKY_ABIV2_SOFT_64(), CC_LoongArch(), CC_LoongArchAssign2GRLen(), llvm::LoongArchTargetLowering::LowerFormalArguments(), and llvm::Ret_CSKY_ABIV2_SOFT_64().