LLVM
15.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/ADT/Triple.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 <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 1288 of file MipsSEISelLowering.cpp.
References llvm::ISD::BUILD_PAIR, DL, llvm::SelectionDAG::getNode(), llvm::MVT::i32, llvm::MVT::i64, 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 2600 of file MipsSEISelLowering.cpp.
|
static |
Definition at line 786 of file MipsSEISelLowering.cpp.
References llvm::ISD::ADD, llvm::BitWidth, llvm::APInt::ceilLogBase2(), DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::APInt::isNegative(), llvm::APInt::logBase2(), llvm::ISD::SHL, llvm::ISD::SUB, and X.
Referenced by performMULCombine().
|
static |
Definition at line 1420 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::makeArrayRef(), llvm::ISD::SRL, std::swap(), llvm::ISD::TRUNCATE, llvm::MVT::v2i64, and llvm::MVT::v4i32.
Referenced by lowerMSABinaryBitImmIntr(), and truncateVecElts().
|
static |
Definition at line 1280 of file MipsSEISelLowering.cpp.
References DL, llvm::ISD::EXTRACT_ELEMENT, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::MVT::i32, llvm::tgtok::In, 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 2422 of file MipsSEISelLowering.cpp.
Referenced by isConstantOrUndefBUILD_VECTOR().
|
static |
Definition at line 2432 of file MipsSEISelLowering.cpp.
References i, and isConstantOrUndef().
|
static |
Definition at line 943 of file MipsSEISelLowering.cpp.
References 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 2627 of file MipsSEISelLowering.cpp.
References assert().
|
static |
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.
Referenced by performORCombine().
|
static |
Definition at line 1306 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::ISD::TargetConstant, and llvm::MVT::Untyped.
|
static |
Definition at line 1456 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 1513 of file MipsSEISelLowering.cpp.
References llvm::ISD::AND, llvm::tgtok::Bit, DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getNOT(), llvm::ISD::SHL, and truncateVecElts().
|
static |
Definition at line 1523 of file MipsSEISelLowering.cpp.
References llvm::ISD::AND, DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), and llvm::EVT::getScalarSizeInBits().
|
static |
Definition at line 1354 of file MipsSEISelLowering.cpp.
References DL, llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getValueType(), llvm::SDNode::getValueType(), and llvm::EVT::getVectorElementType().
|
static |
Definition at line 2286 of file MipsSEISelLowering.cpp.
References llvm::ISD::ADD, Align, DL, llvm::SelectionDAG::getLoad(), llvm::SelectionDAG::getNode(), llvm::MipsSubtarget::isABI_N64(), and llvm::ISD::SIGN_EXTEND.
|
static |
Definition at line 1411 of file MipsSEISelLowering.cpp.
References llvm::SelectionDAG::getConstant().
|
static |
Definition at line 1367 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(), llvm::makeArrayRef(), std::swap(), llvm::MVT::v2i64, and llvm::MVT::v4i32.
|
static |
Definition at line 2360 of file MipsSEISelLowering.cpp.
References llvm::ISD::ADD, Align, DL, llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getStore(), llvm::MipsSubtarget::isABI_N64(), and llvm::ISD::SIGN_EXTEND.
|
static |
Definition at line 2659 of file MipsSEISelLowering.cpp.
References assert().
|
static |
Definition at line 2799 of file MipsSEISelLowering.cpp.
References assert().
|
static |
Definition at line 2705 of file MipsSEISelLowering.cpp.
References assert().
|
static |
Definition at line 2752 of file MipsSEISelLowering.cpp.
References assert().
|
static |
Definition at line 2847 of file MipsSEISelLowering.cpp.
References assert().
|
static |
Definition at line 2890 of file MipsSEISelLowering.cpp.
References assert().
|
static |
Definition at line 2546 of file MipsSEISelLowering.cpp.
References DL, llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getTargetConstant(), i, llvm::MVT::i32, j(), and llvm::MipsISD::SHF.
|
static |
Definition at line 2926 of file MipsSEISelLowering.cpp.
References llvm::EVT::changeVectorElementTypeToInteger(), DL, llvm::SelectionDAG::getBuildVector(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getTargetConstant(), llvm::EVT::getVectorElementType(), llvm::EVT::getVectorNumElements(), i, llvm_unreachable, 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(), llvm::makeArrayRef(), llvm::BitmaskEnumDetail::Mask(), N, llvm::MipsISD::VEXTRACT_SEXT_ELT, and llvm::MipsISD::VEXTRACT_ZEXT_ELT.
Referenced by llvm::MipsSETargetLowering::PerformDAGCombine().
|
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 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(), llvm::BitmaskEnumDetail::Mask(), N, and llvm::ISD::VSELECT.
Referenced by llvm::MipsSETargetLowering::PerformDAGCombine().
|
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.
Referenced by llvm::MipsSETargetLowering::PerformDAGCombine().
|
static |
Definition at line 863 of file MipsSEISelLowering.cpp.
References N, performDSPShiftCombine(), llvm::MipsISD::SHLL_DSP, llvm::MVT::v2i16, and llvm::MVT::v4i8.
Referenced by llvm::MipsSETargetLowering::PerformDAGCombine().
|
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(), llvm::makeArrayRef(), 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().
|
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.
Referenced by llvm::MipsSETargetLowering::PerformDAGCombine().
|
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().
|
static |
Definition at line 710 of file MipsSEISelLowering.cpp.
References llvm::MipsSubtarget::isABI_O32().
Referenced by performMULCombine().
|
static |
Definition at line 1500 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().