#include "llvm/CodeGen/SelectionDAG.h"
#include "SDNodeDbgValue.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/MemoryLocation.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Analysis/VectorUtils.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/CodeGen/Analysis.h"
#include "llvm/CodeGen/FunctionLoweringInfo.h"
#include "llvm/CodeGen/ISDOpcodes.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/RuntimeLibcallUtil.h"
#include "llvm/CodeGen/SDPatternMatch.h"
#include "llvm/CodeGen/SelectionDAGAddressAnalysis.h"
#include "llvm/CodeGen/SelectionDAGNodes.h"
#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
#include "llvm/CodeGen/TargetFrameLowering.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/CodeGenTypes/MachineValueType.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CodeGen.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/TargetParser/Triple.h"
#include "llvm/Transforms/Utils/SizeOpts.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstdlib>
#include <deque>
#include <limits>
#include <optional>
#include <set>
#include <string>
#include <utility>
#include <vector>
usingnamespacellvm;
usingnamespacellvm::SDPatternMatch;
static SDVTList makeVTList(const EVT *VTs, unsigned NumVTs) { … }
void SelectionDAG::DAGUpdateListener::NodeDeleted(SDNode*, SDNode*) { … }
void SelectionDAG::DAGUpdateListener::NodeUpdated(SDNode*) { … }
void SelectionDAG::DAGUpdateListener::NodeInserted(SDNode *) { … }
void SelectionDAG::DAGNodeDeletedListener::anchor() { … }
void SelectionDAG::DAGNodeInsertedListener::anchor() { … }
#define DEBUG_TYPE …
static cl::opt<bool> EnableMemCpyDAGOpt("enable-memcpy-dag-opt",
cl::Hidden, cl::init(true),
cl::desc("Gang up loads and stores generated by inlining of memcpy"));
static cl::opt<int> MaxLdStGlue("ldstmemcpy-glue-max",
cl::desc("Number limit for gluing ld/st of memcpy."),
cl::Hidden, cl::init(0));
static void NewSDValueDbgMsg(SDValue V, StringRef Msg, SelectionDAG *G) { … }
bool ConstantFPSDNode::isExactlyValue(const APFloat& V) const { … }
bool ConstantFPSDNode::isValueValidForType(EVT VT,
const APFloat& Val) { … }
bool ISD::isConstantSplatVector(const SDNode *N, APInt &SplatVal) { … }
bool ISD::isConstantSplatVectorAllOnes(const SDNode *N, bool BuildVectorOnly) { … }
bool ISD::isConstantSplatVectorAllZeros(const SDNode *N, bool BuildVectorOnly) { … }
bool ISD::isBuildVectorAllOnes(const SDNode *N) { … }
bool ISD::isBuildVectorAllZeros(const SDNode *N) { … }
bool ISD::isBuildVectorOfConstantSDNodes(const SDNode *N) { … }
bool ISD::isBuildVectorOfConstantFPSDNodes(const SDNode *N) { … }
bool ISD::isVectorShrinkable(const SDNode *N, unsigned NewEltSize,
bool Signed) { … }
bool ISD::allOperandsUndef(const SDNode *N) { … }
bool ISD::isFreezeUndef(const SDNode *N) { … }
template <typename ConstNodeType>
bool ISD::matchUnaryPredicateImpl(SDValue Op,
std::function<bool(ConstNodeType *)> Match,
bool AllowUndefs) { … }
template bool ISD::matchUnaryPredicateImpl<ConstantSDNode>(
SDValue, std::function<bool(ConstantSDNode *)>, bool);
template bool ISD::matchUnaryPredicateImpl<ConstantFPSDNode>(
SDValue, std::function<bool(ConstantFPSDNode *)>, bool);
bool ISD::matchBinaryPredicate(
SDValue LHS, SDValue RHS,
std::function<bool(ConstantSDNode *, ConstantSDNode *)> Match,
bool AllowUndefs, bool AllowTypeMismatch) { … }
ISD::NodeType ISD::getVecReduceBaseOpcode(unsigned VecReduceOpcode) { … }
bool ISD::isVPOpcode(unsigned Opcode) { … }
bool ISD::isVPBinaryOp(unsigned Opcode) { … }
bool ISD::isVPReduction(unsigned Opcode) { … }
std::optional<unsigned> ISD::getVPMaskIdx(unsigned Opcode) { … }
std::optional<unsigned> ISD::getVPExplicitVectorLengthIdx(unsigned Opcode) { … }
std::optional<unsigned> ISD::getBaseOpcodeForVP(unsigned VPOpcode,
bool hasFPExcept) { … }
std::optional<unsigned> ISD::getVPForBaseOpcode(unsigned Opcode) { … }
ISD::NodeType ISD::getExtForLoadExtType(bool IsFP, ISD::LoadExtType ExtType) { … }
ISD::CondCode ISD::getSetCCSwappedOperands(ISD::CondCode Operation) { … }
static ISD::CondCode getSetCCInverseImpl(ISD::CondCode Op, bool isIntegerLike) { … }
ISD::CondCode ISD::getSetCCInverse(ISD::CondCode Op, EVT Type) { … }
ISD::CondCode ISD::GlobalISel::getSetCCInverse(ISD::CondCode Op,
bool isIntegerLike) { … }
static int isSignedOp(ISD::CondCode Opcode) { … }
ISD::CondCode ISD::getSetCCOrOperation(ISD::CondCode Op1, ISD::CondCode Op2,
EVT Type) { … }
ISD::CondCode ISD::getSetCCAndOperation(ISD::CondCode Op1, ISD::CondCode Op2,
EVT Type) { … }
static void AddNodeIDOpcode(FoldingSetNodeID &ID, unsigned OpC) { … }
static void AddNodeIDValueTypes(FoldingSetNodeID &ID, SDVTList VTList) { … }
static void AddNodeIDOperands(FoldingSetNodeID &ID,
ArrayRef<SDValue> Ops) { … }
static void AddNodeIDOperands(FoldingSetNodeID &ID,
ArrayRef<SDUse> Ops) { … }
static void AddNodeIDNode(FoldingSetNodeID &ID, unsigned OpC,
SDVTList VTList, ArrayRef<SDValue> OpList) { … }
static void AddNodeIDCustom(FoldingSetNodeID &ID, const SDNode *N) { … }
static void AddNodeIDNode(FoldingSetNodeID &ID, const SDNode *N) { … }
static bool doNotCSE(SDNode *N) { … }
void SelectionDAG::RemoveDeadNodes() { … }
void SelectionDAG::RemoveDeadNodes(SmallVectorImpl<SDNode *> &DeadNodes) { … }
void SelectionDAG::RemoveDeadNode(SDNode *N){ … }
void SelectionDAG::DeleteNode(SDNode *N) { … }
void SelectionDAG::DeleteNodeNotInCSEMaps(SDNode *N) { … }
void SDDbgInfo::add(SDDbgValue *V, bool isParameter) { … }
void SDDbgInfo::erase(const SDNode *Node) { … }
void SelectionDAG::DeallocateNode(SDNode *N) { … }
#ifndef NDEBUG
static void VerifySDNode(SDNode *N, const TargetLowering *TLI) {
switch (N->getOpcode()) {
default:
if (N->getOpcode() > ISD::BUILTIN_OP_END)
TLI->verifyTargetSDNode(N);
break;
case ISD::BUILD_PAIR: {
EVT VT = N->getValueType(0);
assert(N->getNumValues() == 1 && "Too many results!");
assert(!VT.isVector() && (VT.isInteger() || VT.isFloatingPoint()) &&
"Wrong return type!");
assert(N->getNumOperands() == 2 && "Wrong number of operands!");
assert(N->getOperand(0).getValueType() == N->getOperand(1).getValueType() &&
"Mismatched operand types!");
assert(N->getOperand(0).getValueType().isInteger() == VT.isInteger() &&
"Wrong operand type!");
assert(VT.getSizeInBits() == 2 * N->getOperand(0).getValueSizeInBits() &&
"Wrong return type size");
break;
}
case ISD::BUILD_VECTOR: {
assert(N->getNumValues() == 1 && "Too many results!");
assert(N->getValueType(0).isVector() && "Wrong return type!");
assert(N->getNumOperands() == N->getValueType(0).getVectorNumElements() &&
"Wrong number of operands!");
EVT EltVT = N->getValueType(0).getVectorElementType();
for (const SDUse &Op : N->ops()) {
assert((Op.getValueType() == EltVT ||
(EltVT.isInteger() && Op.getValueType().isInteger() &&
EltVT.bitsLE(Op.getValueType()))) &&
"Wrong operand type!");
assert(Op.getValueType() == N->getOperand(0).getValueType() &&
"Operands must all have the same type");
}
break;
}
}
}
#endif
void SelectionDAG::InsertNode(SDNode *N) { … }
bool SelectionDAG::RemoveNodeFromCSEMaps(SDNode *N) { … }
void
SelectionDAG::AddModifiedNodeToCSEMaps(SDNode *N) { … }
SDNode *SelectionDAG::FindModifiedNodeSlot(SDNode *N, SDValue Op,
void *&InsertPos) { … }
SDNode *SelectionDAG::FindModifiedNodeSlot(SDNode *N,
SDValue Op1, SDValue Op2,
void *&InsertPos) { … }
SDNode *SelectionDAG::FindModifiedNodeSlot(SDNode *N, ArrayRef<SDValue> Ops,
void *&InsertPos) { … }
Align SelectionDAG::getEVTAlign(EVT VT) const { … }
SelectionDAG::SelectionDAG(const TargetMachine &tm, CodeGenOptLevel OL)
: … { … }
void SelectionDAG::init(MachineFunction &NewMF,
OptimizationRemarkEmitter &NewORE, Pass *PassPtr,
const TargetLibraryInfo *LibraryInfo,
UniformityInfo *NewUA, ProfileSummaryInfo *PSIin,
BlockFrequencyInfo *BFIin, MachineModuleInfo &MMIin,
FunctionVarLocs const *VarLocs) { … }
SelectionDAG::~SelectionDAG() { … }
bool SelectionDAG::shouldOptForSize() const { … }
void SelectionDAG::allnodes_clear() { … }
SDNode *SelectionDAG::FindNodeOrInsertPos(const FoldingSetNodeID &ID,
void *&InsertPos) { … }
SDNode *SelectionDAG::FindNodeOrInsertPos(const FoldingSetNodeID &ID,
const SDLoc &DL, void *&InsertPos) { … }
void SelectionDAG::clear() { … }
SDValue SelectionDAG::getFPExtendOrRound(SDValue Op, const SDLoc &DL, EVT VT) { … }
std::pair<SDValue, SDValue>
SelectionDAG::getStrictFPExtendOrRound(SDValue Op, SDValue Chain,
const SDLoc &DL, EVT VT) { … }
SDValue SelectionDAG::getAnyExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) { … }
SDValue SelectionDAG::getSExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) { … }
SDValue SelectionDAG::getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) { … }
SDValue SelectionDAG::getBitcastedAnyExtOrTrunc(SDValue Op, const SDLoc &DL,
EVT VT) { … }
SDValue SelectionDAG::getBitcastedSExtOrTrunc(SDValue Op, const SDLoc &DL,
EVT VT) { … }
SDValue SelectionDAG::getBitcastedZExtOrTrunc(SDValue Op, const SDLoc &DL,
EVT VT) { … }
SDValue SelectionDAG::getBoolExtOrTrunc(SDValue Op, const SDLoc &SL, EVT VT,
EVT OpVT) { … }
SDValue SelectionDAG::getZeroExtendInReg(SDValue Op, const SDLoc &DL, EVT VT) { … }
SDValue SelectionDAG::getVPZeroExtendInReg(SDValue Op, SDValue Mask,
SDValue EVL, const SDLoc &DL,
EVT VT) { … }
SDValue SelectionDAG::getPtrExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) { … }
SDValue SelectionDAG::getPtrExtendInReg(SDValue Op, const SDLoc &DL, EVT VT) { … }
SDValue SelectionDAG::getNegative(SDValue Val, const SDLoc &DL, EVT VT) { … }
SDValue SelectionDAG::getNOT(const SDLoc &DL, SDValue Val, EVT VT) { … }
SDValue SelectionDAG::getLogicalNOT(const SDLoc &DL, SDValue Val, EVT VT) { … }
SDValue SelectionDAG::getVPLogicalNOT(const SDLoc &DL, SDValue Val,
SDValue Mask, SDValue EVL, EVT VT) { … }
SDValue SelectionDAG::getVPPtrExtOrTrunc(const SDLoc &DL, EVT VT, SDValue Op,
SDValue Mask, SDValue EVL) { … }
SDValue SelectionDAG::getVPZExtOrTrunc(const SDLoc &DL, EVT VT, SDValue Op,
SDValue Mask, SDValue EVL) { … }
SDValue SelectionDAG::getBoolConstant(bool V, const SDLoc &DL, EVT VT,
EVT OpVT) { … }
SDValue SelectionDAG::getConstant(uint64_t Val, const SDLoc &DL, EVT VT,
bool isT, bool isO) { … }
SDValue SelectionDAG::getConstant(const APInt &Val, const SDLoc &DL, EVT VT,
bool isT, bool isO) { … }
SDValue SelectionDAG::getConstant(const ConstantInt &Val, const SDLoc &DL,
EVT VT, bool isT, bool isO) { … }
SDValue SelectionDAG::getSignedConstant(int64_t Val, const SDLoc &DL, EVT VT,
bool isT, bool isO) { … }
SDValue SelectionDAG::getAllOnesConstant(const SDLoc &DL, EVT VT, bool IsTarget,
bool IsOpaque) { … }
SDValue SelectionDAG::getIntPtrConstant(uint64_t Val, const SDLoc &DL,
bool isTarget) { … }
SDValue SelectionDAG::getShiftAmountConstant(uint64_t Val, EVT VT,
const SDLoc &DL) { … }
SDValue SelectionDAG::getShiftAmountConstant(const APInt &Val, EVT VT,
const SDLoc &DL) { … }
SDValue SelectionDAG::getVectorIdxConstant(uint64_t Val, const SDLoc &DL,
bool isTarget) { … }
SDValue SelectionDAG::getConstantFP(const APFloat &V, const SDLoc &DL, EVT VT,
bool isTarget) { … }
SDValue SelectionDAG::getConstantFP(const ConstantFP &V, const SDLoc &DL,
EVT VT, bool isTarget) { … }
SDValue SelectionDAG::getConstantFP(double Val, const SDLoc &DL, EVT VT,
bool isTarget) { … }
SDValue SelectionDAG::getGlobalAddress(const GlobalValue *GV, const SDLoc &DL,
EVT VT, int64_t Offset, bool isTargetGA,
unsigned TargetFlags) { … }
SDValue SelectionDAG::getFrameIndex(int FI, EVT VT, bool isTarget) { … }
SDValue SelectionDAG::getJumpTable(int JTI, EVT VT, bool isTarget,
unsigned TargetFlags) { … }
SDValue SelectionDAG::getJumpTableDebugInfo(int JTI, SDValue Chain,
const SDLoc &DL) { … }
SDValue SelectionDAG::getConstantPool(const Constant *C, EVT VT,
MaybeAlign Alignment, int Offset,
bool isTarget, unsigned TargetFlags) { … }
SDValue SelectionDAG::getConstantPool(MachineConstantPoolValue *C, EVT VT,
MaybeAlign Alignment, int Offset,
bool isTarget, unsigned TargetFlags) { … }
SDValue SelectionDAG::getBasicBlock(MachineBasicBlock *MBB) { … }
SDValue SelectionDAG::getValueType(EVT VT) { … }
SDValue SelectionDAG::getExternalSymbol(const char *Sym, EVT VT) { … }
SDValue SelectionDAG::getMCSymbol(MCSymbol *Sym, EVT VT) { … }
SDValue SelectionDAG::getTargetExternalSymbol(const char *Sym, EVT VT,
unsigned TargetFlags) { … }
SDValue SelectionDAG::getCondCode(ISD::CondCode Cond) { … }
SDValue SelectionDAG::getVScale(const SDLoc &DL, EVT VT, APInt MulImm,
bool ConstantFold) { … }
SDValue SelectionDAG::getElementCount(const SDLoc &DL, EVT VT, ElementCount EC,
bool ConstantFold) { … }
SDValue SelectionDAG::getStepVector(const SDLoc &DL, EVT ResVT) { … }
SDValue SelectionDAG::getStepVector(const SDLoc &DL, EVT ResVT,
const APInt &StepVal) { … }
static void commuteShuffle(SDValue &N1, SDValue &N2, MutableArrayRef<int> M) { … }
SDValue SelectionDAG::getVectorShuffle(EVT VT, const SDLoc &dl, SDValue N1,
SDValue N2, ArrayRef<int> Mask) { … }
SDValue SelectionDAG::getCommutedVectorShuffle(const ShuffleVectorSDNode &SV) { … }
SDValue SelectionDAG::getRegister(Register Reg, EVT VT) { … }
SDValue SelectionDAG::getRegisterMask(const uint32_t *RegMask) { … }
SDValue SelectionDAG::getEHLabel(const SDLoc &dl, SDValue Root,
MCSymbol *Label) { … }
SDValue SelectionDAG::getLabelNode(unsigned Opcode, const SDLoc &dl,
SDValue Root, MCSymbol *Label) { … }
SDValue SelectionDAG::getBlockAddress(const BlockAddress *BA, EVT VT,
int64_t Offset, bool isTarget,
unsigned TargetFlags) { … }
SDValue SelectionDAG::getSrcValue(const Value *V) { … }
SDValue SelectionDAG::getMDNode(const MDNode *MD) { … }
SDValue SelectionDAG::getBitcast(EVT VT, SDValue V) { … }
SDValue SelectionDAG::getAddrSpaceCast(const SDLoc &dl, EVT VT, SDValue Ptr,
unsigned SrcAS, unsigned DestAS) { … }
SDValue SelectionDAG::getFreeze(SDValue V) { … }
SDValue SelectionDAG::getShiftAmountOperand(EVT LHSTy, SDValue Op) { … }
SDValue SelectionDAG::getPartialReduceAdd(SDLoc DL, EVT ReducedTy, SDValue Op1,
SDValue Op2) { … }
SDValue SelectionDAG::expandVAArg(SDNode *Node) { … }
SDValue SelectionDAG::expandVACopy(SDNode *Node) { … }
Align SelectionDAG::getReducedAlign(EVT VT, bool UseABI) { … }
SDValue SelectionDAG::CreateStackTemporary(TypeSize Bytes, Align Alignment) { … }
SDValue SelectionDAG::CreateStackTemporary(EVT VT, unsigned minAlign) { … }
SDValue SelectionDAG::CreateStackTemporary(EVT VT1, EVT VT2) { … }
SDValue SelectionDAG::FoldSetCC(EVT VT, SDValue N1, SDValue N2,
ISD::CondCode Cond, const SDLoc &dl) { … }
bool SelectionDAG::SignBitIsZero(SDValue Op, unsigned Depth) const { … }
bool SelectionDAG::MaskedValueIsZero(SDValue V, const APInt &Mask,
unsigned Depth) const { … }
bool SelectionDAG::MaskedValueIsZero(SDValue V, const APInt &Mask,
const APInt &DemandedElts,
unsigned Depth) const { … }
bool SelectionDAG::MaskedVectorIsZero(SDValue V, const APInt &DemandedElts,
unsigned Depth ) const { … }
bool SelectionDAG::MaskedValueIsAllOnes(SDValue V, const APInt &Mask,
unsigned Depth) const { … }
APInt SelectionDAG::computeVectorKnownZeroElements(SDValue Op,
const APInt &DemandedElts,
unsigned Depth) const { … }
bool SelectionDAG::isSplatValue(SDValue V, const APInt &DemandedElts,
APInt &UndefElts, unsigned Depth) const { … }
bool SelectionDAG::isSplatValue(SDValue V, bool AllowUndefs) const { … }
SDValue SelectionDAG::getSplatSourceVector(SDValue V, int &SplatIdx) { … }
SDValue SelectionDAG::getSplatValue(SDValue V, bool LegalTypes) { … }
std::optional<ConstantRange>
SelectionDAG::getValidShiftAmountRange(SDValue V, const APInt &DemandedElts,
unsigned Depth) const { … }
std::optional<uint64_t>
SelectionDAG::getValidShiftAmount(SDValue V, const APInt &DemandedElts,
unsigned Depth) const { … }
std::optional<uint64_t>
SelectionDAG::getValidShiftAmount(SDValue V, unsigned Depth) const { … }
std::optional<uint64_t>
SelectionDAG::getValidMinimumShiftAmount(SDValue V, const APInt &DemandedElts,
unsigned Depth) const { … }
std::optional<uint64_t>
SelectionDAG::getValidMinimumShiftAmount(SDValue V, unsigned Depth) const { … }
std::optional<uint64_t>
SelectionDAG::getValidMaximumShiftAmount(SDValue V, const APInt &DemandedElts,
unsigned Depth) const { … }
std::optional<uint64_t>
SelectionDAG::getValidMaximumShiftAmount(SDValue V, unsigned Depth) const { … }
KnownBits SelectionDAG::computeKnownBits(SDValue Op, unsigned Depth) const { … }
KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts,
unsigned Depth) const { … }
static SelectionDAG::OverflowKind mapOverflowResult(ConstantRange::OverflowResult OR) { … }
SelectionDAG::OverflowKind
SelectionDAG::computeOverflowForSignedAdd(SDValue N0, SDValue N1) const { … }
SelectionDAG::OverflowKind
SelectionDAG::computeOverflowForUnsignedAdd(SDValue N0, SDValue N1) const { … }
SelectionDAG::OverflowKind
SelectionDAG::computeOverflowForSignedSub(SDValue N0, SDValue N1) const { … }
SelectionDAG::OverflowKind
SelectionDAG::computeOverflowForUnsignedSub(SDValue N0, SDValue N1) const { … }
SelectionDAG::OverflowKind
SelectionDAG::computeOverflowForUnsignedMul(SDValue N0, SDValue N1) const { … }
SelectionDAG::OverflowKind
SelectionDAG::computeOverflowForSignedMul(SDValue N0, SDValue N1) const { … }
bool SelectionDAG::isKnownToBeAPowerOfTwo(SDValue Val, unsigned Depth) const { … }
bool SelectionDAG::isKnownToBeAPowerOfTwoFP(SDValue Val, unsigned Depth) const { … }
unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, unsigned Depth) const { … }
unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
unsigned Depth) const { … }
unsigned SelectionDAG::ComputeMaxSignificantBits(SDValue Op,
unsigned Depth) const { … }
unsigned SelectionDAG::ComputeMaxSignificantBits(SDValue Op,
const APInt &DemandedElts,
unsigned Depth) const { … }
bool SelectionDAG::isGuaranteedNotToBeUndefOrPoison(SDValue Op, bool PoisonOnly,
unsigned Depth) const { … }
bool SelectionDAG::isGuaranteedNotToBeUndefOrPoison(SDValue Op,
const APInt &DemandedElts,
bool PoisonOnly,
unsigned Depth) const { … }
bool SelectionDAG::canCreateUndefOrPoison(SDValue Op, bool PoisonOnly,
bool ConsiderFlags,
unsigned Depth) const { … }
bool SelectionDAG::canCreateUndefOrPoison(SDValue Op, const APInt &DemandedElts,
bool PoisonOnly, bool ConsiderFlags,
unsigned Depth) const { … }
bool SelectionDAG::isADDLike(SDValue Op, bool NoWrap) const { … }
bool SelectionDAG::isBaseWithConstantOffset(SDValue Op) const { … }
bool SelectionDAG::isKnownNeverNaN(SDValue Op, bool SNaN, unsigned Depth) const { … }
bool SelectionDAG::isKnownNeverZeroFloat(SDValue Op) const { … }
bool SelectionDAG::isKnownNeverZero(SDValue Op, unsigned Depth) const { … }
bool SelectionDAG::cannotBeOrderedNegativeFP(SDValue Op) const { … }
bool SelectionDAG::isEqualTo(SDValue A, SDValue B) const { … }
SDValue llvm::getBitwiseNotOperand(SDValue V, SDValue Mask, bool AllowUndefs) { … }
static bool haveNoCommonBitsSetCommutative(SDValue A, SDValue B) { … }
bool SelectionDAG::haveNoCommonBitsSet(SDValue A, SDValue B) const { … }
static SDValue FoldSTEP_VECTOR(const SDLoc &DL, EVT VT, SDValue Step,
SelectionDAG &DAG) { … }
static SDValue FoldBUILD_VECTOR(const SDLoc &DL, EVT VT,
ArrayRef<SDValue> Ops,
SelectionDAG &DAG) { … }
static SDValue foldCONCAT_VECTORS(const SDLoc &DL, EVT VT,
ArrayRef<SDValue> Ops,
SelectionDAG &DAG) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
SDValue N1) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
SDValue N1, const SDNodeFlags Flags) { … }
static std::optional<APInt> FoldValue(unsigned Opcode, const APInt &C1,
const APInt &C2) { … }
static std::optional<APInt> FoldValueWithUndef(unsigned Opcode, const APInt &C1,
bool IsUndef1, const APInt &C2,
bool IsUndef2) { … }
SDValue SelectionDAG::FoldSymbolOffset(unsigned Opcode, EVT VT,
const GlobalAddressSDNode *GA,
const SDNode *N2) { … }
bool SelectionDAG::isUndef(unsigned Opcode, ArrayRef<SDValue> Ops) { … }
SDValue SelectionDAG::FoldConstantArithmetic(unsigned Opcode, const SDLoc &DL,
EVT VT, ArrayRef<SDValue> Ops,
SDNodeFlags Flags) { … }
SDValue SelectionDAG::foldConstantFPMath(unsigned Opcode, const SDLoc &DL,
EVT VT, ArrayRef<SDValue> Ops) { … }
SDValue SelectionDAG::getAssertAlign(const SDLoc &DL, SDValue Val, Align A) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
SDValue N1, SDValue N2) { … }
void SelectionDAG::canonicalizeCommutativeBinop(unsigned Opcode, SDValue &N1,
SDValue &N2) const { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
SDValue N1, SDValue N2, const SDNodeFlags Flags) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
SDValue N1, SDValue N2, SDValue N3) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
SDValue N1, SDValue N2, SDValue N3,
const SDNodeFlags Flags) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
SDValue N1, SDValue N2, SDValue N3, SDValue N4,
const SDNodeFlags Flags) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
SDValue N1, SDValue N2, SDValue N3, SDValue N4) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
SDValue N1, SDValue N2, SDValue N3, SDValue N4,
SDValue N5, const SDNodeFlags Flags) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
SDValue N1, SDValue N2, SDValue N3, SDValue N4,
SDValue N5) { … }
SDValue SelectionDAG::getStackArgumentTokenFactor(SDValue Chain) { … }
static SDValue getMemsetValue(SDValue Value, EVT VT, SelectionDAG &DAG,
const SDLoc &dl) { … }
static SDValue getMemsetStringVal(EVT VT, const SDLoc &dl, SelectionDAG &DAG,
const TargetLowering &TLI,
const ConstantDataArraySlice &Slice) { … }
SDValue SelectionDAG::getMemBasePlusOffset(SDValue Base, TypeSize Offset,
const SDLoc &DL,
const SDNodeFlags Flags) { … }
SDValue SelectionDAG::getMemBasePlusOffset(SDValue Ptr, SDValue Offset,
const SDLoc &DL,
const SDNodeFlags Flags) { … }
static bool isMemSrcFromConstant(SDValue Src, ConstantDataArraySlice &Slice) { … }
static bool shouldLowerMemFuncForSize(const MachineFunction &MF,
SelectionDAG &DAG) { … }
static void chainLoadsAndStoresForMemcpy(SelectionDAG &DAG, const SDLoc &dl,
SmallVector<SDValue, 32> &OutChains, unsigned From,
unsigned To, SmallVector<SDValue, 16> &OutLoadChains,
SmallVector<SDValue, 16> &OutStoreChains) { … }
static SDValue getMemcpyLoadsAndStores(SelectionDAG &DAG, const SDLoc &dl,
SDValue Chain, SDValue Dst, SDValue Src,
uint64_t Size, Align Alignment,
bool isVol, bool AlwaysInline,
MachinePointerInfo DstPtrInfo,
MachinePointerInfo SrcPtrInfo,
const AAMDNodes &AAInfo, AAResults *AA) { … }
static SDValue getMemmoveLoadsAndStores(SelectionDAG &DAG, const SDLoc &dl,
SDValue Chain, SDValue Dst, SDValue Src,
uint64_t Size, Align Alignment,
bool isVol, bool AlwaysInline,
MachinePointerInfo DstPtrInfo,
MachinePointerInfo SrcPtrInfo,
const AAMDNodes &AAInfo) { … }
static SDValue getMemsetStores(SelectionDAG &DAG, const SDLoc &dl,
SDValue Chain, SDValue Dst, SDValue Src,
uint64_t Size, Align Alignment, bool isVol,
bool AlwaysInline, MachinePointerInfo DstPtrInfo,
const AAMDNodes &AAInfo) { … }
static void checkAddrSpaceIsValidForLibcall(const TargetLowering *TLI,
unsigned AS) { … }
SDValue SelectionDAG::getMemcpy(
SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src, SDValue Size,
Align Alignment, bool isVol, bool AlwaysInline, const CallInst *CI,
std::optional<bool> OverrideTailCall, MachinePointerInfo DstPtrInfo,
MachinePointerInfo SrcPtrInfo, const AAMDNodes &AAInfo, AAResults *AA) { … }
SDValue SelectionDAG::getAtomicMemcpy(SDValue Chain, const SDLoc &dl,
SDValue Dst, SDValue Src, SDValue Size,
Type *SizeTy, unsigned ElemSz,
bool isTailCall,
MachinePointerInfo DstPtrInfo,
MachinePointerInfo SrcPtrInfo) { … }
SDValue SelectionDAG::getMemmove(SDValue Chain, const SDLoc &dl, SDValue Dst,
SDValue Src, SDValue Size, Align Alignment,
bool isVol, const CallInst *CI,
std::optional<bool> OverrideTailCall,
MachinePointerInfo DstPtrInfo,
MachinePointerInfo SrcPtrInfo,
const AAMDNodes &AAInfo, AAResults *AA) { … }
SDValue SelectionDAG::getAtomicMemmove(SDValue Chain, const SDLoc &dl,
SDValue Dst, SDValue Src, SDValue Size,
Type *SizeTy, unsigned ElemSz,
bool isTailCall,
MachinePointerInfo DstPtrInfo,
MachinePointerInfo SrcPtrInfo) { … }
SDValue SelectionDAG::getMemset(SDValue Chain, const SDLoc &dl, SDValue Dst,
SDValue Src, SDValue Size, Align Alignment,
bool isVol, bool AlwaysInline,
const CallInst *CI,
MachinePointerInfo DstPtrInfo,
const AAMDNodes &AAInfo) { … }
SDValue SelectionDAG::getAtomicMemset(SDValue Chain, const SDLoc &dl,
SDValue Dst, SDValue Value, SDValue Size,
Type *SizeTy, unsigned ElemSz,
bool isTailCall,
MachinePointerInfo DstPtrInfo) { … }
SDValue SelectionDAG::getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
SDVTList VTList, ArrayRef<SDValue> Ops,
MachineMemOperand *MMO) { … }
SDValue SelectionDAG::getAtomicCmpSwap(unsigned Opcode, const SDLoc &dl,
EVT MemVT, SDVTList VTs, SDValue Chain,
SDValue Ptr, SDValue Cmp, SDValue Swp,
MachineMemOperand *MMO) { … }
SDValue SelectionDAG::getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
SDValue Chain, SDValue Ptr, SDValue Val,
MachineMemOperand *MMO) { … }
SDValue SelectionDAG::getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
EVT VT, SDValue Chain, SDValue Ptr,
MachineMemOperand *MMO) { … }
SDValue SelectionDAG::getMergeValues(ArrayRef<SDValue> Ops, const SDLoc &dl) { … }
SDValue SelectionDAG::getMemIntrinsicNode(
unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef<SDValue> Ops,
EVT MemVT, MachinePointerInfo PtrInfo, Align Alignment,
MachineMemOperand::Flags Flags, LocationSize Size,
const AAMDNodes &AAInfo) { … }
SDValue SelectionDAG::getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl,
SDVTList VTList,
ArrayRef<SDValue> Ops, EVT MemVT,
MachineMemOperand *MMO) { … }
SDValue SelectionDAG::getLifetimeNode(bool IsStart, const SDLoc &dl,
SDValue Chain, int FrameIndex,
int64_t Size, int64_t Offset) { … }
SDValue SelectionDAG::getPseudoProbeNode(const SDLoc &Dl, SDValue Chain,
uint64_t Guid, uint64_t Index,
uint32_t Attr) { … }
static MachinePointerInfo InferPointerInfo(const MachinePointerInfo &Info,
SelectionDAG &DAG, SDValue Ptr,
int64_t Offset = 0) { … }
static MachinePointerInfo InferPointerInfo(const MachinePointerInfo &Info,
SelectionDAG &DAG, SDValue Ptr,
SDValue OffsetOp) { … }
SDValue SelectionDAG::getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
EVT VT, const SDLoc &dl, SDValue Chain,
SDValue Ptr, SDValue Offset,
MachinePointerInfo PtrInfo, EVT MemVT,
Align Alignment,
MachineMemOperand::Flags MMOFlags,
const AAMDNodes &AAInfo, const MDNode *Ranges) { … }
SDValue SelectionDAG::getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
EVT VT, const SDLoc &dl, SDValue Chain,
SDValue Ptr, SDValue Offset, EVT MemVT,
MachineMemOperand *MMO) { … }
SDValue SelectionDAG::getLoad(EVT VT, const SDLoc &dl, SDValue Chain,
SDValue Ptr, MachinePointerInfo PtrInfo,
MaybeAlign Alignment,
MachineMemOperand::Flags MMOFlags,
const AAMDNodes &AAInfo, const MDNode *Ranges) { … }
SDValue SelectionDAG::getLoad(EVT VT, const SDLoc &dl, SDValue Chain,
SDValue Ptr, MachineMemOperand *MMO) { … }
SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl,
EVT VT, SDValue Chain, SDValue Ptr,
MachinePointerInfo PtrInfo, EVT MemVT,
MaybeAlign Alignment,
MachineMemOperand::Flags MMOFlags,
const AAMDNodes &AAInfo) { … }
SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl,
EVT VT, SDValue Chain, SDValue Ptr, EVT MemVT,
MachineMemOperand *MMO) { … }
SDValue SelectionDAG::getIndexedLoad(SDValue OrigLoad, const SDLoc &dl,
SDValue Base, SDValue Offset,
ISD::MemIndexedMode AM) { … }
SDValue SelectionDAG::getStore(SDValue Chain, const SDLoc &dl, SDValue Val,
SDValue Ptr, MachinePointerInfo PtrInfo,
Align Alignment,
MachineMemOperand::Flags MMOFlags,
const AAMDNodes &AAInfo) { … }
SDValue SelectionDAG::getStore(SDValue Chain, const SDLoc &dl, SDValue Val,
SDValue Ptr, MachineMemOperand *MMO) { … }
SDValue SelectionDAG::getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val,
SDValue Ptr, MachinePointerInfo PtrInfo,
EVT SVT, Align Alignment,
MachineMemOperand::Flags MMOFlags,
const AAMDNodes &AAInfo) { … }
SDValue SelectionDAG::getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val,
SDValue Ptr, EVT SVT,
MachineMemOperand *MMO) { … }
SDValue SelectionDAG::getIndexedStore(SDValue OrigStore, const SDLoc &dl,
SDValue Base, SDValue Offset,
ISD::MemIndexedMode AM) { … }
SDValue SelectionDAG::getLoadVP(
ISD::MemIndexedMode AM, ISD::LoadExtType ExtType, EVT VT, const SDLoc &dl,
SDValue Chain, SDValue Ptr, SDValue Offset, SDValue Mask, SDValue EVL,
MachinePointerInfo PtrInfo, EVT MemVT, Align Alignment,
MachineMemOperand::Flags MMOFlags, const AAMDNodes &AAInfo,
const MDNode *Ranges, bool IsExpanding) { … }
SDValue SelectionDAG::getLoadVP(ISD::MemIndexedMode AM,
ISD::LoadExtType ExtType, EVT VT,
const SDLoc &dl, SDValue Chain, SDValue Ptr,
SDValue Offset, SDValue Mask, SDValue EVL,
EVT MemVT, MachineMemOperand *MMO,
bool IsExpanding) { … }
SDValue SelectionDAG::getLoadVP(EVT VT, const SDLoc &dl, SDValue Chain,
SDValue Ptr, SDValue Mask, SDValue EVL,
MachinePointerInfo PtrInfo,
MaybeAlign Alignment,
MachineMemOperand::Flags MMOFlags,
const AAMDNodes &AAInfo, const MDNode *Ranges,
bool IsExpanding) { … }
SDValue SelectionDAG::getLoadVP(EVT VT, const SDLoc &dl, SDValue Chain,
SDValue Ptr, SDValue Mask, SDValue EVL,
MachineMemOperand *MMO, bool IsExpanding) { … }
SDValue SelectionDAG::getExtLoadVP(ISD::LoadExtType ExtType, const SDLoc &dl,
EVT VT, SDValue Chain, SDValue Ptr,
SDValue Mask, SDValue EVL,
MachinePointerInfo PtrInfo, EVT MemVT,
MaybeAlign Alignment,
MachineMemOperand::Flags MMOFlags,
const AAMDNodes &AAInfo, bool IsExpanding) { … }
SDValue SelectionDAG::getExtLoadVP(ISD::LoadExtType ExtType, const SDLoc &dl,
EVT VT, SDValue Chain, SDValue Ptr,
SDValue Mask, SDValue EVL, EVT MemVT,
MachineMemOperand *MMO, bool IsExpanding) { … }
SDValue SelectionDAG::getIndexedLoadVP(SDValue OrigLoad, const SDLoc &dl,
SDValue Base, SDValue Offset,
ISD::MemIndexedMode AM) { … }
SDValue SelectionDAG::getStoreVP(SDValue Chain, const SDLoc &dl, SDValue Val,
SDValue Ptr, SDValue Offset, SDValue Mask,
SDValue EVL, EVT MemVT, MachineMemOperand *MMO,
ISD::MemIndexedMode AM, bool IsTruncating,
bool IsCompressing) { … }
SDValue SelectionDAG::getTruncStoreVP(SDValue Chain, const SDLoc &dl,
SDValue Val, SDValue Ptr, SDValue Mask,
SDValue EVL, MachinePointerInfo PtrInfo,
EVT SVT, Align Alignment,
MachineMemOperand::Flags MMOFlags,
const AAMDNodes &AAInfo,
bool IsCompressing) { … }
SDValue SelectionDAG::getTruncStoreVP(SDValue Chain, const SDLoc &dl,
SDValue Val, SDValue Ptr, SDValue Mask,
SDValue EVL, EVT SVT,
MachineMemOperand *MMO,
bool IsCompressing) { … }
SDValue SelectionDAG::getIndexedStoreVP(SDValue OrigStore, const SDLoc &dl,
SDValue Base, SDValue Offset,
ISD::MemIndexedMode AM) { … }
SDValue SelectionDAG::getStridedLoadVP(
ISD::MemIndexedMode AM, ISD::LoadExtType ExtType, EVT VT, const SDLoc &DL,
SDValue Chain, SDValue Ptr, SDValue Offset, SDValue Stride, SDValue Mask,
SDValue EVL, EVT MemVT, MachineMemOperand *MMO, bool IsExpanding) { … }
SDValue SelectionDAG::getStridedLoadVP(EVT VT, const SDLoc &DL, SDValue Chain,
SDValue Ptr, SDValue Stride,
SDValue Mask, SDValue EVL,
MachineMemOperand *MMO,
bool IsExpanding) { … }
SDValue SelectionDAG::getExtStridedLoadVP(
ISD::LoadExtType ExtType, const SDLoc &DL, EVT VT, SDValue Chain,
SDValue Ptr, SDValue Stride, SDValue Mask, SDValue EVL, EVT MemVT,
MachineMemOperand *MMO, bool IsExpanding) { … }
SDValue SelectionDAG::getStridedStoreVP(SDValue Chain, const SDLoc &DL,
SDValue Val, SDValue Ptr,
SDValue Offset, SDValue Stride,
SDValue Mask, SDValue EVL, EVT MemVT,
MachineMemOperand *MMO,
ISD::MemIndexedMode AM,
bool IsTruncating, bool IsCompressing) { … }
SDValue SelectionDAG::getTruncStridedStoreVP(SDValue Chain, const SDLoc &DL,
SDValue Val, SDValue Ptr,
SDValue Stride, SDValue Mask,
SDValue EVL, EVT SVT,
MachineMemOperand *MMO,
bool IsCompressing) { … }
SDValue SelectionDAG::getGatherVP(SDVTList VTs, EVT VT, const SDLoc &dl,
ArrayRef<SDValue> Ops, MachineMemOperand *MMO,
ISD::MemIndexType IndexType) { … }
SDValue SelectionDAG::getScatterVP(SDVTList VTs, EVT VT, const SDLoc &dl,
ArrayRef<SDValue> Ops,
MachineMemOperand *MMO,
ISD::MemIndexType IndexType) { … }
SDValue SelectionDAG::getMaskedLoad(EVT VT, const SDLoc &dl, SDValue Chain,
SDValue Base, SDValue Offset, SDValue Mask,
SDValue PassThru, EVT MemVT,
MachineMemOperand *MMO,
ISD::MemIndexedMode AM,
ISD::LoadExtType ExtTy, bool isExpanding) { … }
SDValue SelectionDAG::getIndexedMaskedLoad(SDValue OrigLoad, const SDLoc &dl,
SDValue Base, SDValue Offset,
ISD::MemIndexedMode AM) { … }
SDValue SelectionDAG::getMaskedStore(SDValue Chain, const SDLoc &dl,
SDValue Val, SDValue Base, SDValue Offset,
SDValue Mask, EVT MemVT,
MachineMemOperand *MMO,
ISD::MemIndexedMode AM, bool IsTruncating,
bool IsCompressing) { … }
SDValue SelectionDAG::getIndexedMaskedStore(SDValue OrigStore, const SDLoc &dl,
SDValue Base, SDValue Offset,
ISD::MemIndexedMode AM) { … }
SDValue SelectionDAG::getMaskedGather(SDVTList VTs, EVT MemVT, const SDLoc &dl,
ArrayRef<SDValue> Ops,
MachineMemOperand *MMO,
ISD::MemIndexType IndexType,
ISD::LoadExtType ExtTy) { … }
SDValue SelectionDAG::getMaskedScatter(SDVTList VTs, EVT MemVT, const SDLoc &dl,
ArrayRef<SDValue> Ops,
MachineMemOperand *MMO,
ISD::MemIndexType IndexType,
bool IsTrunc) { … }
SDValue SelectionDAG::getMaskedHistogram(SDVTList VTs, EVT MemVT,
const SDLoc &dl, ArrayRef<SDValue> Ops,
MachineMemOperand *MMO,
ISD::MemIndexType IndexType) { … }
SDValue SelectionDAG::getGetFPEnv(SDValue Chain, const SDLoc &dl, SDValue Ptr,
EVT MemVT, MachineMemOperand *MMO) { … }
SDValue SelectionDAG::getSetFPEnv(SDValue Chain, const SDLoc &dl, SDValue Ptr,
EVT MemVT, MachineMemOperand *MMO) { … }
SDValue SelectionDAG::simplifySelect(SDValue Cond, SDValue T, SDValue F) { … }
SDValue SelectionDAG::simplifyShift(SDValue X, SDValue Y) { … }
SDValue SelectionDAG::simplifyFPBinop(unsigned Opcode, SDValue X, SDValue Y,
SDNodeFlags Flags) { … }
SDValue SelectionDAG::getVAArg(EVT VT, const SDLoc &dl, SDValue Chain,
SDValue Ptr, SDValue SV, unsigned Align) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
ArrayRef<SDUse> Ops) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
ArrayRef<SDValue> Ops) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
ArrayRef<SDValue> Ops, const SDNodeFlags Flags) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL,
ArrayRef<EVT> ResultTys, ArrayRef<SDValue> Ops) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
ArrayRef<SDValue> Ops) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
ArrayRef<SDValue> Ops, const SDNodeFlags Flags) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL,
SDVTList VTList) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
SDValue N1) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
SDValue N1, SDValue N2) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
SDValue N1, SDValue N2, SDValue N3) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
SDValue N1, SDValue N2, SDValue N3, SDValue N4) { … }
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
SDValue N1, SDValue N2, SDValue N3, SDValue N4,
SDValue N5) { … }
SDVTList SelectionDAG::getVTList(EVT VT) { … }
SDVTList SelectionDAG::getVTList(EVT VT1, EVT VT2) { … }
SDVTList SelectionDAG::getVTList(EVT VT1, EVT VT2, EVT VT3) { … }
SDVTList SelectionDAG::getVTList(EVT VT1, EVT VT2, EVT VT3, EVT VT4) { … }
SDVTList SelectionDAG::getVTList(ArrayRef<EVT> VTs) { … }
SDNode *SelectionDAG::UpdateNodeOperands(SDNode *N, SDValue Op) { … }
SDNode *SelectionDAG::UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2) { … }
SDNode *SelectionDAG::
UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2, SDValue Op3) { … }
SDNode *SelectionDAG::
UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2,
SDValue Op3, SDValue Op4) { … }
SDNode *SelectionDAG::
UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2,
SDValue Op3, SDValue Op4, SDValue Op5) { … }
SDNode *SelectionDAG::
UpdateNodeOperands(SDNode *N, ArrayRef<SDValue> Ops) { … }
void SDNode::DropOperands() { … }
void SelectionDAG::setNodeMemRefs(MachineSDNode *N,
ArrayRef<MachineMemOperand *> NewMemRefs) { … }
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
EVT VT) { … }
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
EVT VT, SDValue Op1) { … }
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
EVT VT, SDValue Op1,
SDValue Op2) { … }
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
EVT VT, SDValue Op1,
SDValue Op2, SDValue Op3) { … }
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
EVT VT, ArrayRef<SDValue> Ops) { … }
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
EVT VT1, EVT VT2, ArrayRef<SDValue> Ops) { … }
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
EVT VT1, EVT VT2) { … }
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
EVT VT1, EVT VT2, EVT VT3,
ArrayRef<SDValue> Ops) { … }
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
EVT VT1, EVT VT2,
SDValue Op1, SDValue Op2) { … }
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
SDVTList VTs,ArrayRef<SDValue> Ops) { … }
SDNode *SelectionDAG::UpdateSDLocOnMergeSDNode(SDNode *N, const SDLoc &OLoc) { … }
SDNode *SelectionDAG::MorphNodeTo(SDNode *N, unsigned Opc,
SDVTList VTs, ArrayRef<SDValue> Ops) { … }
SDNode* SelectionDAG::mutateStrictFPToFP(SDNode *Node) { … }
MachineSDNode *SelectionDAG::getMachineNode(unsigned Opcode, const SDLoc &dl,
EVT VT) { … }
MachineSDNode *SelectionDAG::getMachineNode(unsigned Opcode, const SDLoc &dl,
EVT VT, SDValue Op1) { … }
MachineSDNode *SelectionDAG::getMachineNode(unsigned Opcode, const SDLoc &dl,
EVT VT, SDValue Op1, SDValue Op2) { … }
MachineSDNode *SelectionDAG::getMachineNode(unsigned Opcode, const SDLoc &dl,
EVT VT, SDValue Op1, SDValue Op2,
SDValue Op3) { … }
MachineSDNode *SelectionDAG::getMachineNode(unsigned Opcode, const SDLoc &dl,
EVT VT, ArrayRef<SDValue> Ops) { … }
MachineSDNode *SelectionDAG::getMachineNode(unsigned Opcode, const SDLoc &dl,
EVT VT1, EVT VT2, SDValue Op1,
SDValue Op2) { … }
MachineSDNode *SelectionDAG::getMachineNode(unsigned Opcode, const SDLoc &dl,
EVT VT1, EVT VT2, SDValue Op1,
SDValue Op2, SDValue Op3) { … }
MachineSDNode *SelectionDAG::getMachineNode(unsigned Opcode, const SDLoc &dl,
EVT VT1, EVT VT2,
ArrayRef<SDValue> Ops) { … }
MachineSDNode *SelectionDAG::getMachineNode(unsigned Opcode, const SDLoc &dl,
EVT VT1, EVT VT2, EVT VT3,
SDValue Op1, SDValue Op2) { … }
MachineSDNode *SelectionDAG::getMachineNode(unsigned Opcode, const SDLoc &dl,
EVT VT1, EVT VT2, EVT VT3,
SDValue Op1, SDValue Op2,
SDValue Op3) { … }
MachineSDNode *SelectionDAG::getMachineNode(unsigned Opcode, const SDLoc &dl,
EVT VT1, EVT VT2, EVT VT3,
ArrayRef<SDValue> Ops) { … }
MachineSDNode *SelectionDAG::getMachineNode(unsigned Opcode, const SDLoc &dl,
ArrayRef<EVT> ResultTys,
ArrayRef<SDValue> Ops) { … }
MachineSDNode *SelectionDAG::getMachineNode(unsigned Opcode, const SDLoc &DL,
SDVTList VTs,
ArrayRef<SDValue> Ops) { … }
SDValue SelectionDAG::getTargetExtractSubreg(int SRIdx, const SDLoc &DL, EVT VT,
SDValue Operand) { … }
SDValue SelectionDAG::getTargetInsertSubreg(int SRIdx, const SDLoc &DL, EVT VT,
SDValue Operand, SDValue Subreg) { … }
SDNode *SelectionDAG::getNodeIfExists(unsigned Opcode, SDVTList VTList,
ArrayRef<SDValue> Ops) { … }
SDNode *SelectionDAG::getNodeIfExists(unsigned Opcode, SDVTList VTList,
ArrayRef<SDValue> Ops,
const SDNodeFlags Flags) { … }
bool SelectionDAG::doesNodeExist(unsigned Opcode, SDVTList VTList,
ArrayRef<SDValue> Ops) { … }
SDDbgValue *SelectionDAG::getDbgValue(DIVariable *Var, DIExpression *Expr,
SDNode *N, unsigned R, bool IsIndirect,
const DebugLoc &DL, unsigned O) { … }
SDDbgValue *SelectionDAG::getConstantDbgValue(DIVariable *Var,
DIExpression *Expr,
const Value *C,
const DebugLoc &DL, unsigned O) { … }
SDDbgValue *SelectionDAG::getFrameIndexDbgValue(DIVariable *Var,
DIExpression *Expr, unsigned FI,
bool IsIndirect,
const DebugLoc &DL,
unsigned O) { … }
SDDbgValue *SelectionDAG::getFrameIndexDbgValue(DIVariable *Var,
DIExpression *Expr, unsigned FI,
ArrayRef<SDNode *> Dependencies,
bool IsIndirect,
const DebugLoc &DL,
unsigned O) { … }
SDDbgValue *SelectionDAG::getVRegDbgValue(DIVariable *Var, DIExpression *Expr,
unsigned VReg, bool IsIndirect,
const DebugLoc &DL, unsigned O) { … }
SDDbgValue *SelectionDAG::getDbgValueList(DIVariable *Var, DIExpression *Expr,
ArrayRef<SDDbgOperand> Locs,
ArrayRef<SDNode *> Dependencies,
bool IsIndirect, const DebugLoc &DL,
unsigned O, bool IsVariadic) { … }
void SelectionDAG::transferDbgValues(SDValue From, SDValue To,
unsigned OffsetInBits, unsigned SizeInBits,
bool InvalidateDbg) { … }
void SelectionDAG::salvageDebugInfo(SDNode &N) { … }
SDDbgLabel *SelectionDAG::getDbgLabel(DILabel *Label,
const DebugLoc &DL, unsigned O) { … }
namespace {
class RAUWUpdateListener : public SelectionDAG::DAGUpdateListener { … };
}
void SelectionDAG::ReplaceAllUsesWith(SDValue FromN, SDValue To) { … }
void SelectionDAG::ReplaceAllUsesWith(SDNode *From, SDNode *To) { … }
void SelectionDAG::ReplaceAllUsesWith(SDNode *From, const SDValue *To) { … }
void SelectionDAG::ReplaceAllUsesOfValueWith(SDValue From, SDValue To){ … }
namespace {
struct UseMemo { … };
bool operator<(const UseMemo &L, const UseMemo &R) { … }
class RAUOVWUpdateListener : public SelectionDAG::DAGUpdateListener { … };
}
static bool gluePropagatesDivergence(const SDNode *Node) { … }
bool SelectionDAG::calculateDivergence(SDNode *N) { … }
void SelectionDAG::updateDivergence(SDNode *N) { … }
void SelectionDAG::CreateTopologicalOrder(std::vector<SDNode *> &Order) { … }
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
void SelectionDAG::VerifyDAGDivergence() {
std::vector<SDNode *> TopoOrder;
CreateTopologicalOrder(TopoOrder);
for (auto *N : TopoOrder) {
assert(calculateDivergence(N) == N->isDivergent() &&
"Divergence bit inconsistency detected");
}
}
#endif
void SelectionDAG::ReplaceAllUsesOfValuesWith(const SDValue *From,
const SDValue *To,
unsigned Num){ … }
unsigned SelectionDAG::AssignTopologicalOrder() { … }
void SelectionDAG::AddDbgValue(SDDbgValue *DB, bool isParameter) { … }
void SelectionDAG::AddDbgLabel(SDDbgLabel *DB) { … }
SDValue SelectionDAG::makeEquivalentMemoryOrdering(SDValue OldChain,
SDValue NewMemOpChain) { … }
SDValue SelectionDAG::makeEquivalentMemoryOrdering(LoadSDNode *OldLoad,
SDValue NewMemOp) { … }
SDValue SelectionDAG::getSymbolFunctionGlobalAddress(SDValue Op,
Function **OutFunction) { … }
bool llvm::isNullConstant(SDValue V) { … }
bool llvm::isNullConstantOrUndef(SDValue V) { … }
bool llvm::isNullFPConstant(SDValue V) { … }
bool llvm::isAllOnesConstant(SDValue V) { … }
bool llvm::isOneConstant(SDValue V) { … }
bool llvm::isMinSignedConstant(SDValue V) { … }
bool llvm::isNeutralConstant(unsigned Opcode, SDNodeFlags Flags, SDValue V,
unsigned OperandNo) { … }
SDValue llvm::peekThroughBitcasts(SDValue V) { … }
SDValue llvm::peekThroughOneUseBitcasts(SDValue V) { … }
SDValue llvm::peekThroughExtractSubvectors(SDValue V) { … }
SDValue llvm::peekThroughTruncates(SDValue V) { … }
bool llvm::isBitwiseNot(SDValue V, bool AllowUndefs) { … }
ConstantSDNode *llvm::isConstOrConstSplat(SDValue N, bool AllowUndefs,
bool AllowTruncation) { … }
ConstantSDNode *llvm::isConstOrConstSplat(SDValue N, const APInt &DemandedElts,
bool AllowUndefs,
bool AllowTruncation) { … }
ConstantFPSDNode *llvm::isConstOrConstSplatFP(SDValue N, bool AllowUndefs) { … }
ConstantFPSDNode *llvm::isConstOrConstSplatFP(SDValue N,
const APInt &DemandedElts,
bool AllowUndefs) { … }
bool llvm::isNullOrNullSplat(SDValue N, bool AllowUndefs) { … }
bool llvm::isOneOrOneSplat(SDValue N, bool AllowUndefs) { … }
bool llvm::isAllOnesOrAllOnesSplat(SDValue N, bool AllowUndefs) { … }
HandleSDNode::~HandleSDNode() { … }
MemSDNode::MemSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl,
SDVTList VTs, EVT memvt, MachineMemOperand *mmo)
: … { … }
void SDNode::Profile(FoldingSetNodeID &ID) const { … }
namespace {
struct EVTArray { … };
}
const EVT *SDNode::getValueTypeList(EVT VT) { … }
bool SDNode::hasNUsesOfValue(unsigned NUses, unsigned Value) const { … }
bool SDNode::hasAnyUseOfValue(unsigned Value) const { … }
bool SDNode::isOnlyUserOf(const SDNode *N) const { … }
bool SDNode::areOnlyUsersOf(ArrayRef<const SDNode *> Nodes, const SDNode *N) { … }
bool SDValue::isOperandOf(const SDNode *N) const { … }
bool SDNode::isOperandOf(const SDNode *N) const { … }
bool SDValue::reachesChainWithoutSideEffects(SDValue Dest,
unsigned Depth) const { … }
bool SDNode::hasPredecessor(const SDNode *N) const { … }
void SDNode::intersectFlagsWith(const SDNodeFlags Flags) { … }
SDValue
SelectionDAG::matchBinOpReduction(SDNode *Extract, ISD::NodeType &BinOp,
ArrayRef<ISD::NodeType> CandidateBinOps,
bool AllowPartials) { … }
SDValue SelectionDAG::UnrollVectorOp(SDNode *N, unsigned ResNE) { … }
std::pair<SDValue, SDValue> SelectionDAG::UnrollVectorOverflowOp(
SDNode *N, unsigned ResNE) { … }
bool SelectionDAG::areNonVolatileConsecutiveLoads(LoadSDNode *LD,
LoadSDNode *Base,
unsigned Bytes,
int Dist) const { … }
MaybeAlign SelectionDAG::InferPtrAlign(SDValue Ptr) const { … }
std::pair<SDValue, SDValue> SelectionDAG::SplitScalar(const SDValue &N,
const SDLoc &DL,
const EVT &LoVT,
const EVT &HiVT) { … }
std::pair<EVT, EVT> SelectionDAG::GetSplitDestVTs(const EVT &VT) const { … }
std::pair<EVT, EVT>
SelectionDAG::GetDependentSplitDestVTs(const EVT &VT, const EVT &EnvVT,
bool *HiIsEmpty) const { … }
std::pair<SDValue, SDValue>
SelectionDAG::SplitVector(const SDValue &N, const SDLoc &DL, const EVT &LoVT,
const EVT &HiVT) { … }
std::pair<SDValue, SDValue> SelectionDAG::SplitEVL(SDValue N, EVT VecVT,
const SDLoc &DL) { … }
SDValue SelectionDAG::WidenVector(const SDValue &N, const SDLoc &DL) { … }
void SelectionDAG::ExtractVectorElements(SDValue Op,
SmallVectorImpl<SDValue> &Args,
unsigned Start, unsigned Count,
EVT EltVT) { … }
unsigned GlobalAddressSDNode::getAddressSpace() const { … }
Type *ConstantPoolSDNode::getType() const { … }
bool BuildVectorSDNode::isConstantSplat(APInt &SplatValue, APInt &SplatUndef,
unsigned &SplatBitSize,
bool &HasAnyUndefs,
unsigned MinSplatBits,
bool IsBigEndian) const { … }
SDValue BuildVectorSDNode::getSplatValue(const APInt &DemandedElts,
BitVector *UndefElements) const { … }
SDValue BuildVectorSDNode::getSplatValue(BitVector *UndefElements) const { … }
bool BuildVectorSDNode::getRepeatedSequence(const APInt &DemandedElts,
SmallVectorImpl<SDValue> &Sequence,
BitVector *UndefElements) const { … }
bool BuildVectorSDNode::getRepeatedSequence(SmallVectorImpl<SDValue> &Sequence,
BitVector *UndefElements) const { … }
ConstantSDNode *
BuildVectorSDNode::getConstantSplatNode(const APInt &DemandedElts,
BitVector *UndefElements) const { … }
ConstantSDNode *
BuildVectorSDNode::getConstantSplatNode(BitVector *UndefElements) const { … }
ConstantFPSDNode *
BuildVectorSDNode::getConstantFPSplatNode(const APInt &DemandedElts,
BitVector *UndefElements) const { … }
ConstantFPSDNode *
BuildVectorSDNode::getConstantFPSplatNode(BitVector *UndefElements) const { … }
int32_t
BuildVectorSDNode::getConstantFPSplatPow2ToLog2Int(BitVector *UndefElements,
uint32_t BitWidth) const { … }
bool BuildVectorSDNode::getConstantRawBits(
bool IsLittleEndian, unsigned DstEltSizeInBits,
SmallVectorImpl<APInt> &RawBitElements, BitVector &UndefElements) const { … }
void BuildVectorSDNode::recastRawBits(bool IsLittleEndian,
unsigned DstEltSizeInBits,
SmallVectorImpl<APInt> &DstBitElements,
ArrayRef<APInt> SrcBitElements,
BitVector &DstUndefElements,
const BitVector &SrcUndefElements) { … }
bool BuildVectorSDNode::isConstant() const { … }
std::optional<std::pair<APInt, APInt>>
BuildVectorSDNode::isConstantSequence() const { … }
bool ShuffleVectorSDNode::isSplatMask(const int *Mask, EVT VT) { … }
SDNode *SelectionDAG::isConstantIntBuildVectorOrConstantInt(SDValue N) const { … }
SDNode *SelectionDAG::isConstantFPBuildVectorOrConstantFP(SDValue N) const { … }
std::optional<bool> SelectionDAG::isBoolConstant(SDValue N,
bool AllowTruncation) const { … }
void SelectionDAG::createOperands(SDNode *Node, ArrayRef<SDValue> Vals) { … }
SDValue SelectionDAG::getTokenFactor(const SDLoc &DL,
SmallVectorImpl<SDValue> &Vals) { … }
SDValue SelectionDAG::getNeutralElement(unsigned Opcode, const SDLoc &DL,
EVT VT, SDNodeFlags Flags) { … }
SDValue SelectionDAG::makeStateFunctionCall(unsigned LibFunc, SDValue Ptr,
SDValue InChain,
const SDLoc &DLoc) { … }
void SelectionDAG::copyExtraInfo(SDNode *From, SDNode *To) { … }
#ifndef NDEBUG
static void checkForCyclesHelper(const SDNode *N,
SmallPtrSetImpl<const SDNode*> &Visited,
SmallPtrSetImpl<const SDNode*> &Checked,
const llvm::SelectionDAG *DAG) {
if (Checked.count(N))
return;
if (!Visited.insert(N).second) {
errs() << "Detected cycle in SelectionDAG\n";
dbgs() << "Offending node:\n";
N->dumprFull(DAG); dbgs() << "\n";
abort();
}
for (const SDValue &Op : N->op_values())
checkForCyclesHelper(Op.getNode(), Visited, Checked, DAG);
Checked.insert(N);
Visited.erase(N);
}
#endif
void llvm::checkForCycles(const llvm::SDNode *N,
const llvm::SelectionDAG *DAG,
bool force) { … }
void llvm::checkForCycles(const llvm::SelectionDAG *DAG, bool force) { … }