LLVM 20.0.0git
|
#include "MipsSEISelLowering.h"
#include "MipsMachineFunction.h"
#include "MipsRegisterInfo.h"
#include "MipsSubtarget.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/CallingConvLower.h"
#include "llvm/CodeGen/ISDOpcodes.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/SelectionDAGNodes.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/CodeGenTypes/MachineValueType.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/IntrinsicsMips.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/Triple.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <iterator>
#include <utility>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "mips-isel" |
Variables | |
static cl::opt< bool > | UseMipsTailCalls ("mips-tail-calls", cl::Hidden, cl::desc("MIPS: permit tail calls."), cl::init(false)) |
static cl::opt< bool > | NoDPLoadStore ("mno-ldc1-sdc1", cl::init(false), cl::desc("Expand double precision loads and " "stores to their single precision " "counterparts")) |
#define DEBUG_TYPE "mips-isel" |
Definition at line 52 of file MipsSEISelLowering.cpp.
|
static |
Definition at line 1290 of file MipsSEISelLowering.cpp.
References llvm::ISD::BUILD_PAIR, DL, llvm::SelectionDAG::getNode(), llvm::Hi, llvm::Lo, llvm::MipsISD::MFHI, and llvm::MipsISD::MFLO.
Referenced by lowerDSPIntr().
|
static |
Determine whether a range fits a regular pattern of values.
This function accounts for the possibility of jumping over the End iterator.
Definition at line 2602 of file MipsSEISelLowering.cpp.
|
static |
Definition at line 792 of file MipsSEISelLowering.cpp.
References llvm::ISD::ADD, llvm::BitWidth, llvm::CallingConv::C, DL, genConstMult(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::ISD::SHL, llvm::ISD::SUB, and X.
Referenced by genConstMult(), and performMULCombine().
|
static |
Definition at line 1422 of file MipsSEISelLowering.cpp.
References llvm::ISD::BITCAST, DL, llvm::SelectionDAG::getBuildVector(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::EVT::getVectorNumElements(), llvm::ISD::SRL, std::swap(), and llvm::ISD::TRUNCATE.
Referenced by lowerMSABinaryBitImmIntr(), and truncateVecElts().
|
static |
Definition at line 1284 of file MipsSEISelLowering.cpp.
References DL, llvm::SelectionDAG::getNode(), llvm::MipsISD::MTLOHI, and llvm::SelectionDAG::SplitScalar().
Referenced by lowerDSPIntr().
Definition at line 577 of file MipsSEISelLowering.cpp.
References isVectorAllOnes(), N, and llvm::ISD::XOR.
Referenced by performORCombine().
Definition at line 2424 of file MipsSEISelLowering.cpp.
|
static |
Definition at line 2434 of file MipsSEISelLowering.cpp.
References llvm::DWARFExpression::Operation::getNumOperands(), and isConstantOrUndef().
|
static |
Definition at line 949 of file MipsSEISelLowering.cpp.
References CC, llvm::ISD::SETEQ, llvm::ISD::SETGE, llvm::ISD::SETGT, llvm::ISD::SETLE, llvm::ISD::SETLT, llvm::ISD::SETNE, llvm::ISD::SETUGE, llvm::ISD::SETUGT, llvm::ISD::SETULE, and llvm::ISD::SETULT.
Referenced by performSETCCCombine().
|
static |
Definition at line 2629 of file MipsSEISelLowering.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), and llvm::SmallVectorBase< Size_T >::size().
Definition at line 553 of file MipsSEISelLowering.cpp.
References llvm::ISD::BITCAST, llvm::APInt::isAllOnes(), llvm::BuildVectorSDNode::isConstantSplat(), and N.
Referenced by isBitwiseInverse().
Definition at line 533 of file MipsSEISelLowering.cpp.
References N.
Referenced by performORCombine().
|
static |
Definition at line 1308 of file MipsSEISelLowering.cpp.
References assert(), DL, extractLOHI(), llvm::SelectionDAG::getMergeValues(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::DWARFExpression::Operation::getNumOperands(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), initAccumulator(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::ISD::TargetConstant.
|
static |
Definition at line 1458 of file MipsSEISelLowering.cpp.
References llvm::ISD::BITCAST, DL, llvm::SelectionDAG::getBuildVector(), getBuildVectorSplat(), llvm::SelectionDAG::getConstant(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::APInt::lshr(), llvm::ISD::SHL, std::swap(), llvm::APInt::trunc(), and llvm::ISD::ZERO_EXTEND.
|
static |
Definition at line 1515 of file MipsSEISelLowering.cpp.
References llvm::ISD::AND, DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getNOT(), llvm::ISD::SHL, and truncateVecElts().
|
static |
Definition at line 1525 of file MipsSEISelLowering.cpp.
References llvm::ISD::AND, DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), and llvm::EVT::getScalarSizeInBits().
|
static |
Definition at line 1356 of file MipsSEISelLowering.cpp.
References DL, llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getValueType(), llvm::SDNode::getValueType(), llvm::EVT::getVectorElementType(), and Idx.
|
static |
Definition at line 2288 of file MipsSEISelLowering.cpp.
References llvm::ISD::ADD, llvm::Address, DL, llvm::SelectionDAG::getLoad(), llvm::SelectionDAG::getNode(), llvm::MipsSubtarget::isABI_N64(), llvm::Offset, and llvm::ISD::SIGN_EXTEND.
|
static |
Definition at line 1413 of file MipsSEISelLowering.cpp.
References llvm::SelectionDAG::getConstant().
|
static |
Definition at line 1369 of file MipsSEISelLowering.cpp.
References llvm::ISD::AND, llvm::ISD::BITCAST, DL, llvm::SelectionDAG::getBuildVector(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getSubtarget(), llvm::MCSubtargetInfo::getTargetTriple(), llvm::EVT::getVectorNumElements(), llvm::Triple::isLittleEndian(), and std::swap().
|
static |
Definition at line 2362 of file MipsSEISelLowering.cpp.
References llvm::ISD::ADD, llvm::Address, DL, llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getStore(), llvm::MipsSubtarget::isABI_N64(), llvm::Offset, and llvm::ISD::SIGN_EXTEND.
|
static |
|
static |
Definition at line 2801 of file MipsSEISelLowering.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), End, llvm::SelectionDAG::getNode(), llvm::MipsISD::ILVL, and llvm::SmallVectorBase< Size_T >::size().
|
static |
|
static |
Definition at line 2754 of file MipsSEISelLowering.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), End, llvm::SelectionDAG::getNode(), llvm::MipsISD::ILVR, and llvm::SmallVectorBase< Size_T >::size().
|
static |
|
static |
|
static |
Definition at line 2548 of file MipsSEISelLowering.cpp.
References DL, llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getTargetConstant(), Idx, llvm::MipsISD::SHF, and llvm::SmallVectorBase< Size_T >::size().
|
static |
Definition at line 2928 of file MipsSEISelLowering.cpp.
References llvm::EVT::changeVectorElementTypeToInteger(), DL, llvm::SelectionDAG::getBuildVector(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getTargetConstant(), llvm::EVT::getVectorElementType(), llvm::EVT::getVectorNumElements(), Idx, llvm_unreachable, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::MipsISD::VSHF.
|
static |
Definition at line 481 of file MipsSEISelLowering.cpp.
References llvm::SelectionDAG::getNode(), llvm::SDNode::getNumOperands(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::EVT::getSizeInBits(), llvm::SDNode::getVTList(), llvm::MipsSubtarget::hasMSA(), llvm::Log2(), N, llvm::MipsISD::VEXTRACT_SEXT_ELT, and llvm::MipsISD::VEXTRACT_ZEXT_ELT.
|
static |
Definition at line 844 of file MipsSEISelLowering.cpp.
References DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::EVT::getScalarSizeInBits(), llvm::APInt::getZExtValue(), llvm::MipsSubtarget::hasDSP(), llvm::BuildVectorSDNode::isConstantSplat(), llvm::MipsSubtarget::isLittle(), and N.
Referenced by performSHLCombine(), performSRACombine(), and performSRLCombine().
|
static |
Definition at line 828 of file MipsSEISelLowering.cpp.
References llvm::CallingConv::C, genConstMult(), llvm::SelectionDAG::getDataLayout(), llvm::MipsTargetLowering::getScalarShiftAmountTy(), llvm::EVT::isVector(), N, and shouldTransformMulToShiftsAddsSubs().
Referenced by llvm::MipsSETargetLowering::PerformDAGCombine(), and llvm::RISCVTargetLowering::PerformDAGCombine().
|
static |
Definition at line 596 of file MipsSEISelLowering.cpp.
References llvm::ISD::AND, assert(), Cond, llvm::APInt::getBitWidth(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::MipsSubtarget::hasMSA(), llvm::EVT::is128BitVector(), isBitwiseInverse(), llvm::MipsSubtarget::isLittle(), isVSplat(), N, and llvm::ISD::VSELECT.
|
static |
Definition at line 967 of file MipsSEISelLowering.cpp.
References llvm::SelectionDAG::getNode(), isLegalDSPCondCode(), N, and llvm::MipsISD::SETCC_DSP.
|
static |
Definition at line 869 of file MipsSEISelLowering.cpp.
References N, performDSPShiftCombine(), and llvm::MipsISD::SHLL_DSP.
|
static |
Definition at line 892 of file MipsSEISelLowering.cpp.
References llvm::SelectionDAG::getNode(), llvm::SDNode::getNumOperands(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::EVT::getSizeInBits(), llvm::SDNode::getVTList(), llvm::ConstantSDNode::getZExtValue(), llvm::MipsSubtarget::hasDSPR2(), llvm::MipsSubtarget::hasMSA(), N, performDSPShiftCombine(), llvm::ISD::SHL, llvm::MipsISD::SHRA_DSP, llvm::MipsISD::VEXTRACT_SEXT_ELT, and llvm::MipsISD::VEXTRACT_ZEXT_ELT.
Referenced by llvm::MipsSETargetLowering::PerformDAGCombine(), and llvm::RISCVTargetLowering::PerformDAGCombine().
|
static |
Definition at line 938 of file MipsSEISelLowering.cpp.
References llvm::MipsSubtarget::hasDSPR2(), N, performDSPShiftCombine(), and llvm::MipsISD::SHRL_DSP.
|
static |
Definition at line 980 of file MipsSEISelLowering.cpp.
References llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), N, llvm::MipsISD::SELECT_CC_DSP, and llvm::MipsISD::SETCC_DSP.
Referenced by llvm::MipsSETargetLowering::PerformDAGCombine().
|
static |
Definition at line 997 of file MipsSEISelLowering.cpp.
References llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::MipsSubtarget::hasMSA(), llvm::EVT::is128BitVector(), llvm::ISD::isBuildVectorAllOnes(), llvm::EVT::isInteger(), N, llvm::ISD::OR, and llvm::MipsISD::VNOR.
Referenced by llvm::MipsSETargetLowering::PerformDAGCombine(), and llvm::RISCVTargetLowering::PerformDAGCombine().
|
static |
Definition at line 716 of file MipsSEISelLowering.cpp.
References llvm::BitWidth, llvm::CallingConv::C, llvm::SmallVectorBase< Size_T >::empty(), llvm::SelectionDAG::getContext(), llvm::TargetLoweringBase::getRegisterType(), llvm::EVT::getSizeInBits(), llvm::MVT::getSizeInBits(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::MipsSubtarget::isABI_O32(), llvm::APInt::isNegative(), llvm::APInt::isPowerOf2(), llvm::APInt::logBase2(), llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by performMULCombine().
|
static |
Definition at line 1502 of file MipsSEISelLowering.cpp.
References llvm::ISD::AND, DL, getBuildVectorSplat(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SDValue::getScalarValueSizeInBits(), llvm::SelectionDAG::getSubtarget(), llvm::MCSubtargetInfo::getTargetTriple(), and llvm::Triple::isLittleEndian().
|
static |
Referenced by llvm::MipsSETargetLowering::MipsSETargetLowering().