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/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 51 of file MipsSEISelLowering.cpp.
|
static |
Definition at line 1294 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 2606 of file MipsSEISelLowering.cpp.
|
static |
Definition at line 791 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 1426 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 1288 of file MipsSEISelLowering.cpp.
References DL, llvm::SelectionDAG::getNode(), llvm::MipsISD::MTLOHI, and llvm::SelectionDAG::SplitScalar().
Referenced by lowerDSPIntr().
Definition at line 576 of file MipsSEISelLowering.cpp.
References isVectorAllOnes(), N, and llvm::ISD::XOR.
Referenced by performORCombine().
Definition at line 2428 of file MipsSEISelLowering.cpp.
|
static |
Definition at line 2438 of file MipsSEISelLowering.cpp.
References llvm::DWARFExpression::Operation::getNumOperands(), and isConstantOrUndef().
|
static |
Definition at line 948 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 2633 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 552 of file MipsSEISelLowering.cpp.
References llvm::ISD::BITCAST, llvm::APInt::isAllOnes(), llvm::BuildVectorSDNode::isConstantSplat(), and N.
Referenced by isBitwiseInverse().
Definition at line 532 of file MipsSEISelLowering.cpp.
References N.
Referenced by performORCombine().
|
static |
Definition at line 1312 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 1462 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 1519 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 1529 of file MipsSEISelLowering.cpp.
References llvm::ISD::AND, DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), and llvm::EVT::getScalarSizeInBits().
|
static |
Definition at line 1360 of file MipsSEISelLowering.cpp.
References DL, llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getValueType(), llvm::SDNode::getValueType(), llvm::EVT::getVectorElementType(), and Idx.
|
static |
Definition at line 2292 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 1417 of file MipsSEISelLowering.cpp.
References llvm::SelectionDAG::getConstant().
|
static |
Definition at line 1373 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 2366 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 2805 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 2758 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 2552 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 2932 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 480 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 843 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 827 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 595 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 966 of file MipsSEISelLowering.cpp.
References llvm::SelectionDAG::getNode(), isLegalDSPCondCode(), N, and llvm::MipsISD::SETCC_DSP.
|
static |
Definition at line 868 of file MipsSEISelLowering.cpp.
References N, performDSPShiftCombine(), and llvm::MipsISD::SHLL_DSP.
|
static |
Definition at line 891 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 937 of file MipsSEISelLowering.cpp.
References llvm::MipsSubtarget::hasDSPR2(), N, performDSPShiftCombine(), and llvm::MipsISD::SHRL_DSP.
|
static |
Definition at line 979 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 996 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 715 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(), MaxSteps, llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by performMULCombine().
|
static |
Definition at line 1506 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().