LLVM 17.0.0git
|
#include "MipsSEISelLowering.h"
#include "MipsMachineFunction.h"
#include "MipsRegisterInfo.h"
#include "MipsSubtarget.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.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/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/MachineValueType.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 53 of file MipsSEISelLowering.cpp.
|
static |
Definition at line 1287 of file MipsSEISelLowering.cpp.
References llvm::ISD::BUILD_PAIR, DL, llvm::SelectionDAG::getNode(), llvm::Hi, llvm::MVT::i32, llvm::MVT::i64, 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 2599 of file MipsSEISelLowering.cpp.
References I.
|
static |
Definition at line 786 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 1419 of file MipsSEISelLowering.cpp.
References llvm::ISD::BITCAST, DL, llvm::SelectionDAG::getBuildVector(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::EVT::getVectorNumElements(), llvm::MVT::i32, llvm::MVT::i64, llvm::ISD::SRL, std::swap(), llvm::ISD::TRUNCATE, llvm::MVT::v2i64, and llvm::MVT::v4i32.
Referenced by lowerMSABinaryBitImmIntr(), and truncateVecElts().
|
static |
Definition at line 1279 of file MipsSEISelLowering.cpp.
References DL, llvm::ISD::EXTRACT_ELEMENT, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::MVT::i32, llvm::MipsISD::MTLOHI, and llvm::MVT::Untyped.
Referenced by lowerDSPIntr().
Definition at line 571 of file MipsSEISelLowering.cpp.
References isVectorAllOnes(), N, and llvm::ISD::XOR.
Referenced by performORCombine().
Definition at line 2421 of file MipsSEISelLowering.cpp.
Referenced by isConstantOrUndefBUILD_VECTOR(), isVMerge(), llvm::PPC::isVPKUDUMShuffleMask(), llvm::PPC::isVPKUHUMShuffleMask(), llvm::PPC::isVPKUWUMShuffleMask(), and llvm::PPC::isVSLDOIShuffleMask().
|
static |
Definition at line 2431 of file MipsSEISelLowering.cpp.
References isConstantOrUndef().
|
static |
Definition at line 943 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, llvm::ISD::SETULT, and llvm::MVT::v2i16.
Referenced by performSETCCCombine().
|
static |
Definition at line 2626 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 547 of file MipsSEISelLowering.cpp.
References llvm::ISD::BITCAST, llvm::APInt::isAllOnes(), llvm::BuildVectorSDNode::isConstantSplat(), and N.
Referenced by isBitwiseInverse().
Definition at line 527 of file MipsSEISelLowering.cpp.
References N.
Referenced by performORCombine().
|
static |
Definition at line 1305 of file MipsSEISelLowering.cpp.
References assert(), DL, extractLOHI(), llvm::SelectionDAG::getMergeValues(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::MVT::i64, initAccumulator(), llvm::MVT::Other, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::ISD::TargetConstant, and llvm::MVT::Untyped.
|
static |
Definition at line 1455 of file MipsSEISelLowering.cpp.
References llvm::ISD::BITCAST, DL, llvm::SelectionDAG::getBuildVector(), getBuildVectorSplat(), llvm::SelectionDAG::getConstant(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::MVT::i32, llvm::MVT::i64, llvm::APInt::lshr(), llvm::ISD::SHL, std::swap(), llvm::APInt::trunc(), llvm::MVT::v2i64, llvm::MVT::v4i32, and llvm::ISD::ZERO_EXTEND.
|
static |
Definition at line 1512 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 1522 of file MipsSEISelLowering.cpp.
References llvm::ISD::AND, DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), and llvm::EVT::getScalarSizeInBits().
|
static |
Definition at line 1353 of file MipsSEISelLowering.cpp.
References DL, llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getValueType(), llvm::SDNode::getValueType(), llvm::EVT::getVectorElementType(), and Idx.
|
static |
Definition at line 2285 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 1410 of file MipsSEISelLowering.cpp.
References llvm::SelectionDAG::getConstant().
|
static |
Definition at line 1366 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::MVT::i32, llvm::Triple::isLittleEndian(), std::swap(), llvm::MVT::v2i64, and llvm::MVT::v4i32.
|
static |
Definition at line 2359 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 |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 2545 of file MipsSEISelLowering.cpp.
References DL, llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getTargetConstant(), llvm::MVT::i32, Idx, llvm::MipsISD::SHF, and llvm::SmallVectorBase< Size_T >::size().
|
static |
Definition at line 2925 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 475 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 838 of file MipsSEISelLowering.cpp.
References DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::EVT::getScalarSizeInBits(), llvm::APInt::getZExtValue(), llvm::MipsSubtarget::hasDSP(), llvm::MVT::i32, llvm::BuildVectorSDNode::isConstantSplat(), llvm::MipsSubtarget::isLittle(), and N.
Referenced by performSHLCombine(), performSRACombine(), and performSRLCombine().
|
static |
Definition at line 822 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().
|
static |
Definition at line 590 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 961 of file MipsSEISelLowering.cpp.
References llvm::SelectionDAG::getNode(), isLegalDSPCondCode(), N, llvm::MipsISD::SETCC_DSP, llvm::MVT::v2i16, and llvm::MVT::v4i8.
|
static |
Definition at line 863 of file MipsSEISelLowering.cpp.
References N, performDSPShiftCombine(), llvm::MipsISD::SHLL_DSP, llvm::MVT::v2i16, and llvm::MVT::v4i8.
|
static |
Definition at line 886 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::MVT::v2i16, llvm::MVT::v4i8, llvm::MipsISD::VEXTRACT_SEXT_ELT, and llvm::MipsISD::VEXTRACT_ZEXT_ELT.
Referenced by llvm::MipsSETargetLowering::PerformDAGCombine(), and llvm::RISCVTargetLowering::PerformDAGCombine().
|
static |
Definition at line 932 of file MipsSEISelLowering.cpp.
References llvm::MipsSubtarget::hasDSPR2(), N, performDSPShiftCombine(), llvm::MipsISD::SHRL_DSP, llvm::MVT::v2i16, and llvm::MVT::v4i8.
|
static |
Definition at line 974 of file MipsSEISelLowering.cpp.
References llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), N, llvm::MipsISD::SELECT_CC_DSP, llvm::MipsISD::SETCC_DSP, llvm::MVT::v2i16, and llvm::MVT::v4i8.
Referenced by llvm::MipsSETargetLowering::PerformDAGCombine().
|
static |
Definition at line 991 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 710 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 1499 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(), llvm::MVT::i32, llvm::MVT::i64, llvm::Triple::isLittleEndian(), and llvm::MVT::v2i64.
Referenced by lowerMSABitClear().
|
static |
Referenced by llvm::MipsSETargetLowering::MipsSETargetLowering().