//===-- LegalizeTypes.h - DAG Type Legalizer class definition ---*- C++ -*-===////// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.// See https://llvm.org/LICENSE.txt for license information.// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception////===----------------------------------------------------------------------===////// This file defines the DAGTypeLegalizer class. This is a private interface// shared between the code that implements the SelectionDAG::LegalizeTypes// method.////===----------------------------------------------------------------------===//#ifndef LLVM_LIB_CODEGEN_SELECTIONDAG_LEGALIZETYPES_H#define LLVM_LIB_CODEGEN_SELECTIONDAG_LEGALIZETYPES_H#include"llvm/ADT/DenseMap.h"#include"llvm/CodeGen/SelectionDAG.h"#include"llvm/CodeGen/TargetLowering.h"#include"llvm/Support/Compiler.h"#include"llvm/Support/Debug.h"namespacellvm{//===----------------------------------------------------------------------===///// This takes an arbitrary SelectionDAG as input and hacks on it until only/// value types the target machine can handle are left. This involves promoting/// small sizes to large sizes or splitting up large values into small values.///classLLVM_LIBRARY_VISIBILITYDAGTypeLegalizer{constTargetLowering&TLI;SelectionDAG&DAG;public:/// This pass uses the NodeId on the SDNodes to hold information about the/// state of the node. The enum has all the values.enumNodeIdFlags{/// All operands have been processed, so this node is ready to be handled.ReadyToProcess=0,/// This is a new node, not before seen, that was created in the process of/// legalizing some other node.NewNode=-1,/// This node's ID needs to be set to the number of its unprocessed/// operands.Unanalyzed=-2,/// This is a node that has already been processed.Processed=-3// 1+ - This is a node which has this many unprocessed operands.};private:/// This is a bitvector that contains two bits for each simple value type,/// where the two bits correspond to the LegalizeAction enum from/// TargetLowering. This can be queried with "getTypeAction(VT)".TargetLowering::ValueTypeActionImplValueTypeActions;/// Return how we should legalize values of this type.TargetLowering::LegalizeTypeActiongetTypeAction(EVTVT)const{returnTLI.getTypeAction(*DAG.getContext(),VT);}/// Return true if this type is legal on this target.boolisTypeLegal(EVTVT)const{returnTLI.getTypeAction(*DAG.getContext(),VT)==TargetLowering::TypeLegal;}/// Return true if this is a simple legal type.boolisSimpleLegalType(EVTVT)const{returnVT.isSimple()&&TLI.isTypeLegal(VT);}/// Return true if this type can be passed in registers./// For example, x86_64's f128, should to be legally in registers/// and only some operations converted to library calls or integer/// bitwise operations.boolisLegalInHWReg(EVTVT)const{EVTNVT=TLI.getTypeToTransformTo(*DAG.getContext(),VT);returnVT==NVT&&isSimpleLegalType(VT);}EVTgetSetCCResultType(EVTVT)const{returnTLI.getSetCCResultType(DAG.getDataLayout(),*DAG.getContext(),VT);}/// Pretend all of this node's results are legal.boolIgnoreNodeResults(SDNode*N)const{returnN->getOpcode()==ISD::TargetConstant||N->getOpcode()==ISD::Register;}// Bijection from SDValue to unique id. As each created node gets a// new id we do not need to worry about reuse expunging. Should we// run out of ids, we can do a one time expensive compactifcation.typedefunsignedTableId;TableIdNextValueId=1;SmallDenseMap<SDValue,TableId,8>ValueToIdMap;SmallDenseMap<TableId,SDValue,8>IdToValueMap;/// For integer nodes that are below legal width, this map indicates what/// promoted value to use.SmallDenseMap<TableId,TableId,8>PromotedIntegers;/// For integer nodes that need to be expanded this map indicates which/// operands are the expanded version of the input.SmallDenseMap<TableId,std::pair<TableId,TableId>,8>ExpandedIntegers;/// For floating-point nodes converted to integers of the same size, this map/// indicates the converted value to use.SmallDenseMap<TableId,TableId,8>SoftenedFloats;/// For floating-point nodes that have a smaller precision than the smallest/// supported precision, this map indicates what promoted value to use.SmallDenseMap<TableId,TableId,8>PromotedFloats;/// For float nodes that need to be expanded this map indicates which operands/// are the expanded version of the input.SmallDenseMap<TableId,std::pair<TableId,TableId>,8>ExpandedFloats;/// For nodes that are <1 x ty>, this map indicates the scalar value of type/// 'ty' to use.SmallDenseMap<TableId,TableId,8>ScalarizedVectors;/// For nodes that need to be split this map indicates which operands are the/// expanded version of the input.SmallDenseMap<TableId,std::pair<TableId,TableId>,8>SplitVectors;/// For vector nodes that need to be widened, indicates the widened value to/// use.SmallDenseMap<TableId,TableId,8>WidenedVectors;/// For values that have been replaced with another, indicates the replacement/// value to use.SmallDenseMap<TableId,TableId,8>ReplacedValues;/// This defines a worklist of nodes to process. In order to be pushed onto/// this worklist, all operands of a node must have already been processed.SmallVector<SDNode*,128>Worklist;TableIdgetTableId(SDValueV){assert(V.getNode()&&"Getting TableId on SDValue()");autoI=ValueToIdMap.find(V);if(I!=ValueToIdMap.end()){// replace if there's been a shift.RemapId(I->second);assert(I->second&&"All Ids should be nonzero");returnI->second;}// Add if it's not there.ValueToIdMap.insert(std::make_pair(V,NextValueId));IdToValueMap.insert(std::make_pair(NextValueId,V));++NextValueId;assert(NextValueId!=0&&"Ran out of Ids. Increase id type size or add compactification");returnNextValueId-1;}constSDValue&getSDValue(TableId&Id){RemapId(Id);assert(Id&&"TableId should be non-zero");returnIdToValueMap[Id];}public:explicitDAGTypeLegalizer(SelectionDAG&dag):TLI(dag.getTargetLoweringInfo()),DAG(dag),ValueTypeActions(TLI.getValueTypeActions()){static_assert(MVT::LAST_VALUETYPE<=MVT::MAX_ALLOWED_VALUETYPE,"Too many value types for ValueTypeActions to hold!");}/// This is the main entry point for the type legalizer. This does a/// top-down traversal of the dag, legalizing types as it goes. Returns/// "true" if it made any changes.boolrun();voidNoteDeletion(SDNode*Old,SDNode*New){for(unsignedi=0,e=Old->getNumValues();i!=e;++i){TableIdNewId=getTableId(SDValue(New,i));TableIdOldId=getTableId(SDValue(Old,i));if(OldId!=NewId)ReplacedValues[OldId]=NewId;// Delete Node from tables.ValueToIdMap.erase(SDValue(Old,i));IdToValueMap.erase(OldId);PromotedIntegers.erase(OldId);ExpandedIntegers.erase(OldId);SoftenedFloats.erase(OldId);PromotedFloats.erase(OldId);ExpandedFloats.erase(OldId);ScalarizedVectors.erase(OldId);SplitVectors.erase(OldId);WidenedVectors.erase(OldId);}}SelectionDAG&getDAG()const{returnDAG;}private:SDNode*AnalyzeNewNode(SDNode*N);voidAnalyzeNewValue(SDValue&Val);voidPerformExpensiveChecks();voidRemapId(TableId&Id);voidRemapValue(SDValue&V);// Common routines.SDValueBitConvertToInteger(SDValueOp);SDValueBitConvertVectorToIntegerVector(SDValueOp);SDValueCreateStackStoreLoad(SDValueOp,EVTDestVT);boolCustomLowerNode(SDNode*N,EVTVT,boolLegalizeResult);boolCustomWidenLowerNode(SDNode*N,EVTVT);/// Replace each result of the given MERGE_VALUES node with the corresponding/// input operand, except for the result 'ResNo', for which the corresponding/// input operand is returned.SDValueDisintegrateMERGE_VALUES(SDNode*N,unsignedResNo);SDValueJoinIntegers(SDValueLo,SDValueHi);SDValueLibCallify(RTLIB::LibcallLC,SDNode*N,boolisSigned);std::pair<SDValue,SDValue>ExpandChainLibCall(RTLIB::LibcallLC,SDNode*Node,boolisSigned);std::pair<SDValue,SDValue>ExpandAtomic(SDNode*Node);SDValuePromoteTargetBoolean(SDValueBool,EVTValVT);voidReplaceValueWith(SDValueFrom,SDValueTo);voidSplitInteger(SDValueOp,SDValue&Lo,SDValue&Hi);voidSplitInteger(SDValueOp,EVTLoVT,EVTHiVT,SDValue&Lo,SDValue&Hi);voidAddToWorklist(SDNode*N){N->setNodeId(ReadyToProcess);Worklist.push_back(N);}//===--------------------------------------------------------------------===//// Integer Promotion Support: LegalizeIntegerTypes.cpp//===--------------------------------------------------------------------===///// Given a processed operand Op which was promoted to a larger integer type,/// this returns the promoted value. The low bits of the promoted value/// corresponding to the original type are exactly equal to Op./// The extra bits contain rubbish, so the promoted value may need to be zero-/// or sign-extended from the original type before it is usable (the helpers/// SExtPromotedInteger and ZExtPromotedInteger can do this for you)./// For example, if Op is an i16 and was promoted to an i32, then this method/// returns an i32, the lower 16 bits of which coincide with Op, and the upper/// 16 bits of which contain rubbish.SDValueGetPromotedInteger(SDValueOp){TableId&PromotedId=PromotedIntegers[getTableId(Op)];SDValuePromotedOp=getSDValue(PromotedId);assert(PromotedOp.getNode()&&"Operand wasn't promoted?");returnPromotedOp;}voidSetPromotedInteger(SDValueOp,SDValueResult);/// Get a promoted operand and sign extend it to the final size.SDValueSExtPromotedInteger(SDValueOp){EVTOldVT=Op.getValueType();SDLocdl(Op);Op=GetPromotedInteger(Op);returnDAG.getNode(ISD::SIGN_EXTEND_INREG,dl,Op.getValueType(),Op,DAG.getValueType(OldVT));}/// Get a promoted operand and zero extend it to the final size.SDValueZExtPromotedInteger(SDValueOp){EVTOldVT=Op.getValueType();SDLocdl(Op);Op=GetPromotedInteger(Op);returnDAG.getZeroExtendInReg(Op,dl,OldVT.getScalarType());}// Get a promoted operand and sign or zero extend it to the final size// (depending on TargetLoweringInfo::isSExtCheaperThanZExt). For a given// subtarget and type, the choice of sign or zero-extension will be// consistent.SDValueSExtOrZExtPromotedInteger(SDValueOp){EVTOldVT=Op.getValueType();SDLocDL(Op);Op=GetPromotedInteger(Op);if(TLI.isSExtCheaperThanZExt(OldVT,Op.getValueType()))returnDAG.getNode(ISD::SIGN_EXTEND_INREG,DL,Op.getValueType(),Op,DAG.getValueType(OldVT));returnDAG.getZeroExtendInReg(Op,DL,OldVT.getScalarType());}// Integer Result Promotion.voidPromoteIntegerResult(SDNode*N,unsignedResNo);SDValuePromoteIntRes_MERGE_VALUES(SDNode*N,unsignedResNo);SDValuePromoteIntRes_AssertSext(SDNode*N);SDValuePromoteIntRes_AssertZext(SDNode*N);SDValuePromoteIntRes_Atomic0(AtomicSDNode*N);SDValuePromoteIntRes_Atomic1(AtomicSDNode*N);SDValuePromoteIntRes_AtomicCmpSwap(AtomicSDNode*N,unsignedResNo);SDValuePromoteIntRes_EXTRACT_SUBVECTOR(SDNode*N);SDValuePromoteIntRes_VECTOR_SHUFFLE(SDNode*N);SDValuePromoteIntRes_BUILD_VECTOR(SDNode*N);SDValuePromoteIntRes_SCALAR_TO_VECTOR(SDNode*N);SDValuePromoteIntRes_EXTEND_VECTOR_INREG(SDNode*N);SDValuePromoteIntRes_INSERT_VECTOR_ELT(SDNode*N);SDValuePromoteIntRes_CONCAT_VECTORS(SDNode*N);SDValuePromoteIntRes_BITCAST(SDNode*N);SDValuePromoteIntRes_BSWAP(SDNode*N);SDValuePromoteIntRes_BITREVERSE(SDNode*N);SDValuePromoteIntRes_BUILD_PAIR(SDNode*N);SDValuePromoteIntRes_Constant(SDNode*N);SDValuePromoteIntRes_CTLZ(SDNode*N);SDValuePromoteIntRes_CTPOP(SDNode*N);SDValuePromoteIntRes_CTTZ(SDNode*N);SDValuePromoteIntRes_EXTRACT_VECTOR_ELT(SDNode*N);SDValuePromoteIntRes_FP_TO_XINT(SDNode*N);SDValuePromoteIntRes_FP_TO_FP16(SDNode*N);SDValuePromoteIntRes_INT_EXTEND(SDNode*N);SDValuePromoteIntRes_LOAD(LoadSDNode*N);SDValuePromoteIntRes_MLOAD(MaskedLoadSDNode*N);SDValuePromoteIntRes_MGATHER(MaskedGatherSDNode*N);SDValuePromoteIntRes_Overflow(SDNode*N);SDValuePromoteIntRes_SADDSUBO(SDNode*N,unsignedResNo);SDValuePromoteIntRes_SELECT(SDNode*N);SDValuePromoteIntRes_VSELECT(SDNode*N);SDValuePromoteIntRes_SELECT_CC(SDNode*N);SDValuePromoteIntRes_SETCC(SDNode*N);SDValuePromoteIntRes_SHL(SDNode*N);SDValuePromoteIntRes_SimpleIntBinOp(SDNode*N);SDValuePromoteIntRes_ZExtIntBinOp(SDNode*N);SDValuePromoteIntRes_SExtIntBinOp(SDNode*N);SDValuePromoteIntRes_SIGN_EXTEND_INREG(SDNode*N);SDValuePromoteIntRes_SRA(SDNode*N);SDValuePromoteIntRes_SRL(SDNode*N);SDValuePromoteIntRes_TRUNCATE(SDNode*N);SDValuePromoteIntRes_UADDSUBO(SDNode*N,unsignedResNo);SDValuePromoteIntRes_ADDSUBCARRY(SDNode*N,unsignedResNo);SDValuePromoteIntRes_UNDEF(SDNode*N);SDValuePromoteIntRes_VAARG(SDNode*N);SDValuePromoteIntRes_XMULO(SDNode*N,unsignedResNo);SDValuePromoteIntRes_ADDSUBSAT(SDNode*N);SDValuePromoteIntRes_MULFIX(SDNode*N);SDValuePromoteIntRes_FLT_ROUNDS(SDNode*N);SDValuePromoteIntRes_VECREDUCE(SDNode*N);SDValuePromoteIntRes_ABS(SDNode*N);// Integer Operand Promotion.boolPromoteIntegerOperand(SDNode*N,unsignedOpNo);SDValuePromoteIntOp_ANY_EXTEND(SDNode*N);SDValuePromoteIntOp_ATOMIC_STORE(AtomicSDNode*N);SDValuePromoteIntOp_BITCAST(SDNode*N);SDValuePromoteIntOp_BUILD_PAIR(SDNode*N);SDValuePromoteIntOp_BR_CC(SDNode*N,unsignedOpNo);SDValuePromoteIntOp_BRCOND(SDNode*N,unsignedOpNo);SDValuePromoteIntOp_BUILD_VECTOR(SDNode*N);SDValuePromoteIntOp_INSERT_VECTOR_ELT(SDNode*N,unsignedOpNo);SDValuePromoteIntOp_EXTRACT_VECTOR_ELT(SDNode*N);SDValuePromoteIntOp_EXTRACT_SUBVECTOR(SDNode*N);SDValuePromoteIntOp_CONCAT_VECTORS(SDNode*N);SDValuePromoteIntOp_SCALAR_TO_VECTOR(SDNode*N);SDValuePromoteIntOp_SELECT(SDNode*N,unsignedOpNo);SDValuePromoteIntOp_SELECT_CC(SDNode*N,unsignedOpNo);SDValuePromoteIntOp_SETCC(SDNode*N,unsignedOpNo);SDValuePromoteIntOp_Shift(SDNode*N);SDValuePromoteIntOp_SIGN_EXTEND(SDNode*N);SDValuePromoteIntOp_SINT_TO_FP(SDNode*N);SDValuePromoteIntOp_STORE(StoreSDNode*N,unsignedOpNo);SDValuePromoteIntOp_TRUNCATE(SDNode*N);SDValuePromoteIntOp_UINT_TO_FP(SDNode*N);SDValuePromoteIntOp_ZERO_EXTEND(SDNode*N);SDValuePromoteIntOp_MSTORE(MaskedStoreSDNode*N,unsignedOpNo);SDValuePromoteIntOp_MLOAD(MaskedLoadSDNode*N,unsignedOpNo);SDValuePromoteIntOp_MSCATTER(MaskedScatterSDNode*N,unsignedOpNo);SDValuePromoteIntOp_MGATHER(MaskedGatherSDNode*N,unsignedOpNo);SDValuePromoteIntOp_ADDSUBCARRY(SDNode*N,unsignedOpNo);SDValuePromoteIntOp_FRAMERETURNADDR(SDNode*N);SDValuePromoteIntOp_PREFETCH(SDNode*N,unsignedOpNo);SDValuePromoteIntOp_MULFIX(SDNode*N);SDValuePromoteIntOp_FPOWI(SDNode*N);SDValuePromoteIntOp_VECREDUCE(SDNode*N);voidPromoteSetCCOperands(SDValue&LHS,SDValue&RHS,ISD::CondCodeCode);//===--------------------------------------------------------------------===//// Integer Expansion Support: LegalizeIntegerTypes.cpp//===--------------------------------------------------------------------===///// Given a processed operand Op which was expanded into two integers of half/// the size, this returns the two halves. The low bits of Op are exactly/// equal to the bits of Lo; the high bits exactly equal Hi./// For example, if Op is an i64 which was expanded into two i32's, then this/// method returns the two i32's, with Lo being equal to the lower 32 bits of/// Op, and Hi being equal to the upper 32 bits.voidGetExpandedInteger(SDValueOp,SDValue&Lo,SDValue&Hi);voidSetExpandedInteger(SDValueOp,SDValueLo,SDValueHi);// Integer Result Expansion.voidExpandIntegerResult(SDNode*N,unsignedResNo);voidExpandIntRes_ANY_EXTEND(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_AssertSext(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_AssertZext(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_Constant(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_ABS(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_CTLZ(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_CTPOP(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_CTTZ(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_LOAD(LoadSDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_READCYCLECOUNTER(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_SIGN_EXTEND(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_SIGN_EXTEND_INREG(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_TRUNCATE(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_ZERO_EXTEND(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_FLT_ROUNDS(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_FP_TO_SINT(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_FP_TO_UINT(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_LLROUND(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_LLRINT(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_Logical(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_ADDSUB(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_ADDSUBC(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_ADDSUBE(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_ADDSUBCARRY(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_BITREVERSE(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_BSWAP(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_MUL(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_SDIV(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_SREM(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_UDIV(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_UREM(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_Shift(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_MINMAX(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_SADDSUBO(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_UADDSUBO(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_XMULO(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_ADDSUBSAT(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_MULFIX(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_ATOMIC_LOAD(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandIntRes_VECREDUCE(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandShiftByConstant(SDNode*N,constAPInt&Amt,SDValue&Lo,SDValue&Hi);boolExpandShiftWithKnownAmountBit(SDNode*N,SDValue&Lo,SDValue&Hi);boolExpandShiftWithUnknownAmountBit(SDNode*N,SDValue&Lo,SDValue&Hi);// Integer Operand Expansion.boolExpandIntegerOperand(SDNode*N,unsignedOpNo);SDValueExpandIntOp_BR_CC(SDNode*N);SDValueExpandIntOp_SELECT_CC(SDNode*N);SDValueExpandIntOp_SETCC(SDNode*N);SDValueExpandIntOp_SETCCCARRY(SDNode*N);SDValueExpandIntOp_Shift(SDNode*N);SDValueExpandIntOp_SINT_TO_FP(SDNode*N);SDValueExpandIntOp_STORE(StoreSDNode*N,unsignedOpNo);SDValueExpandIntOp_TRUNCATE(SDNode*N);SDValueExpandIntOp_UINT_TO_FP(SDNode*N);SDValueExpandIntOp_RETURNADDR(SDNode*N);SDValueExpandIntOp_ATOMIC_STORE(SDNode*N);voidIntegerExpandSetCCOperands(SDValue&NewLHS,SDValue&NewRHS,ISD::CondCode&CCCode,constSDLoc&dl);//===--------------------------------------------------------------------===//// Float to Integer Conversion Support: LegalizeFloatTypes.cpp//===--------------------------------------------------------------------===///// Given an operand Op of Float type, returns the integer if the Op is not/// supported in target HW and converted to the integer./// The integer contains exactly the same bits as Op - only the type changed./// For example, if Op is an f32 which was softened to an i32, then this/// method returns an i32, the bits of which coincide with those of Op./// If the Op can be efficiently supported in target HW or the operand must/// stay in a register, the Op is not converted to an integer./// In that case, the given op is returned.SDValueGetSoftenedFloat(SDValueOp){TableIdId=getTableId(Op);autoIter=SoftenedFloats.find(Id);if(Iter==SoftenedFloats.end()){assert(isSimpleLegalType(Op.getValueType())&&"Operand wasn't converted to integer?");returnOp;}SDValueSoftenedOp=getSDValue(Iter->second);assert(SoftenedOp.getNode()&&"Unconverted op in SoftenedFloats?");returnSoftenedOp;}voidSetSoftenedFloat(SDValueOp,SDValueResult);// Convert Float Results to Integer for Non-HW-supported Operations.boolSoftenFloatResult(SDNode*N,unsignedResNo);SDValueSoftenFloatRes_MERGE_VALUES(SDNode*N,unsignedResNo);SDValueSoftenFloatRes_BITCAST(SDNode*N,unsignedResNo);SDValueSoftenFloatRes_BUILD_PAIR(SDNode*N);SDValueSoftenFloatRes_ConstantFP(SDNode*N,unsignedResNo);SDValueSoftenFloatRes_EXTRACT_VECTOR_ELT(SDNode*N,unsignedResNo);SDValueSoftenFloatRes_FABS(SDNode*N,unsignedResNo);SDValueSoftenFloatRes_FMINNUM(SDNode*N);SDValueSoftenFloatRes_FMAXNUM(SDNode*N);SDValueSoftenFloatRes_FADD(SDNode*N);SDValueSoftenFloatRes_FCEIL(SDNode*N);SDValueSoftenFloatRes_FCOPYSIGN(SDNode*N,unsignedResNo);SDValueSoftenFloatRes_FCOS(SDNode*N);SDValueSoftenFloatRes_FDIV(SDNode*N);SDValueSoftenFloatRes_FEXP(SDNode*N);SDValueSoftenFloatRes_FEXP2(SDNode*N);SDValueSoftenFloatRes_FFLOOR(SDNode*N);SDValueSoftenFloatRes_FLOG(SDNode*N);SDValueSoftenFloatRes_FLOG2(SDNode*N);SDValueSoftenFloatRes_FLOG10(SDNode*N);SDValueSoftenFloatRes_FMA(SDNode*N);SDValueSoftenFloatRes_FMUL(SDNode*N);SDValueSoftenFloatRes_FNEARBYINT(SDNode*N);SDValueSoftenFloatRes_FNEG(SDNode*N,unsignedResNo);SDValueSoftenFloatRes_FP_EXTEND(SDNode*N);SDValueSoftenFloatRes_FP16_TO_FP(SDNode*N);SDValueSoftenFloatRes_FP_ROUND(SDNode*N);SDValueSoftenFloatRes_FPOW(SDNode*N);SDValueSoftenFloatRes_FPOWI(SDNode*N);SDValueSoftenFloatRes_FREM(SDNode*N);SDValueSoftenFloatRes_FRINT(SDNode*N);SDValueSoftenFloatRes_FROUND(SDNode*N);SDValueSoftenFloatRes_FSIN(SDNode*N);SDValueSoftenFloatRes_FSQRT(SDNode*N);SDValueSoftenFloatRes_FSUB(SDNode*N);SDValueSoftenFloatRes_FTRUNC(SDNode*N);SDValueSoftenFloatRes_LOAD(SDNode*N,unsignedResNo);SDValueSoftenFloatRes_SELECT(SDNode*N,unsignedResNo);SDValueSoftenFloatRes_SELECT_CC(SDNode*N,unsignedResNo);SDValueSoftenFloatRes_UNDEF(SDNode*N);SDValueSoftenFloatRes_VAARG(SDNode*N);SDValueSoftenFloatRes_XINT_TO_FP(SDNode*N);// Return true if we can skip softening the given operand or SDNode because// either it was soften before by SoftenFloatResult and references to the// operand were replaced by ReplaceValueWith or it's value type is legal in HW// registers and the operand can be left unchanged.boolCanSkipSoftenFloatOperand(SDNode*N,unsignedOpNo);// Convert Float Operand to Integer for Non-HW-supported Operations.boolSoftenFloatOperand(SDNode*N,unsignedOpNo);SDValueSoftenFloatOp_BITCAST(SDNode*N);SDValueSoftenFloatOp_COPY_TO_REG(SDNode*N);SDValueSoftenFloatOp_BR_CC(SDNode*N);SDValueSoftenFloatOp_FABS(SDNode*N);SDValueSoftenFloatOp_FCOPYSIGN(SDNode*N);SDValueSoftenFloatOp_FNEG(SDNode*N);SDValueSoftenFloatOp_FP_EXTEND(SDNode*N);SDValueSoftenFloatOp_FP_ROUND(SDNode*N);SDValueSoftenFloatOp_FP_TO_XINT(SDNode*N);SDValueSoftenFloatOp_LROUND(SDNode*N);SDValueSoftenFloatOp_LLROUND(SDNode*N);SDValueSoftenFloatOp_LRINT(SDNode*N);SDValueSoftenFloatOp_LLRINT(SDNode*N);SDValueSoftenFloatOp_SELECT(SDNode*N);SDValueSoftenFloatOp_SELECT_CC(SDNode*N);SDValueSoftenFloatOp_SETCC(SDNode*N);SDValueSoftenFloatOp_STORE(SDNode*N,unsignedOpNo);//===--------------------------------------------------------------------===//// Float Expansion Support: LegalizeFloatTypes.cpp//===--------------------------------------------------------------------===///// Given a processed operand Op which was expanded into two floating-point/// values of half the size, this returns the two halves./// The low bits of Op are exactly equal to the bits of Lo; the high bits/// exactly equal Hi. For example, if Op is a ppcf128 which was expanded/// into two f64's, then this method returns the two f64's, with Lo being/// equal to the lower 64 bits of Op, and Hi to the upper 64 bits.voidGetExpandedFloat(SDValueOp,SDValue&Lo,SDValue&Hi);voidSetExpandedFloat(SDValueOp,SDValueLo,SDValueHi);// Float Result Expansion.voidExpandFloatResult(SDNode*N,unsignedResNo);voidExpandFloatRes_ConstantFP(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FABS(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FMINNUM(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FMAXNUM(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FADD(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FCEIL(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FCOPYSIGN(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FCOS(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FDIV(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FEXP(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FEXP2(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FFLOOR(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FLOG(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FLOG2(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FLOG10(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FMA(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FMUL(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FNEARBYINT(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FNEG(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FP_EXTEND(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FPOW(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FPOWI(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FREM(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FRINT(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FROUND(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FSIN(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FSQRT(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FSUB(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_FTRUNC(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_LOAD(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandFloatRes_XINT_TO_FP(SDNode*N,SDValue&Lo,SDValue&Hi);// Float Operand Expansion.boolExpandFloatOperand(SDNode*N,unsignedOpNo);SDValueExpandFloatOp_BR_CC(SDNode*N);SDValueExpandFloatOp_FCOPYSIGN(SDNode*N);SDValueExpandFloatOp_FP_ROUND(SDNode*N);SDValueExpandFloatOp_FP_TO_SINT(SDNode*N);SDValueExpandFloatOp_FP_TO_UINT(SDNode*N);SDValueExpandFloatOp_LROUND(SDNode*N);SDValueExpandFloatOp_LLROUND(SDNode*N);SDValueExpandFloatOp_LRINT(SDNode*N);SDValueExpandFloatOp_LLRINT(SDNode*N);SDValueExpandFloatOp_SELECT_CC(SDNode*N);SDValueExpandFloatOp_SETCC(SDNode*N);SDValueExpandFloatOp_STORE(SDNode*N,unsignedOpNo);voidFloatExpandSetCCOperands(SDValue&NewLHS,SDValue&NewRHS,ISD::CondCode&CCCode,constSDLoc&dl);//===--------------------------------------------------------------------===//// Float promotion support: LegalizeFloatTypes.cpp//===--------------------------------------------------------------------===//SDValueGetPromotedFloat(SDValueOp){TableId&PromotedId=PromotedFloats[getTableId(Op)];SDValuePromotedOp=getSDValue(PromotedId);assert(PromotedOp.getNode()&&"Operand wasn't promoted?");returnPromotedOp;}voidSetPromotedFloat(SDValueOp,SDValueResult);voidPromoteFloatResult(SDNode*N,unsignedResNo);SDValuePromoteFloatRes_BITCAST(SDNode*N);SDValuePromoteFloatRes_BinOp(SDNode*N);SDValuePromoteFloatRes_ConstantFP(SDNode*N);SDValuePromoteFloatRes_EXTRACT_VECTOR_ELT(SDNode*N);SDValuePromoteFloatRes_FCOPYSIGN(SDNode*N);SDValuePromoteFloatRes_FMAD(SDNode*N);SDValuePromoteFloatRes_FPOWI(SDNode*N);SDValuePromoteFloatRes_FP_ROUND(SDNode*N);SDValuePromoteFloatRes_LOAD(SDNode*N);SDValuePromoteFloatRes_SELECT(SDNode*N);SDValuePromoteFloatRes_SELECT_CC(SDNode*N);SDValuePromoteFloatRes_UnaryOp(SDNode*N);SDValuePromoteFloatRes_UNDEF(SDNode*N);SDValueBitcastToInt_ATOMIC_SWAP(SDNode*N);SDValuePromoteFloatRes_XINT_TO_FP(SDNode*N);boolPromoteFloatOperand(SDNode*N,unsignedOpNo);SDValuePromoteFloatOp_BITCAST(SDNode*N,unsignedOpNo);SDValuePromoteFloatOp_FCOPYSIGN(SDNode*N,unsignedOpNo);SDValuePromoteFloatOp_FP_EXTEND(SDNode*N,unsignedOpNo);SDValuePromoteFloatOp_FP_TO_XINT(SDNode*N,unsignedOpNo);SDValuePromoteFloatOp_STORE(SDNode*N,unsignedOpNo);SDValuePromoteFloatOp_SELECT_CC(SDNode*N,unsignedOpNo);SDValuePromoteFloatOp_SETCC(SDNode*N,unsignedOpNo);//===--------------------------------------------------------------------===//// Scalarization Support: LegalizeVectorTypes.cpp//===--------------------------------------------------------------------===///// Given a processed one-element vector Op which was scalarized to its/// element type, this returns the element. For example, if Op is a v1i32,/// Op = < i32 val >, this method returns val, an i32.SDValueGetScalarizedVector(SDValueOp){TableId&ScalarizedId=ScalarizedVectors[getTableId(Op)];SDValueScalarizedOp=getSDValue(ScalarizedId);assert(ScalarizedOp.getNode()&&"Operand wasn't scalarized?");returnScalarizedOp;}voidSetScalarizedVector(SDValueOp,SDValueResult);// Vector Result Scalarization: <1 x ty> -> ty.voidScalarizeVectorResult(SDNode*N,unsignedResNo);SDValueScalarizeVecRes_MERGE_VALUES(SDNode*N,unsignedResNo);SDValueScalarizeVecRes_BinOp(SDNode*N);SDValueScalarizeVecRes_TernaryOp(SDNode*N);SDValueScalarizeVecRes_UnaryOp(SDNode*N);SDValueScalarizeVecRes_StrictFPOp(SDNode*N);SDValueScalarizeVecRes_OverflowOp(SDNode*N,unsignedResNo);SDValueScalarizeVecRes_InregOp(SDNode*N);SDValueScalarizeVecRes_VecInregOp(SDNode*N);SDValueScalarizeVecRes_BITCAST(SDNode*N);SDValueScalarizeVecRes_BUILD_VECTOR(SDNode*N);SDValueScalarizeVecRes_EXTRACT_SUBVECTOR(SDNode*N);SDValueScalarizeVecRes_FP_ROUND(SDNode*N);SDValueScalarizeVecRes_STRICT_FP_ROUND(SDNode*N);SDValueScalarizeVecRes_FPOWI(SDNode*N);SDValueScalarizeVecRes_INSERT_VECTOR_ELT(SDNode*N);SDValueScalarizeVecRes_LOAD(LoadSDNode*N);SDValueScalarizeVecRes_SCALAR_TO_VECTOR(SDNode*N);SDValueScalarizeVecRes_VSELECT(SDNode*N);SDValueScalarizeVecRes_SELECT(SDNode*N);SDValueScalarizeVecRes_SELECT_CC(SDNode*N);SDValueScalarizeVecRes_SETCC(SDNode*N);SDValueScalarizeVecRes_UNDEF(SDNode*N);SDValueScalarizeVecRes_VECTOR_SHUFFLE(SDNode*N);SDValueScalarizeVecRes_MULFIX(SDNode*N);// Vector Operand Scalarization: <1 x ty> -> ty.boolScalarizeVectorOperand(SDNode*N,unsignedOpNo);SDValueScalarizeVecOp_BITCAST(SDNode*N);SDValueScalarizeVecOp_UnaryOp(SDNode*N);SDValueScalarizeVecOp_CONCAT_VECTORS(SDNode*N);SDValueScalarizeVecOp_EXTRACT_VECTOR_ELT(SDNode*N);SDValueScalarizeVecOp_VSELECT(SDNode*N);SDValueScalarizeVecOp_VSETCC(SDNode*N);SDValueScalarizeVecOp_STORE(StoreSDNode*N,unsignedOpNo);SDValueScalarizeVecOp_FP_ROUND(SDNode*N,unsignedOpNo);SDValueScalarizeVecOp_STRICT_FP_ROUND(SDNode*N,unsignedOpNo);SDValueScalarizeVecOp_VECREDUCE(SDNode*N);//===--------------------------------------------------------------------===//// Vector Splitting Support: LegalizeVectorTypes.cpp//===--------------------------------------------------------------------===///// Given a processed vector Op which was split into vectors of half the size,/// this method returns the halves. The first elements of Op coincide with the/// elements of Lo; the remaining elements of Op coincide with the elements of/// Hi: Op is what you would get by concatenating Lo and Hi./// For example, if Op is a v8i32 that was split into two v4i32's, then this/// method returns the two v4i32's, with Lo corresponding to the first 4/// elements of Op, and Hi to the last 4 elements.voidGetSplitVector(SDValueOp,SDValue&Lo,SDValue&Hi);voidSetSplitVector(SDValueOp,SDValueLo,SDValueHi);// Vector Result Splitting: <128 x ty> -> 2 x <64 x ty>.voidSplitVectorResult(SDNode*N,unsignedResNo);voidSplitVecRes_BinOp(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_TernaryOp(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_UnaryOp(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_ExtendOp(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_InregOp(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_ExtVecInRegOp(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_StrictFPOp(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_OverflowOp(SDNode*N,unsignedResNo,SDValue&Lo,SDValue&Hi);voidSplitVecRes_MULFIX(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_BITCAST(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_BUILD_VECTOR(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_CONCAT_VECTORS(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_EXTRACT_SUBVECTOR(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_INSERT_SUBVECTOR(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_FPOWI(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_FCOPYSIGN(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_INSERT_VECTOR_ELT(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_LOAD(LoadSDNode*LD,SDValue&Lo,SDValue&Hi);voidSplitVecRes_MLOAD(MaskedLoadSDNode*MLD,SDValue&Lo,SDValue&Hi);voidSplitVecRes_MGATHER(MaskedGatherSDNode*MGT,SDValue&Lo,SDValue&Hi);voidSplitVecRes_SCALAR_TO_VECTOR(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_SETCC(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_VECTOR_SHUFFLE(ShuffleVectorSDNode*N,SDValue&Lo,SDValue&Hi);voidSplitVecRes_VAARG(SDNode*N,SDValue&Lo,SDValue&Hi);// Vector Operand Splitting: <128 x ty> -> 2 x <64 x ty>.boolSplitVectorOperand(SDNode*N,unsignedOpNo);SDValueSplitVecOp_VSELECT(SDNode*N,unsignedOpNo);SDValueSplitVecOp_VECREDUCE(SDNode*N,unsignedOpNo);SDValueSplitVecOp_UnaryOp(SDNode*N);SDValueSplitVecOp_TruncateHelper(SDNode*N);SDValueSplitVecOp_BITCAST(SDNode*N);SDValueSplitVecOp_EXTRACT_SUBVECTOR(SDNode*N);SDValueSplitVecOp_EXTRACT_VECTOR_ELT(SDNode*N);SDValueSplitVecOp_ExtVecInRegOp(SDNode*N);SDValueSplitVecOp_STORE(StoreSDNode*N,unsignedOpNo);SDValueSplitVecOp_MSTORE(MaskedStoreSDNode*N,unsignedOpNo);SDValueSplitVecOp_MSCATTER(MaskedScatterSDNode*N,unsignedOpNo);SDValueSplitVecOp_MGATHER(MaskedGatherSDNode*MGT,unsignedOpNo);SDValueSplitVecOp_CONCAT_VECTORS(SDNode*N);SDValueSplitVecOp_VSETCC(SDNode*N);SDValueSplitVecOp_FP_ROUND(SDNode*N);SDValueSplitVecOp_FCOPYSIGN(SDNode*N);//===--------------------------------------------------------------------===//// Vector Widening Support: LegalizeVectorTypes.cpp//===--------------------------------------------------------------------===///// Given a processed vector Op which was widened into a larger vector, this/// method returns the larger vector. The elements of the returned vector/// consist of the elements of Op followed by elements containing rubbish./// For example, if Op is a v2i32 that was widened to a v4i32, then this/// method returns a v4i32 for which the first two elements are the same as/// those of Op, while the last two elements contain rubbish.SDValueGetWidenedVector(SDValueOp){TableId&WidenedId=WidenedVectors[getTableId(Op)];SDValueWidenedOp=getSDValue(WidenedId);assert(WidenedOp.getNode()&&"Operand wasn't widened?");returnWidenedOp;}voidSetWidenedVector(SDValueOp,SDValueResult);// Widen Vector Result Promotion.voidWidenVectorResult(SDNode*N,unsignedResNo);SDValueWidenVecRes_MERGE_VALUES(SDNode*N,unsignedResNo);SDValueWidenVecRes_BITCAST(SDNode*N);SDValueWidenVecRes_BUILD_VECTOR(SDNode*N);SDValueWidenVecRes_CONCAT_VECTORS(SDNode*N);SDValueWidenVecRes_EXTEND_VECTOR_INREG(SDNode*N);SDValueWidenVecRes_EXTRACT_SUBVECTOR(SDNode*N);SDValueWidenVecRes_INSERT_VECTOR_ELT(SDNode*N);SDValueWidenVecRes_LOAD(SDNode*N);SDValueWidenVecRes_MLOAD(MaskedLoadSDNode*N);SDValueWidenVecRes_MGATHER(MaskedGatherSDNode*N);SDValueWidenVecRes_SCALAR_TO_VECTOR(SDNode*N);SDValueWidenVecRes_SELECT(SDNode*N);SDValueWidenVSELECTAndMask(SDNode*N);SDValueWidenVecRes_SELECT_CC(SDNode*N);SDValueWidenVecRes_SETCC(SDNode*N);SDValueWidenVecRes_UNDEF(SDNode*N);SDValueWidenVecRes_VECTOR_SHUFFLE(ShuffleVectorSDNode*N);SDValueWidenVecRes_Ternary(SDNode*N);SDValueWidenVecRes_Binary(SDNode*N);SDValueWidenVecRes_BinaryCanTrap(SDNode*N);SDValueWidenVecRes_StrictFP(SDNode*N);SDValueWidenVecRes_OverflowOp(SDNode*N,unsignedResNo);SDValueWidenVecRes_Convert(SDNode*N);SDValueWidenVecRes_Convert_StrictFP(SDNode*N);SDValueWidenVecRes_FCOPYSIGN(SDNode*N);SDValueWidenVecRes_POWI(SDNode*N);SDValueWidenVecRes_Shift(SDNode*N);SDValueWidenVecRes_Unary(SDNode*N);SDValueWidenVecRes_InregOp(SDNode*N);// Widen Vector Operand.boolWidenVectorOperand(SDNode*N,unsignedOpNo);SDValueWidenVecOp_BITCAST(SDNode*N);SDValueWidenVecOp_CONCAT_VECTORS(SDNode*N);SDValueWidenVecOp_EXTEND(SDNode*N);SDValueWidenVecOp_EXTRACT_VECTOR_ELT(SDNode*N);SDValueWidenVecOp_EXTRACT_SUBVECTOR(SDNode*N);SDValueWidenVecOp_STORE(SDNode*N);SDValueWidenVecOp_MSTORE(SDNode*N,unsignedOpNo);SDValueWidenVecOp_MGATHER(SDNode*N,unsignedOpNo);SDValueWidenVecOp_MSCATTER(SDNode*N,unsignedOpNo);SDValueWidenVecOp_SETCC(SDNode*N);SDValueWidenVecOp_VSELECT(SDNode*N);SDValueWidenVecOp_Convert(SDNode*N);SDValueWidenVecOp_FCOPYSIGN(SDNode*N);SDValueWidenVecOp_VECREDUCE(SDNode*N);/// Helper function to generate a set of operations to perform/// a vector operation for a wider type.///SDValueUnrollVectorOp_StrictFP(SDNode*N,unsignedResNE);//===--------------------------------------------------------------------===//// Vector Widening Utilities Support: LegalizeVectorTypes.cpp//===--------------------------------------------------------------------===///// Helper function to generate a set of loads to load a vector with a/// resulting wider type. It takes:/// LdChain: list of chains for the load to be generated./// Ld: load to widenSDValueGenWidenVectorLoads(SmallVectorImpl<SDValue>&LdChain,LoadSDNode*LD);/// Helper function to generate a set of extension loads to load a vector with/// a resulting wider type. It takes:/// LdChain: list of chains for the load to be generated./// Ld: load to widen/// ExtType: extension element typeSDValueGenWidenVectorExtLoads(SmallVectorImpl<SDValue>&LdChain,LoadSDNode*LD,ISD::LoadExtTypeExtType);/// Helper function to generate a set of stores to store a widen vector into/// non-widen memory./// StChain: list of chains for the stores we have generated/// ST: store of a widen valuevoidGenWidenVectorStores(SmallVectorImpl<SDValue>&StChain,StoreSDNode*ST);/// Helper function to generate a set of stores to store a truncate widen/// vector into non-widen memory./// StChain: list of chains for the stores we have generated/// ST: store of a widen valuevoidGenWidenVectorTruncStores(SmallVectorImpl<SDValue>&StChain,StoreSDNode*ST);/// Modifies a vector input (widen or narrows) to a vector of NVT. The/// input vector must have the same element type as NVT./// When FillWithZeroes is "on" the vector will be widened with zeroes./// By default, the vector will be widened with undefined values.SDValueModifyToType(SDValueInOp,EVTNVT,boolFillWithZeroes=false);/// Return a mask of vector type MaskVT to replace InMask. Also adjust/// MaskVT to ToMaskVT if needed with vector extension or truncation.SDValueconvertMask(SDValueInMask,EVTMaskVT,EVTToMaskVT);//===--------------------------------------------------------------------===//// Generic Splitting: LegalizeTypesGeneric.cpp//===--------------------------------------------------------------------===//// Legalization methods which only use that the illegal type is split into two// not necessarily identical types. As such they can be used for splitting// vectors and expanding integers and floats.voidGetSplitOp(SDValueOp,SDValue&Lo,SDValue&Hi){if(Op.getValueType().isVector())GetSplitVector(Op,Lo,Hi);elseif(Op.getValueType().isInteger())GetExpandedInteger(Op,Lo,Hi);elseGetExpandedFloat(Op,Lo,Hi);}/// Use ISD::EXTRACT_ELEMENT nodes to extract the low and high parts of the/// given value.voidGetPairElements(SDValuePair,SDValue&Lo,SDValue&Hi);// Generic Result Splitting.voidSplitRes_MERGE_VALUES(SDNode*N,unsignedResNo,SDValue&Lo,SDValue&Hi);voidSplitRes_SELECT(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitRes_SELECT_CC(SDNode*N,SDValue&Lo,SDValue&Hi);voidSplitRes_UNDEF(SDNode*N,SDValue&Lo,SDValue&Hi);//===--------------------------------------------------------------------===//// Generic Expansion: LegalizeTypesGeneric.cpp//===--------------------------------------------------------------------===//// Legalization methods which only use that the illegal type is split into two// identical types of half the size, and that the Lo/Hi part is stored first// in memory on little/big-endian machines, followed by the Hi/Lo part. As// such they can be used for expanding integers and floats.voidGetExpandedOp(SDValueOp,SDValue&Lo,SDValue&Hi){if(Op.getValueType().isInteger())GetExpandedInteger(Op,Lo,Hi);elseGetExpandedFloat(Op,Lo,Hi);}/// This function will split the integer \p Op into \p NumElements/// operations of type \p EltVT and store them in \p Ops.voidIntegerToVector(SDValueOp,unsignedNumElements,SmallVectorImpl<SDValue>&Ops,EVTEltVT);// Generic Result Expansion.voidExpandRes_MERGE_VALUES(SDNode*N,unsignedResNo,SDValue&Lo,SDValue&Hi);voidExpandRes_BITCAST(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandRes_BUILD_PAIR(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandRes_EXTRACT_ELEMENT(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandRes_EXTRACT_VECTOR_ELT(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandRes_NormalLoad(SDNode*N,SDValue&Lo,SDValue&Hi);voidExpandRes_VAARG(SDNode*N,SDValue&Lo,SDValue&Hi);// Generic Operand Expansion.SDValueExpandOp_BITCAST(SDNode*N);SDValueExpandOp_BUILD_VECTOR(SDNode*N);SDValueExpandOp_EXTRACT_ELEMENT(SDNode*N);SDValueExpandOp_INSERT_VECTOR_ELT(SDNode*N);SDValueExpandOp_SCALAR_TO_VECTOR(SDNode*N);SDValueExpandOp_NormalStore(SDNode*N,unsignedOpNo);};}// end namespace llvm.#endif