<s> unsigned Mask = C -> getZExtValue ( ) ; if ( Mask == <NUM_LIT> ) return SDValue ( ) ; SDValue Res ; if ( ( C = dyn_cast < ConstantSDNode > ( N1 ) ) ) { unsigned Val = C -> getZExtValue ( ) ; if ( ! <STR_LIT> ( Mask ) || ( Val & ~ Mask ) != Val ) return SDValue ( ) ; Val >>= CountTrailingZeros_32 ( ~ Mask ) ; Res = DAG . getNode ( <STR_LIT> , DL , VT , N0 . getOperand ( <NUM_LIT> ) , DAG . getConstant ( Val , <STR_LIT> ) , DAG . getConstant ( Mask , <STR_LIT> ) ) ; DCI . CombineTo ( N , Res , false ) ; } else if ( N1 . getOpcode ( ) == <STR_LIT> ) { C = dyn_cast < ConstantSDNode > ( N1 . getOperand ( <NUM_LIT> ) ) ; if ( ! C ) return SDValue ( ) ; unsigned Mask2 = C -> getZExtValue ( ) ; if ( <STR_LIT> ( Mask ) && <STR_LIT> ( ~ Mask2 ) && ( CountPopulation_32 ( Mask ) == CountPopulation_32 ( ~ Mask2 ) ) ) { if ( Subtarget -> hasT2ExtractPack ( ) && ( Mask == <NUM_LIT> || Mask == <NUM_LIT> ) ) return SDValue ( ) ; unsigned lsb = CountTrailingZeros_32 ( Mask2 ) ; Res = DAG . getNode ( <STR_LIT> , DL , VT , N1 . getOperand ( <NUM_LIT> ) , DAG . getConstant ( lsb , <STR_LIT> ) ) ; Res = DAG . getNode ( <STR_LIT> , DL , VT , N0 . getOperand ( <NUM_LIT> ) , Res , DAG . getConstant ( Mask , <STR_LIT> ) ) ; DCI . CombineTo ( N , Res , false ) ; } else if ( <STR_LIT> ( ~ Mask ) && <STR_LIT> ( Mask2 ) && ( CountPopulation_32 ( ~ Mask ) == CountPopulation_32 ( Mask2 ) ) ) { if ( Subtarget -> hasT2ExtractPack ( ) && ( Mask2 == <NUM_LIT>

|| Mask2 == <NUM_LIT> ) ) return SDValue ( ) ;


<s> unsigned <ISA_LIT>ScalarTargetTransformImpl :: getIntImmCost ( const APInt & Imm , Type * Ty ) const { assert ( Ty -> isIntegerTy ( ) ) ; unsigned Bits = Ty -> getPrimitiveSizeInBits ( ) ; if ( Bits == <NUM_LIT> || Bits > <NUM_LIT> ) return <NUM_LIT> ; int32_t SImmVal = Imm . getSExtValue ( ) ; uint32_t ZImmVal = Imm . getZExtValue ( ) ; if ( ! Subtarget ->


<s> EVT ToVT = cast < VTSDNode > ( Op . getOperand ( <NUM_LIT> ) ) -> getVT ( ) ; EVT FromVT = Op . getOperand ( <NUM_LIT> ) . getValueType ( ) ; if ( VT == <STR_LIT> && ToVT == <STR_LIT> && FromVT == <STR_LIT> ) return Op ; if ( VT == <STR_LIT> && ToVT == <STR_LIT> && FromVT == <STR_LIT> ) return Op ; if ( FromVT != <STR_LIT> && FromVT != <STR_LIT> ) return


<s> if ( Subtarget -> isMClass ( ) ) has64BitAtomicStore = false ; else if ( Subtarget -> isThumb ( ) ) has64BitAtomicStore = Subtarget -> hasV7Ops ( ) ; else has64BitAtomicStore = Subtarget -> hasV6Ops ( ) ; unsigned Size = SI -> getValueOperand ( ) -> getType ( ) -> getPrimitiveSizeInBits ( ) ; return Size == <NUM_LIT> && has64BitAtomicStore ? AtomicExpansionKind :: Expand : AtomicExpansionKind


<s> if ( DAG . getMachineFunction ( ) . getFunction ( ) . optForMinSize ( ) ) return false ; return


<s> if ( ConstraintCode [ <NUM_LIT> ] == 'U' ) { switch ( ConstraintCode [ <NUM_LIT> ] ) { default : break ; case 'm' : return InlineAsm :: Constraint_Um ; case 'n' : return InlineAsm :: Constraint_Un ; case 'q' : return InlineAsm :: Constraint_Uq ; case 's' : return InlineAsm :: Constraint_Us ; case 't' : return InlineAsm :: Constraint_Ut ; case 'v' : return InlineAsm :: Constraint_Uv ; case 'y'


<s> case CallingConv :: GHC : return CC ; case CallingConv :: <ISA_LIT>_AAPCS_VFP : return isVarArg ? CallingConv :: <ISA_LIT>_AAPCS : CallingConv :: <ISA_LIT>_AAPCS_VFP ; case CallingConv :: C : if ( ! Subtarget -> isAAPCS_ABI ( ) ) return CallingConv :: <ISA_LIT>_APCS ; else if ( Subtarget -> hasVFP2 ( ) && getTargetMachine ( ) . Options . FloatABIType == FloatABI :: Hard && ! isVarArg ) return CallingConv :: <ISA_LIT>_AAPCS_VFP ; else return CallingConv


<s> case <STR_LIT> : LC = isSigned ? RTLIB :: SDIVREM_I8 : RTLIB :: UDIVREM_I8 ; break ; case <STR_LIT> : LC = isSigned ? RTLIB :: SDIVREM_I16 : RTLIB :: UDIVREM_I16 ; break ; case <STR_LIT> : LC = isSigned ? RTLIB :: SDIVREM_I32 : RTLIB :: UDIVREM_I32 ; break ; case <STR_LIT> : LC = isSigned ? RTLIB :: SDIVREM_I64 : RTLIB :: UDIVREM_I64 ; break ; } SDValue InChain = DAG . getEntryNode ( ) ; TargetLowering :: ArgListTy Args ; TargetLowering :: ArgListEntry Entry ; for ( unsigned i = <NUM_LIT> , e = Op -> getNumOperands ( ) ; i != e ; ++ i ) { EVT ArgVT = Op -> getOperand ( i


<s> Type * ArgTy = ArgVT . getTypeForEVT ( * DAG . getContext ( ) ) ; Entry . Node = Op -> getOperand ( i ) ; Entry . Ty = ArgTy ; Entry . isSExt = isSigned ; Entry . isZExt = ! isSigned ; Args . push_back ( Entry ) ; } SDValue Callee = DAG . getExternalSymbol ( getLibcallName ( LC ) , getPointerTy ( ) ) ; Type * RetTy = ( Type * ) StructType :: get ( Ty , Ty , NULL ) ; SDLoc dl ( Op ) ; TargetLowering :: CallLoweringInfo CLI ( DAG ) ; CLI . setDebugLoc ( dl ) . setChain ( InChain ) . setCallee ( getLibcallCallingConv ( LC ) , RetTy , Callee , & Args , <NUM_LIT> ) . setInRegister ( ) . setSExtResult ( isSigned )


<s> Entry . isSExt = false ; Entry . isZExt = false ; Entry . isSRet = true ; Args . push_back ( Entry ) ; Entry . Node = Arg ; Entry . Ty = ArgTy ; Entry . isSExt = false ; Entry . isZExt = false ; Args . push_back ( Entry ) ; const char * LibcallName = ( ArgVT == <STR_LIT> ) ? <STR_LIT> : <STR_LIT> ; SDValue Callee = DAG . getExternalSymbol ( LibcallName , getPointerTy ( ) ) ; TargetLowering :: CallLoweringInfo CLI ( DAG ) ; CLI . setDebugLoc ( dl ) . setChain ( DAG . getEntryNode ( ) ) . setCallee ( CallingConv :: C , Type :: getVoidTy ( * DAG . getContext ( ) ) , Callee , & Args , <NUM_LIT> ) . setDiscardResult ( ) ; std :: pair < SDValue , SDValue > CallResult = LowerCallTo ( CLI ) ; SDValue LoadSin = DAG . getLoad ( ArgVT , dl , CallResult . second , SRet , MachinePointerInfo ( ) , false , false , false , <NUM_LIT> ) ; SDValue Add = DAG . getNode ( <STR_LIT> , dl , getPointerTy ( ) , SRet , DAG . getIntPtrConstant ( ArgVT . getStoreSize ( ) ) ) ; SDValue LoadCos = DAG . getLoad ( ArgVT , dl , LoadSin . getValue ( <NUM_LIT> ) , Add , MachinePointerInfo ( ) , false , false , false , <NUM_LIT> ) ; SDVTList Tys = DAG . getVTList ( ArgVT , ArgVT ) ; return DAG . getNode ( <STR_LIT> , dl , Tys , LoadSin . getValue ( <NUM_LIT> ) , LoadCos . getValue


<s> EVT PtrVT = getPointerTy ( ) ; SDLoc DL ( Op ) ; ++ NumMovwMovt ; return DAG . getNode ( <STR_LIT> , DL , PtrVT ,

DAG . getTargetGlobalAddress ( GV , DL , PtrVT ) ) ;


<s> assert ( SizeRatio * NumElems * ToEltSz == VT . getSizeInBits ( ) ) ; EVT WideVecVT = EVT :: getVectorVT ( * DAG . getContext ( ) , StVT . getScalarType ( ) , NumElems * SizeRatio ) ; assert ( WideVecVT . getSizeInBits ( ) == VT . getSizeInBits ( ) ) ; SDLoc DL ( St ) ; SDValue WideVec = DAG . getNode ( <STR_LIT> , DL , WideVecVT , StVal ) ; SmallVector < int , <NUM_LIT> > ShuffleVec ( NumElems * SizeRatio , - <NUM_LIT> ) ; for ( unsigned i = <NUM_LIT> ; i < NumElems ; ++ i ) ShuffleVec [ i ] = i * SizeRatio ; if ( ! TLI . isTypeLegal ( WideVecVT ) ) return SDValue ( ) ; SDValue Shuff = DAG . getVectorShuffle ( WideVecVT , DL , WideVec , DAG . getUNDEF ( WideVec . getValueType ( ) ) , ShuffleVec . data ( ) ) ; MVT StoreType = <STR_LIT> ; for ( unsigned tp = <STR_LIT> ; tp < <STR_LIT> ; ++ tp ) { MVT Tp = ( <STR_LIT> ) tp ; if ( TLI . isTypeLegal ( Tp ) && Tp . getSizeInBits ( ) <= NumElems * ToEltSz ) StoreType = Tp ; } if ( ! TLI . isTypeLegal ( StoreType ) ) return SDValue ( ) ; EVT StoreVecVT = EVT :: getVectorVT ( * DAG . getContext ( ) , StoreType , VT . getSizeInBits ( ) / EVT ( StoreType ) . getSizeInBits ( ) ) ; assert ( StoreVecVT . getSizeInBits ( ) == VT . getSizeInBits ( ) ) ; SDValue ShuffWide = DAG . getNode ( <STR_LIT> , DL , StoreVecVT , Shuff ) ; SmallVector < SDValue , <NUM_LIT> > Chains ; SDValue Increment = DAG . getConstant ( StoreType . getSizeInBits ( ) / <NUM_LIT> , TLI . getPointerTy ( ) ) ; SDValue BasePtr = St -> getBasePtr ( ) ; unsigned E = ( ToEltSz * NumElems ) / StoreType


<s> bool <ISA_LIT>TargetLowering :: getPostIndexedAddressParts ( SDNode * N , SDNode * Op , SDValue & Base , SDValue & Offset , <STR_LIT> & AM , SelectionDAG & DAG ) const { if ( Subtarget -> isThumb1Only ( ) ) return false ; const bool restrict_addressing_modes_for_nacl = ( ( FlagSfiLoad && N -> getOpcode ( ) == <STR_LIT> ) || ( FlagSfiStore && N -> getOpcode ( ) == <STR_LIT> ) ) ; if ( restrict_addressing_modes_for_nacl ) { return false ; } EVT VT ; SDValue Ptr ; bool isSEXTLoad = false ; if ( LoadSDNode * LD = dyn_cast < LoadSDNode > ( N ) ) { VT = LD -> getMemoryVT ( ) ; Ptr = LD -> getBasePtr ( ) ; isSEXTLoad = LD -> getExtensionType ( ) == <STR_LIT> ; } else if ( StoreSDNode * ST = dyn_cast < StoreSDNode > ( N ) ) { VT = ST -> getMemoryVT ( ) ; Ptr = ST -> getBasePtr ( ) ; } else return false ; bool isInc ; bool isLegal = false ; if ( Subtarget -> isThumb2 ( ) ) isLegal = getT2IndexedAddressParts ( Op , VT , isSEXTLoad , Base ,


<s> if ( Subtarget -> isThumb1Only ( ) ) return false ; const bool restrict_addressing_modes_for_nacl = ( ( FlagSfiLoad && N -> getOpcode ( ) == <STR_LIT> ) || ( FlagSfiStore && N -> getOpcode ( ) == <STR_LIT> ) ) ; if ( restrict_addressing_modes_for_nacl ) { return false ; } EVT VT ; SDValue Ptr ; bool isSEXTLoad = false ; if ( LoadSDNode * LD = dyn_cast < LoadSDNode > ( N ) ) { VT = LD -> getMemoryVT ( ) ; Ptr = LD -> getBasePtr ( ) ; isSEXTLoad = LD -> getExtensionType ( ) == <STR_LIT> ; } else if ( StoreSDNode * ST = dyn_cast < StoreSDNode > ( N )


<s> if ( Subtarget -> isThumb1Only ( ) ) return false ; const bool restrict_addressing_modes_for_nacl = ( ( FlagSfiLoad && N -> getOpcode ( ) == <STR_LIT> ) || ( FlagSfiStore && N -> getOpcode ( ) == <STR_LIT> ) ) ; if ( restrict_addressing_modes_for_nacl ) { return false ; } EVT VT ; SDValue Ptr ; bool isSEXTLoad = false ; if ( LoadSDNode * LD = dyn_cast < LoadSDNode > ( N ) ) { Ptr = LD -> getBasePtr ( ) ; VT = LD ->


<s> unsigned ReturnReg = <STR_LIT> ; Chain = DAG . getCopyToReg ( Chain , dl , OffsetReg , Offset ) ; Chain = DAG . getCopyToReg ( Chain , dl , AddrReg , Handler ) ; Chain = DAG . getCopyToReg ( Chain , dl , ReturnReg , DAG . getIntPtrConstant ( <NUM_LIT> ) ) ; return DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , Chain , DAG . getRegister ( OffsetReg , <STR_LIT> ) , DAG . getRegister ( AddrReg , getPointerTy


<s> SDValue <ISA_LIT>TargetLowering :: LowerNaClTargetArch ( SDValue Op , SelectionDAG & DAG


<s> SDValue <ISA_LIT>TargetLowering :: LowerNaClTargetArch ( SDValue Op , SelectionDAG & DAG ) const { return DAG . getConstant ( PnaclTargetArchitecture<ISA_LIT>_32 , Op . getValueType ( ) . getSimpleVT


<s> DebugLoc dl = Op . getDebugLoc ( ) ; return DAG . getNode ( <STR_LIT> , dl , Op . getValueType ( ) . getSimpleVT ( ) , DAG . getConstant ( <NUM_LIT> , Op . getValueType ( ) . getSimpleVT ( ) ) , Op


<s> case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : return LowerShift ( Op . getNode ( ) , DAG , Subtarget ) ; case <STR_LIT> : return LowerShiftLeftParts ( Op , DAG ) ; case <STR_LIT> : case <STR_LIT> : return LowerShiftRightParts ( Op , DAG ) ; case <STR_LIT> : return LowerCTTZ ( Op . getNode ( ) , DAG , Subtarget ) ; case <STR_LIT> : return LowerCTPOP ( Op . getNode ( ) , DAG , Subtarget ) ; case <STR_LIT> : return LowerVSETCC ( Op , DAG ) ; case <STR_LIT> : return LowerConstantFP ( Op , DAG , Subtarget ) ; case <STR_LIT> : return LowerBUILD_VECTOR ( Op , DAG , Subtarget ) ; case <STR_LIT> : return LowerVECTOR_SHUFFLE ( Op , DAG ) ; case <STR_LIT> : return LowerINSERT_VECTOR_ELT ( Op , DAG ) ; case <STR_LIT> : return LowerEXTRACT_VECTOR_ELT ( Op , DAG ) ; case <STR_LIT> : return LowerCONCAT_VECTORS ( Op , DAG ) ; case <STR_LIT> : return LowerFLT_ROUNDS_ ( Op , DAG ) ; case <STR_LIT> : return LowerMUL ( Op , DAG ) ; case <STR_LIT> : return LowerSDIV ( Op , DAG ) ; case <STR_LIT> : return LowerUDIV ( Op , DAG ) ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : return LowerADDC_ADDE_SUBC_SUBE ( Op , DAG ) ; case <STR_LIT> : case <STR_LIT> : return LowerAtomicLoadStore ( Op , DAG ) ; case <STR_LIT> : return LowerNaClTpTlsOffset ( Op , DAG ) ; case <STR_LIT> : return LowerNaClTpTdbOffset ( Op , DAG ) ; case <STR_LIT> : return LowerNaClTargetArch ( Op , DAG


<s> Offset = DAG . getLoad ( PtrVT , dl , Chain , Offset , MachinePointerInfo :: getConstantPool ( ) , false , false , false , <NUM_LIT> ) ; } else { unsigned char PCAdj = Subtarget -> isThumb ( ) ? <NUM_LIT> : <NUM_LIT> ; <ISA_LIT>ConstantPoolValue * CPV = <ISA_LIT>ConstantPoolConstant :: Create ( GA -> getGlobal ( ) , <ISA_LIT>PCLabelIndex , <STR_LIT> , PCAdj , <STR_LIT> , true ) ; Offset = DAG . getTargetConstantPool ( CPV , PtrVT , <NUM_LIT> ) ; Offset = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , Offset ) ; Offset = DAG . getLoad ( PtrVT , dl , Chain , Offset , MachinePointerInfo :: getConstantPool ( ) , false , false , false , <NUM_LIT> ) ; Chain = Offset . getValue ( <NUM_LIT> ) ; SDValue PICLabel = DAG . getConstant ( <ISA_LIT>PCLabelIndex , <STR_LIT> ) ; Offset = DAG . getNode ( <STR_LIT> , dl , PtrVT , Offset , PICLabel ) ; Offset = DAG . getLoad ( PtrVT , dl , Chain , Offset , MachinePointerInfo :: getConstantPool ( ) , false , false , false , <NUM_LIT> ) ; } } else { assert ( model == TLSModel :: LocalExec ) ; <ISA_LIT>ConstantPoolValue * CPV = <ISA_LIT>ConstantPoolConstant :: Create (


<s> } else { unsigned char PCAdj = Subtarget -> isThumb ( ) ? <NUM_LIT> : <NUM_LIT> ; <ISA_LIT>ConstantPoolValue * CPV = <ISA_LIT>ConstantPoolConstant :: Create ( GA -> getGlobal ( ) , <ISA_LIT>PCLabelIndex , <STR_LIT> , PCAdj , <STR_LIT> , true ) ; Offset = DAG . getTargetConstantPool ( CPV , PtrVT , <NUM_LIT> ) ; Offset = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , Offset ) ; Offset = DAG . getLoad ( PtrVT , dl , Chain , Offset , MachinePointerInfo :: getConstantPool ( ) , false , false , false , <NUM_LIT> ) ; Chain = Offset . getValue ( <NUM_LIT> ) ; SDValue PICLabel = DAG . getConstant ( <ISA_LIT>PCLabelIndex , <STR_LIT> ) ; Offset = DAG . getNode ( <STR_LIT> , dl , PtrVT , Offset , PICLabel ) ; Offset = DAG . getLoad ( PtrVT , dl , Chain , Offset , MachinePointerInfo :: getConstantPool ( ) , false , false , false , <NUM_LIT> ) ; } } else { assert ( model == TLSModel :: LocalExec ) ; <ISA_LIT>ConstantPoolValue * CPV = <ISA_LIT>ConstantPoolConstant :: Create ( GV , <STR_LIT> ) ; Offset = DAG . getTargetConstantPool ( CPV , PtrVT , <NUM_LIT> ) ; Offset = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , Offset ) ; Offset = DAG . getLoad ( PtrVT , dl , Chain , Offset , MachinePointerInfo :: getConstantPool ( ) , false , false , false , <NUM_LIT> ) ; } return DAG . getNode ( <STR_LIT> , dl , PtrVT ,


<s> CPAddr = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , CPAddr ) ; Argument = DAG . getLoad ( PtrVT , dl , DAG . getEntryNode ( ) , CPAddr , MachinePointerInfo :: getConstantPool ( ) , false , false , false , <NUM_LIT> ) ; Chain = Argument . getValue ( <NUM_LIT> ) ; Argument = DAG . getNode ( <STR_LIT> , dl , PtrVT , Argument , CPAddr ) ; } else { unsigned char PCAdj = Subtarget -> isThumb ( ) ? <NUM_LIT> : <NUM_LIT> ; MachineFunction & MF = DAG . getMachineFunction ( ) ; <ISA_LIT>FunctionInfo * AFI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; unsigned <ISA_LIT>PCLabelIndex = AFI -> createPICLabelUId ( ) ; <ISA_LIT>ConstantPoolValue * CPV = <ISA_LIT>ConstantPoolConstant :: Create ( GA -> getGlobal ( ) , <ISA_LIT>PCLabelIndex , <STR_LIT> , PCAdj , <STR_LIT> , true ) ; Argument = DAG . getTargetConstantPool ( CPV , PtrVT , <NUM_LIT> ) ; Argument = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , Argument ) ; Argument = DAG . getLoad ( PtrVT , dl , DAG . getEntryNode ( ) , Argument , MachinePointerInfo :: getConstantPool ( ) , false , false , false , <NUM_LIT> ) ; Chain = Argument . getValue ( <NUM_LIT> ) ; SDValue PICLabel = DAG . getConstant ( <ISA_LIT>PCLabelIndex , <STR_LIT> ) ; Argument = DAG . getNode ( <STR_LIT> , dl , PtrVT , Argument , PICLabel ) ; } ArgListTy Args ; ArgListEntry Entry ; Entry . Node = Argument ; Entry . Ty = ( Type * ) Type :: getInt32Ty


<s> if ( N -> getOperand ( <NUM_LIT> ) . getValueType ( ) . isVector ( ) ) return SDValue ( ) ; if ( ! ( MinSize && HasDivide ) ) return SDValue ( ) ; if ( ! ST . isThumb ( ) ) return SDValue ( N , <NUM_LIT> ) ; if ( Divisor . sgt ( <NUM_LIT> ) ) return SDValue


<s> const EVT OpTy = Op . getOperand ( <NUM_LIT> ) . getValueType ( ) ; if ( OpTy == <STR_LIT> ) NewTy = <STR_LIT> ; else if ( OpTy == <STR_LIT> && HasFullFP16 ) NewTy = <STR_LIT> ; else if ( OpTy == <STR_LIT> && HasFullFP16 ) NewTy = <STR_LIT> ; else llvm_unreachable ( <STR_LIT> ) ; if ( VT != <STR_LIT> && VT != <STR_LIT> ) return DAG . UnrollVectorOp ( Op . getNode ( ) ) ; Op = DAG . getNode ( Op . getOpcode ( ) , dl , NewTy , Op .


<s> ConstantSDNode * ShiftAmtNode = dyn_cast < ConstantSDNode > ( N -> getOperand ( <NUM_LIT> ) ) ; if ( ! ShiftAmtNode ) return SDValue ( ) ; uint32_t ShiftAmt = static_cast < uint32_t > ( ShiftAmtNode -> getZExtValue ( ) ) ; ConstantSDNode * AndMaskNode = dyn_cast < ConstantSDNode > ( N0 -> getOperand ( <NUM_LIT> ) ) ; if ( ! AndMaskNode ) return SDValue ( ) ; uint32_t AndMask = static_cast < uint32_t > ( AndMaskNode -> getZExtValue ( ) ) ; if ( AndMask == <NUM_LIT> || AndMask == <NUM_LIT> ) return SDValue ( ) ; if ( isMask_32 ( AndMask ) ) { uint32_t MaskedBits = countLeadingZeros ( AndMask ) ; if ( MaskedBits > ShiftAmt ) { SDLoc DL ( N ) ; SDValue SHL = DAG . getNode ( <STR_LIT> , DL , <STR_LIT> , N0 -> getOperand ( <NUM_LIT> ) , DAG . getConstant ( MaskedBits , DL , <STR_LIT> ) ) ; return DAG . getNode ( <STR_LIT> , DL , <STR_LIT> , SHL , DAG . getConstant ( MaskedBits - ShiftAmt , DL , <STR_LIT> ) ) ; } } } const TargetLowering & TLI = DAG . getTargetLoweringInfo ( ) ; if ( ! VT . isVector ( ) || ! TLI . isTypeLegal ( VT ) ) return SDValue ( ) ; if ( ST -> hasMVEIntegerOps ( ) ) return SDValue ( ) ; int64_t Cnt ; switch ( N -> getOpcode ( ) ) { default : llvm_unreachable ( <STR_LIT> ) ; case <STR_LIT> : if ( isVShiftLImm ( N -> getOperand ( <NUM_LIT> ) , VT , false , Cnt ) ) { SDLoc dl ( N ) ; return DAG . getNode ( <STR_LIT> , dl , VT , N -> getOperand ( <NUM_LIT> ) , DAG . getConstant ( Cnt , dl , <STR_LIT> ) ) ; } break ; case <STR_LIT> : case <STR_LIT> : if ( isVShiftRImm ( N -> getOperand ( <NUM_LIT> ) , VT , false , false , Cnt ) ) { unsigned VShiftOpc = ( N -> getOpcode ( ) == <STR_LIT> ? <STR_LIT> : <STR_LIT> ) ; SDLoc dl ( N ) ; return DAG . getNode ( VShiftOpc , dl , VT , N -> getOperand ( <NUM_LIT> ) , DAG . getConstant ( Cnt , dl ,


<s> const SDValue Dividend = Op -> getOperand ( <NUM_LIT> ) ; const SDValue Divisor = Op -> getOperand ( <NUM_LIT> ) ; SDValue Div = DAG . getNode ( DivOpcode , dl , VT , Dividend , Divisor ) ; SDValue Mul = DAG . getNode ( <STR_LIT> , dl , VT , Div , Divisor ) ; SDValue Rem = DAG . getNode ( <STR_LIT> , dl , VT , Dividend , Mul ) ; SDValue Values [ <NUM_LIT> ] = { Div , Rem } ; return DAG . getNode ( <STR_LIT> , dl , DAG . getVTList ( VT , VT ) , Values ) ; } RTLIB :: Libcall LC = getDivRemLibcall ( Op . getNode ( ) , VT . getSimpleVT ( ) . SimpleTy ) ; SDValue InChain = DAG . getEntryNode ( ) ; TargetLowering :: ArgListTy Args = getDivRemArgList ( Op . getNode ( ) , DAG . getContext ( ) , Subtarget ) ; SDValue Callee = DAG . getExternalFunctionSymbol ( getLibcallName ( LC ) ) ; Type * RetTy = StructType :: get ( Ty , Ty ) ; if ( Subtarget -> isTargetWindows ( ) ) InChain = WinDBZCheckDenominator ( DAG , Op . getNode ( ) , InChain ) ; TargetLowering :: CallLoweringInfo CLI


<s> SDValue <ISA_LIT>TargetLowering :: LowerFSINCOS ( SDValue Op , SelectionDAG & DAG ) const { assert ( Subtarget -> isTargetDarwin ( ) ) ; SDLoc dl ( Op ) ; SDValue Arg = Op . getOperand ( <NUM_LIT> ) ; EVT ArgVT = Arg . getValueType ( ) ; Type * ArgTy = ArgVT . getTypeForEVT ( * DAG . getContext ( ) ) ; auto PtrVT = getPointerTy ( DAG . getDataLayout ( ) ) ; MachineFrameInfo & MFI = DAG . getMachineFunction ( ) . getFrameInfo ( ) ; const TargetLowering & TLI = DAG . getTargetLoweringInfo ( ) ; Type * RetTy = StructType :: get ( ArgTy , ArgTy ) ; auto & DL = DAG . getDataLayout ( ) ; ArgListTy Args ; bool ShouldUseSRet = Subtarget -> isAPCS_ABI ( ) ; SDValue SRet ; if ( ShouldUseSRet ) { const uint64_t ByteSize = DL . getTypeAllocSize ( RetTy ) ; const Align StackAlign = DL . getPrefTypeAlign ( RetTy ) ; int FrameIdx = MFI . CreateStackObject ( ByteSize , StackAlign , false ) ; SRet = DAG . getFrameIndex ( FrameIdx , TLI . getPointerTy ( DL ) ) ; ArgListEntry Entry ; Entry . Node =


<s> RTLIB :: Libcall LC = getDivRemLibcall ( N , N -> getValueType ( <NUM_LIT> ) . getSimpleVT ( ) . SimpleTy ) ; SDValue InChain = DAG . getEntryNode ( ) ; TargetLowering :: ArgListTy Args = getDivRemArgList ( N , DAG . getContext ( ) , Subtarget ) ; bool isSigned = N -> getOpcode ( ) == <STR_LIT> ; SDValue Callee = DAG . getExternalFunctionSymbol ( getLibcallName ( LC ) ) ; if ( Subtarget -> isTargetWindows ( ) ) InChain = WinDBZCheckDenominator ( DAG , N , InChain ) ; CallLoweringInfo CLI ( DAG ) ; CLI . setChain ( InChain ) . setCallee ( CallingConv :: <ISA_LIT>_AAPCS , RetTy , Callee , std :: move ( Args

) ) . setSExtResult ( isSigned ) . setZExtResult ( ! isSigned ) . setDebugLoc ( SDLoc ( N ) ) ;


<s> Entry . Node = Argument ; Entry . Ty = ( Type * ) Type :: getInt32Ty ( * DAG . getContext ( ) ) ; Args . push_back ( Entry ) ; TargetLowering :: CallLoweringInfo CLI ( DAG ) ; CLI . setDebugLoc ( dl ) . setChain ( Chain ) . setLibCallee ( CallingConv :: C , Type :: getInt32Ty ( * DAG . getContext ( ) ) , DAG . getExternalFunctionSymbol ( <STR_LIT> ) , std :: move ( Args ) ) ; std :: pair < SDValue , SDValue > CallResult = LowerCallTo


<s> Arg . Ty = Arg . Node . getValueType ( ) . getTypeForEVT ( * DAG . getContext ( ) ) ; Args . push_back ( Arg ) ; } CallLoweringInfo CLI ( DAG ) ; CLI . setDebugLoc ( dl ) . setChain ( Chain ) . setCallee ( CallingConv :: <ISA_LIT>_AAPCS_VFP , VT . getTypeForEVT ( * DAG . getContext ( ) ) , ES , std :: move ( Args ) ) ; return LowerCallTo ( CLI )


<s> else Name = ( VT == <STR_LIT> ) ? <STR_LIT> : <STR_LIT> ; SDValue ES = DAG . getExternalFunctionSymbol ( Name ) ; <ISA_LIT>TargetLowering :: ArgListTy Args ; for ( auto AI : { <NUM_LIT> , <NUM_LIT> } ) { ArgListEntry Arg ; Arg . Node = Op . getOperand ( AI ) ; Arg . Ty = Arg . Node . getValueType ( ) . getTypeForEVT ( * DAG . getContext ( ) ) ; Args . push_back (


<s> for ( unsigned ArgI = <NUM_LIT> , ArgE = I . getNumArgOperands ( ) ; ArgI < ArgE ; ++ ArgI ) { Type * ArgTy = I . getArgOperand ( ArgI ) -> getType ( ) ; if ( ! ArgTy -> isVectorTy ( ) ) break ; NumElts += DL . getTypeSizeInBits ( ArgTy ) / <NUM_LIT> ; } Info . memVT = EVT :: getVectorVT ( I . getType ( ) -> getContext ( ) , <STR_LIT> , NumElts ) ; Info . ptrVal = I . getArgOperand ( <NUM_LIT> ) ; Info . offset = <NUM_LIT> ; Value * AlignArg = I . getArgOperand ( I . getNumArgOperands ( ) - <NUM_LIT> ) ; Info . align = MaybeAlign ( cast < ConstantInt > ( AlignArg ) -> getZExtValue ( ) ) ; Info . flags = MachineMemOperand :: MOStore ; return true ; } case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : { Info . opc = <STR_LIT> ; auto & DL = I . getCalledFunction ( ) -> getParent ( ) -> getDataLayout ( ) ; unsigned NumElts = <NUM_LIT> ; for ( unsigned ArgI = <NUM_LIT> , ArgE = I . getNumArgOperands ( ) ; ArgI < ArgE ; ++ ArgI ) { Type * ArgTy = I . getArgOperand ( ArgI ) -> getType ( ) ; if ( ! ArgTy -> isVectorTy ( ) ) break ; NumElts += DL . getTypeSizeInBits ( ArgTy ) / <NUM_LIT> ; } Info . memVT = EVT :: getVectorVT ( I . getType ( ) -> getContext ( ) , <STR_LIT> , NumElts ) ; Info . ptrVal = I . getArgOperand ( <NUM_LIT> ) ; Info . offset = <NUM_LIT> ; Info . align . reset ( ) ; Info . flags = MachineMemOperand :: MOStore ; return true ; } case <STR_LIT> : case <STR_LIT> : { Info . opc = <STR_LIT> ; Type * VecTy = cast < StructType > ( I . getType ( ) ) -> getElementType ( <NUM_LIT> ) ; unsigned Factor = Intrinsic == <STR_LIT> ? <NUM_LIT> : <NUM_LIT> ; Info . memVT = EVT :: getVectorVT ( VecTy -> getContext ( ) , <STR_LIT> , Factor * <NUM_LIT> ) ; Info . ptrVal = I . getArgOperand ( <NUM_LIT> ) ; Info . offset = <NUM_LIT> ; Info . align = Align ( VecTy -> getScalarSizeInBits ( ) / <NUM_LIT> ) ; Info . flags = MachineMemOperand :: MOLoad ; return true ; } case <STR_LIT> : case <STR_LIT>


<s> static SDValue PerformADDVecReduce ( SDNode * N , TargetLowering :: DAGCombinerInfo & DCI , const <ISA_LIT>Subtarget * Subtarget ) { if ( ! Subtarget -> hasMVEIntegerOps ( ) || N -> getValueType ( <NUM_LIT> ) != <STR_LIT> ) return SDValue ( ) ; SDValue N0 = N -> getOperand ( <NUM_LIT> ) ; SDValue N1 = N -> getOperand ( <NUM_LIT> ) ; auto MakeVecReduce = [ & ] ( unsigned Opcode , unsigned OpcodeA , SDValue NA , SDValue NB ) { if ( NB -> getOpcode ( ) != <STR_LIT> ) return SDValue ( ) ; SDValue VecRed = NB -> getOperand ( <NUM_LIT> ) ; if ( VecRed -> getOpcode ( ) != Opcode || VecRed . getResNo ( ) != <NUM_LIT> || NB -> getOperand ( <NUM_LIT> ) != SDValue ( VecRed . getNode ( ) , <NUM_LIT> ) ) return SDValue ( ) ; SDLoc dl ( N ) ; SDValue Lo = DCI . DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , NA

, DCI . DAG . getConstant ( <NUM_LIT> , dl , <STR_LIT> ) ) ;


<s> if ( i == <NUM_LIT> && isThisReturn ) { assert ( ! VA . needsCustom ( ) && VA . getLocVT ( ) == <STR_LIT> && <STR_LIT> ) ; InVals . push_back ( ThisVal ) ; continue ; } SDValue Val ; if ( VA . needsCustom ( ) && ( VA . getLocVT ( ) == <STR_LIT> || VA . getLocVT ( ) == <STR_LIT> ) ) { SDValue Lo = DAG . getCopyFromReg ( Chain , dl , VA . getLocReg ( ) , <STR_LIT> , InFlag ) ; Chain = Lo . getValue ( <NUM_LIT> ) ; InFlag = Lo . getValue ( <NUM_LIT> ) ; VA = RVLocs [ ++ i ] ; SDValue Hi = DAG . getCopyFromReg ( Chain , dl , VA . getLocReg ( ) , <STR_LIT> , InFlag ) ; Chain = Hi . getValue ( <NUM_LIT> ) ; InFlag = Hi . getValue ( <NUM_LIT> ) ; if ( ! Subtarget -> isLittle ( ) ) std :: swap ( Lo , Hi ) ; Val = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , Lo , Hi ) ; if ( VA . getLocVT ( ) == <STR_LIT> ) { SDValue Vec = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> ) ; Vec = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , Vec , Val , DAG . getConstant ( <NUM_LIT> , dl , <STR_LIT> ) ) ; VA = RVLocs [ ++ i ] ; Lo = DAG . getCopyFromReg ( Chain , dl , VA . getLocReg ( ) , <STR_LIT> , InFlag ) ; Chain = Lo . getValue ( <NUM_LIT> ) ; InFlag = Lo . getValue ( <NUM_LIT> ) ; VA = RVLocs [ ++ i ] ; Hi = DAG . getCopyFromReg ( Chain , dl , VA . getLocReg ( ) , <STR_LIT> , InFlag ) ; Chain = Hi . getValue ( <NUM_LIT> ) ; InFlag = Hi . getValue ( <NUM_LIT> ) ; if ( ! Subtarget -> isLittle ( ) ) std :: swap ( Lo , Hi ) ; Val = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , Lo , Hi ) ; Val = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , Vec , Val , DAG . getConstant ( <NUM_LIT> , dl , <STR_LIT> ) ) ; } } else { Val = DAG . getCopyFromReg ( Chain , dl , VA . getLocReg ( ) , VA . getLocVT ( ) , InFlag ) ; Chain = Val . getValue


<s> setOperationAction ( <STR_LIT> , VT , Expand ) ; setOperationAction ( <STR_LIT> , VT , Expand ) ; setOperationAction ( <STR_LIT> , VT , Expand ) ; setOperationAction ( <STR_LIT> , VT , Expand ) ; if ( VT . isInteger ( ) ) { setOperationAction ( <STR_LIT> , VT , Custom ) ; setOperationAction ( <STR_LIT> , VT , Custom ) ; setOperationAction ( <STR_LIT> , VT , Custom ) ; } if ( VT . isInteger ( ) && VT != PromotedBitwiseVT ) { setOperationAction ( <STR_LIT> , VT , Promote ) ; AddPromotedToType ( <STR_LIT> , VT , PromotedBitwiseVT ) ; setOperationAction ( <STR_LIT> , VT , Promote ) ; AddPromotedToType ( <STR_LIT> , VT , PromotedBitwiseVT ) ; setOperationAction ( <STR_LIT> , VT , Promote ) ; AddPromotedToType ( <STR_LIT> , VT , PromotedBitwiseVT ) ; } setOperationAction ( <STR_LIT> , VT , Expand ) ; setOperationAction ( <STR_LIT> , VT , Expand ) ; setOperationAction ( <STR_LIT> , VT , Expand ) ; setOperationAction ( <STR_LIT> , VT ,


<s> bool canMergeStoresTo ( unsigned AddressSpace , EVT MemVT , const MachineFunction &


<s> bool canMergeStoresTo ( unsigned AddressSpace , EVT MemVT , const MachineFunction & MF ) const


<s> bool convertSetCCLogicToBitwiseLogic ( EVT VT )


<s> static SDValue Expand64BitShift ( SDNode * N , SelectionDAG & DAG , const <ISA_LIT>Subtarget * ST ) { EVT VT = N -> getValueType ( <NUM_LIT> ) ; SDLoc dl ( N ) ; if ( VT != <STR_LIT> ) return SDValue ( ) ; assert ( ( N -> getOpcode ( ) == <STR_LIT> || N -> getOpcode ( ) == <STR_LIT> ) && <STR_LIT> ) ; if ( ! isa < ConstantSDNode > ( N -> getOperand ( <NUM_LIT> ) ) || cast < ConstantSDNode > ( N -> getOperand ( <NUM_LIT> ) ) -> getZExtValue ( ) != <NUM_LIT> ) return SDValue ( ) ; if ( ST -> isThumb1Only ( ) ) return SDValue


<s> SDValue Lo = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , N -> getOperand ( <NUM_LIT> ) , DAG . getConstant ( <NUM_LIT> , dl , <STR_LIT> ) ) ; SDValue Hi = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , N -> getOperand ( <NUM_LIT> ) , DAG . getConstant ( <NUM_LIT> , dl , <STR_LIT> ) ) ; unsigned Opc = N -> getOpcode ( ) == <STR_LIT> ? <STR_LIT> : <STR_LIT> ; Hi = DAG . getNode ( Opc , dl , DAG . getVTList ( <STR_LIT> , <STR_LIT> ) , Hi ) ; Lo = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , Lo , Hi . getValue ( <NUM_LIT> ) ) ; return DAG . getNode ( <STR_LIT> , dl , <STR_LIT> ,


<s> return DAG . getNode ( <STR_LIT> , dl , DstVT , DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , Lo , Hi ) ) ; } if ( DstVT == <STR_LIT> && TLI . isTypeLegal ( SrcVT ) ) { SDValue Cvt ; if ( DAG . getDataLayout ( ) . isBigEndian ( ) && SrcVT . isVector ( ) && SrcVT . getVectorNumElements ( ) > <NUM_LIT> ) Cvt = DAG . getNode ( <STR_LIT> , dl , DAG . getVTList ( <STR_LIT> , <STR_LIT> ) , DAG . getNode ( <STR_LIT> , dl , SrcVT , Op ) ) ; else Cvt = DAG . getNode ( <STR_LIT> , dl , DAG . getVTList ( <STR_LIT> , <STR_LIT> ) , Op ) ; return DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , Cvt , Cvt . getValue ( <NUM_LIT> ) ) ; } return SDValue (


<s> return InlineAsm :: Constraint_Um ; case 'n' : return InlineAsm :: Constraint_Un ; case 'q' : return InlineAsm :: Constraint_Uq ; case 's' : return InlineAsm :: Constraint_Us ; case 't' : return InlineAsm :: Constraint_Ut ; case 'v' : return InlineAsm ::


<s> Info . offset = <NUM_LIT> ; Value * AlignArg = I . getArgOperand ( I . getNumArgOperands ( ) - <NUM_LIT> ) ; Info . align = cast < ConstantInt > ( AlignArg ) -> getZExtValue ( ) ; Info . vol = false ; Info . readMem = true ; Info . writeMem = false ; return true ; } case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : { Info . opc = <STR_LIT> ; auto & DL = I . getCalledFunction ( ) -> getParent ( ) -> getDataLayout ( ) ; unsigned NumElts = <NUM_LIT> ; for ( unsigned ArgI = <NUM_LIT> , ArgE = I . getNumArgOperands ( ) ; ArgI < ArgE ; ++ ArgI ) { Type * ArgTy = I . getArgOperand ( ArgI ) -> getType ( ) ; if ( ! ArgTy -> isVectorTy ( ) ) break ; NumElts += DL . getTypeAllocSize ( ArgTy ) / <NUM_LIT> ; } Info . memVT = EVT :: getVectorVT ( I . getType ( ) -> getContext ( ) , <STR_LIT> , NumElts ) ; Info . ptrVal = I . getArgOperand ( <NUM_LIT> ) ; Info . offset = <NUM_LIT> ; Value * AlignArg = I . getArgOperand ( I . getNumArgOperands ( ) - <NUM_LIT> ) ; Info . align = cast < ConstantInt > ( AlignArg ) -> getZExtValue ( ) ; Info . vol = false ; Info . readMem = false ; Info . writeMem = true ; return true ; } case <STR_LIT> : case <STR_LIT> : { auto & DL = I . getCalledFunction ( ) -> getParent ( ) -> getDataLayout ( ) ; PointerType * PtrTy = cast < PointerType > ( I . getArgOperand ( <NUM_LIT> ) -> getType ( ) ) ; Info . opc = <STR_LIT> ; Info . memVT = <STR_LIT> ( PtrTy -> getElementType ( ) ) ; Info . ptrVal = I . getArgOperand ( <NUM_LIT> ) ; Info . offset = <NUM_LIT> ; Info . align = DL . getABITypeAlignment ( PtrTy -> getElementType ( ) ) ; Info . vol = true ; Info . readMem = true ; Info . writeMem = false ; return true ; } case <STR_LIT> : case <STR_LIT> : { auto & DL = I . getCalledFunction ( ) -> getParent ( ) -> getDataLayout ( ) ; PointerType * PtrTy = cast < PointerType > ( I . getArgOperand ( <NUM_LIT> ) -> getType ( ) ) ; Info . opc =


<s> EVT VT = N -> getValueType ( <NUM_LIT> ) ; if ( VT . isVector ( ) ) { assert ( ST -> hasNEON ( ) ) ; SDValue X = N -> getOperand ( <NUM_LIT> ) ; SDValue NX = DAG . getNode ( <STR_LIT> , dl , VT , getZeroVector ( VT , DAG , dl ) , X ) ; SDValue LSB = DAG . getNode ( <STR_LIT> , dl , VT , X , NX ) ; EVT ElemTy = VT . getVectorElementType ( ) ; if ( ElemTy == <STR_LIT> ) { SDValue One = DAG . getNode ( <STR_LIT> , dl , VT , DAG . getTargetConstant ( <NUM_LIT> , dl , ElemTy ) ) ; SDValue Bits = DAG . getNode ( <STR_LIT> , dl , VT , LSB , One ) ; return DAG . getNode ( <STR_LIT> , dl , VT , Bits ) ; } if ( ( ElemTy == <STR_LIT> || ElemTy == <STR_LIT> ) && ( N -> getOpcode ( ) == <STR_LIT> ) ) { unsigned NumBits = ElemTy . getSizeInBits ( ) ; SDValue WidthMinus1 = DAG . getNode ( <STR_LIT> , dl , VT , DAG . getTargetConstant ( NumBits - <NUM_LIT> , dl , ElemTy ) ) ; SDValue CTLZ = DAG . getNode ( <STR_LIT> , dl , VT , LSB ) ; return DAG . getNode ( <STR_LIT> , dl , VT , WidthMinus1 , CTLZ ) ; } SDValue Bits ; if ( ElemTy == <STR_LIT> ) { SDValue FF = DAG . getNode ( <STR_LIT> , dl , VT , DAG . getTargetConstant ( <NUM_LIT> , dl , <STR_LIT> ) ) ; Bits = DAG . getNode ( <STR_LIT> , dl , VT , LSB , FF ) ; } else { SDValue One = DAG . getNode ( <STR_LIT> , dl , VT , DAG . getTargetConstant ( <NUM_LIT> , dl , ElemTy ) ) ; Bits = DAG . getNode ( <STR_LIT> , dl , VT


<s> SDValue <ISA_LIT>TargetLowering :: LowerFP_TO_INT ( SDValue Op , SelectionDAG & DAG ) const { EVT VT = Op . getValueType ( ) ; if ( VT . isVector ( ) ) return LowerVectorFP_TO_INT ( Op , DAG ) ; if ( Subtarget -> isFPOnlySP ( ) && Op . getOperand ( <NUM_LIT> ) . getValueType ( ) == <STR_LIT> ) { RTLIB :: Libcall LC ; if ( Op . getOpcode ( ) == <STR_LIT> ) LC = RTLIB :: getFPTOSINT ( Op .

getOperand ( <NUM_LIT> ) . getValueType ( ) , Op . getValueType ( ) ) ;


<s> Entry . isZExt = false ; Entry . isSRet = true ; Args . push_back ( Entry ) ; Entry . Node = Arg ; Entry . Ty = ArgTy ; Entry . isSExt = false ; Entry . isZExt = false ; Args . push_back ( Entry ) ; const char * LibcallName = ( ArgVT == <STR_LIT> ) ? <STR_LIT> : <STR_LIT> ; SDValue Callee = DAG . getExternalSymbol ( LibcallName , getPointerTy ( DL ) ) ; TargetLowering :: CallLoweringInfo CLI ( DAG ) ; CLI . setDebugLoc ( dl ) . setChain ( DAG . getEntryNode ( ) ) . setCallee ( CallingConv :: C , Type :: getVoidTy ( * DAG . getContext ( ) ) , Callee , std :: move ( Args ) , <NUM_LIT> ) . setDiscardResult ( ) ; std :: pair < SDValue , SDValue > CallResult = LowerCallTo ( CLI ) ; SDValue LoadSin = DAG . getLoad ( ArgVT , dl , CallResult . second , SRet , MachinePointerInfo ( ) , false , false , false , <NUM_LIT> ) ; SDValue Add = DAG . getNode ( <STR_LIT> , dl , PtrVT , SRet , DAG . getIntPtrConstant ( ArgVT . getStoreSize ( )


<s> bool UseGOTOFF = GV -> hasLocalLinkage ( ) || GV -> hasHiddenVisibility ( ) ; <ISA_LIT>ConstantPoolValue * CPV = <ISA_LIT>ConstantPoolConstant :: Create ( GV , UseGOTOFF ? <STR_LIT> : <STR_LIT> ) ; SDValue CPAddr = DAG . getTargetConstantPool ( CPV , PtrVT , <NUM_LIT> ) ; CPAddr = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , CPAddr ) ; SDValue Result = DAG . getLoad ( PtrVT , dl , DAG . getEntryNode ( ) , CPAddr , MachinePointerInfo :: getConstantPool ( DAG . getMachineFunction ( ) ) , false , false , false , <NUM_LIT> ) ; SDValue Chain = Result . getValue ( <NUM_LIT> ) ; SDValue GOT = DAG . getGLOBAL_OFFSET_TABLE ( PtrVT ) ; Result = DAG . getNode ( <STR_LIT> , dl , PtrVT , Result , GOT ) ; if ( ! UseGOTOFF ) Result = DAG . getLoad ( PtrVT , dl , Chain , Result , MachinePointerInfo :: getGOT ( DAG . getMachineFunction ( ) ) , false , false , false , <NUM_LIT> ) ; return Result ; } if ( Subtarget -> useMovt ( DAG . getMachineFunction ( ) ) ) { ++ NumMovwMovt ; return DAG . getNode ( <STR_LIT> , dl , PtrVT , DAG . getTargetGlobalAddress ( GV ,


<s> SDValue <ISA_LIT>TargetLowering :: LowerGLOBAL_OFFSET_TABLE ( SDValue Op , SelectionDAG & DAG ) const { assert ( Subtarget -> isTargetELF ( ) && <STR_LIT> ) ; MachineFunction & MF = DAG . getMachineFunction ( ) ; <ISA_LIT>FunctionInfo * AFI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; unsigned <ISA_LIT>PCLabelIndex = AFI -> createPICLabelUId ( ) ; EVT PtrVT = getPointerTy ( DAG . getDataLayout ( ) ) ; SDLoc dl ( Op ) ; unsigned PCAdj = Subtarget -> isThumb ( ) ?


<s> bool <ISA_LIT>TargetLowering :: lowerInterleavedLoad ( LoadInst * LI , ArrayRef < ShuffleVectorInst * > Shuffles , ArrayRef < unsigned > Indices , unsigned Factor ) const { assert ( Factor >= <NUM_LIT> && Factor <= getMaxSupportedInterleaveFactor ( ) && <STR_LIT> ) ; assert ( ! Shuffles . empty ( ) && <STR_LIT> ) ; assert ( Shuffles . size ( ) == Indices . size ( ) && <STR_LIT> ) ; VectorType * VecTy = Shuffles [ <NUM_LIT> ] -> getType ( ) ; Type * EltTy = VecTy -> getVectorElementType ( ) ; const DataLayout & DL = LI -> getModule ( ) -> getDataLayout ( ) ; unsigned VecSize = DL . getTypeAllocSizeInBits ( VecTy ) ; bool EltIs64Bits = DL . getTypeAllocSizeInBits ( EltTy ) == <NUM_LIT> ; if ( ! Subtarget -> hasNEON ( ) || ( VecSize != <NUM_LIT> && VecSize != <NUM_LIT> ) || EltIs64Bits ) return false ; if ( EltTy -> isPointerTy ( ) ) VecTy = VectorType :: get ( DL . getIntPtrType ( EltTy ) , VecTy -> getVectorNumElements ( ) ) ; static const <STR_LIT> LoadInts [ <NUM_LIT> ] = { <STR_LIT> , <STR_LIT> , <STR_LIT> } ; IRBuilder < > Builder ( LI ) ; SmallVector < Value * , <NUM_LIT> > Ops ; Type * Int8Ptr = Builder . getInt8PtrTy ( LI -> getPointerAddressSpace ( ) ) ; Ops . push_back ( Builder . CreateBitCast ( LI -> getPointerOperand ( ) , Int8Ptr ) ) ; Ops . push_back ( Builder . getInt32 ( LI -> getAlignment ( ) ) ) ; Type * Tys [ ] = { VecTy , Int8Ptr } ; Function * VldnFunc = <STR_LIT> ( LI -> getModule ( ) , LoadInts [ Factor - <NUM_LIT> ] , Tys ) ; CallInst * VldN = Builder . CreateCall ( VldnFunc , Ops , <STR_LIT> ) ; for ( unsigned i = <NUM_LIT> ; i < Shuffles . size ( ) ; i ++ ) { ShuffleVectorInst * SV = Shuffles [


<s> const DataLayout & DL = SI -> getModule ( ) -> getDataLayout ( ) ; unsigned SubVecSize = DL . getTypeAllocSizeInBits ( SubVecTy ) ; bool EltIs64Bits = DL . getTypeAllocSizeInBits ( EltTy ) == <NUM_LIT> ; if ( ! Subtarget -> hasNEON ( ) || ( SubVecSize != <NUM_LIT> && SubVecSize != <NUM_LIT> ) || EltIs64Bits ) return false ; Value * Op0 = SVI -> getOperand ( <NUM_LIT> ) ; Value * Op1 = SVI -> getOperand ( <NUM_LIT> ) ; IRBuilder < > Builder ( SI ) ; if ( EltTy -> isPointerTy ( ) ) { Type * IntTy = DL . getIntPtrType ( EltTy ) ; Type * IntVecTy = VectorType :: get ( IntTy , Op0 -> getType ( ) -> getVectorNumElements ( ) ) ; Op0 = Builder . CreatePtrToInt ( Op0 , IntVecTy ) ; Op1 = Builder . CreatePtrToInt ( Op1 , IntVecTy ) ; SubVecTy = VectorType :: get ( IntTy , NumSubElts ) ; } static <STR_LIT> StoreInts [ <NUM_LIT> ] = { <STR_LIT> , <STR_LIT> , <STR_LIT> } ; SmallVector < Value * , <NUM_LIT> >


<s> Reloc :: Model RelocM = getTargetMachine ( ) . getRelocationModel ( ) ; SDValue CPAddr ; unsigned PCAdj = ( RelocM != Reloc :: PIC_ ) ? <NUM_LIT> : ( Subtarget -> isThumb ( ) ? <NUM_LIT> : <NUM_LIT> ) ; <ISA_LIT>ConstantPoolValue * CPV = <ISA_LIT>ConstantPoolConstant :: Create ( MF . getFunction ( ) , <ISA_LIT>PCLabelIndex , <STR_LIT> , PCAdj ) ; CPAddr = DAG . getTargetConstantPool ( CPV , PtrVT , <NUM_LIT> ) ; CPAddr = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , CPAddr ) ; SDValue Result = DAG . getLoad ( PtrVT , dl , DAG . getEntryNode ( ) , CPAddr , MachinePointerInfo :: getConstantPool ( DAG . getMachineFunction ( ) ) , false , false , false , <NUM_LIT> ) ; if ( RelocM == Reloc :: PIC_ ) { SDValue PICLabel = DAG . getConstant ( <ISA_LIT>PCLabelIndex , dl , <STR_LIT> ) ; Result = DAG . getNode ( <STR_LIT> , dl , PtrVT , Result , PICLabel ) ; } return Result ; } case <STR_LIT> : case <STR_LIT> : { unsigned NewOpc = ( IntNo == <STR_LIT> ) ? <STR_LIT> : <STR_LIT> ; return DAG . getNode ( NewOpc , SDLoc ( Op ) , Op . getValueType ( ) , Op . getOperand ( <NUM_LIT> ) , Op . getOperand ( <NUM_LIT> ) ) ; } case <STR_LIT> : case <STR_LIT> : { unsigned NewOpc = ( IntNo == <STR_LIT> ) ? <STR_LIT> : <STR_LIT> ; return DAG . getNode ( NewOpc , SDLoc ( Op ) , Op . getValueType ( ) , Op . getOperand ( <NUM_LIT> ) , Op . getOperand ( <NUM_LIT> ) ) ; } case <STR_LIT> : case <STR_LIT> : { if ( Op . getValueType ( ) . isFloatingPoint ( ) ) return SDValue ( ) ; unsigned NewOpc = ( IntNo == <STR_LIT> ) ? <STR_LIT> : <STR_LIT> ; return DAG . getNode ( NewOpc , SDLoc ( Op ) , Op . getValueType ( ) , Op . getOperand ( <NUM_LIT> ) , Op . getOperand ( <NUM_LIT> ) ) ; } case <STR_LIT> : case <STR_LIT> : { if ( ! Op . getValueType ( ) . isFloatingPoint ( ) ) { unsigned NewOpc = ( IntNo == <STR_LIT> ) ? <STR_LIT> : <STR_LIT> ; return DAG . getNode ( NewOpc , SDLoc ( Op ) , Op . getValueType ( ) , Op . getOperand ( <NUM_LIT> ) , Op . getOperand ( <NUM_LIT> ) ) ; } unsigned NewOpc = ( IntNo == <STR_LIT> ) ? <STR_LIT> : <STR_LIT> ; return DAG . getNode ( NewOpc , SDLoc ( Op ) , Op . getValueType ( ) , Op .


<s> return TargetLowering :: shouldFormOverflowOp ( Opcode , VT


<s> return MF -> getFunction ( ) . getCallingConv ( ) == CallingConv :: CXX_FAST_TLS && MF -> getFunction ( ) .

hasFnAttribute ( Attribute :: NoUnwind ) ;


<s> void <ISA_LIT>JITInfo :: replaceMachineCodeForFunction ( void * Old , void * New ) { llvm_report_error ( <STR_LIT>


<s> void <ISA_LIT>JITInfo :: replaceMachineCodeForFunction ( void * Old , void *


<s> * ( ( intptr_t * ) RelocPos ) |= ResultPtr ; * ( ( intptr_t * ) RelocPos ) |= get<ISA_LIT>RegisterNumbering ( <STR_LIT> ) << <STR_LIT> ; break ; } case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : { * ( ( intptr_t * ) RelocPos ) |= ( intptr_t ) ResultPtr ; break ; } case <STR_LIT> : { ResultPtr = ResultPtr - ( intptr_t ) RelocPos - <NUM_LIT> ; ResultPtr = ( ResultPtr & <NUM_LIT> ) >> <NUM_LIT> ; assert ( ResultPtr >= - <NUM_LIT> && ResultPtr <= <NUM_LIT> ) ; * ( ( intptr_t * ) RelocPos ) |= ResultPtr ; break ; } case <STR_LIT> : { ResultPtr = ResultPtr - ( intptr_t ) RelocPos - <NUM_LIT> ; * ( ( intptr_t * ) RelocPos ) |= ResultPtr ; break ; } case <STR_LIT> : { ResultPtr = ResultPtr & <NUM_LIT> ; * ( ( intptr_t * ) RelocPos ) |= ResultPtr


<s> if ( ResultPtr >= <NUM_LIT> ) * ( ( intptr_t * ) RelocPos ) |= <NUM_LIT> << <STR_LIT> ; else { * ( ( intptr_t * ) RelocPos ) &= ~ ( <NUM_LIT> << <STR_LIT> ) ; ResultPtr = - ResultPtr ; } if ( MR -> getRelocationType ( ) == <STR_LIT> ) ResultPtr = ResultPtr >> <NUM_LIT> ; * ( ( intptr_t * ) RelocPos ) |= ResultPtr ; * ( ( intptr_t * ) RelocPos ) |= get<ISA_LIT>RegisterNumbering ( <STR_LIT> ) << <STR_LIT> ; break ; } case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : { * ( ( intptr_t * ) RelocPos ) |= ( intptr_t ) ResultPtr ; break ; } case <STR_LIT> : { ResultPtr = ResultPtr - ( intptr_t ) RelocPos - <NUM_LIT> ; ResultPtr = ( ResultPtr & <NUM_LIT> ) >> <NUM_LIT> ; assert ( ResultPtr >= - <NUM_LIT> && ResultPtr <= <NUM_LIT> ) ; * ( ( intptr_t * ) RelocPos ) |= ResultPtr ; break ; } case <STR_LIT> : { ResultPtr = ResultPtr - ( intptr_t ) RelocPos - <NUM_LIT> ; * ( ( intptr_t * )


<s> MCE . emitWordLE ( <NUM_LIT> ) ; MCE . emitWordLE ( LazyPtr - ( Addr + <NUM_LIT> + <NUM_LIT> ) ) ; sys :: Memory :: InvalidateInstructionCache ( ( void * ) Addr , <NUM_LIT> ) ; } else { MCE . startGVStub ( F , <NUM_LIT> , <NUM_LIT> ) ; intptr_t Addr = ( intptr_t ) MCE . getCurrentPCValue ( ) ; MCE . emitWordLE ( <NUM_LIT> ) ; MCE . emitWordLE ( ( intptr_t ) Fn ) ; sys :: Memory :: InvalidateInstructionCache ( ( void * ) Addr , <NUM_LIT> ) ; } } else { MCE . startGVStub ( F , <NUM_LIT> , <NUM_LIT> ) ; intptr_t Addr = ( intptr_t ) MCE . getCurrentPCValue ( ) ; MCE . emitWordLE ( <NUM_LIT> ) ; MCE . emitWordLE ( <NUM_LIT> ) ; MCE . emitWordLE ( <NUM_LIT> ) ; MCE . emitWordLE ( ( intptr_t ) <ISA_LIT>CompilationCallback ) ; sys :: Memory :: InvalidateInstructionCache ( ( void * ) Addr


<s> void <ISA_LIT>JITInfo :: replaceMachineCodeForFunction ( void * Old , void * New ) { abort (


<s> assert ( SoImmVal != - <NUM_LIT> && <STR_LIT> ) ; * ( ( intptr_t * ) RelocPos ) |= ( <STR_LIT> ( ( unsigned ) SoImmVal ) >> <NUM_LIT> ) << <STR_LIT> ; * ( ( intptr_t * ) RelocPos ) |= <STR_LIT> ( ( unsigned ) SoImmVal ) ; * ( ( intptr_t * ) RelocPos ) |= get<ISA_LIT>RegisterNumbering ( <STR_LIT> ) << <STR_LIT> ; break ; } case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : { * ( ( intptr_t * ) RelocPos ) |= ( intptr_t ) ResultPtr ; break ; } case <STR_LIT> : { ResultPtr = ResultPtr - ( intptr_t ) RelocPos - <NUM_LIT> ; ResultPtr = ( ResultPtr & <NUM_LIT> ) >> <NUM_LIT> ; assert ( ResultPtr >= - <NUM_LIT> && ResultPtr <= <NUM_LIT> ) ; * ( ( intptr_t * ) RelocPos ) |= ResultPtr ; break ; } case <STR_LIT> : { ResultPtr = ResultPtr - ( intptr_t ) RelocPos - <NUM_LIT> ; * ( ( intptr_t * ) RelocPos ) |= ResultPtr ; break ; } case <STR_LIT> : { ResultPtr = ResultPtr & <NUM_LIT>


<s> if ( Fn != ( void * ) ( intptr_t ) <ISA_LIT>CompilationCallback ) { if ( IsPIC ) { intptr_t LazyPtr = getIndirectSymAddr ( Fn ) ; if ( ! LazyPtr ) { LazyPtr = ( intptr_t ) emitGlobalValueIndirectSym ( ( GlobalValue * ) F , Fn , JCE ) ; DEBUG ( if ( F ) errs ( ) << <STR_LIT> << LazyPtr << <STR_LIT> << F -> getName ( ) << <STR_LIT> ; else errs ( ) << <STR_LIT> << LazyPtr << <STR_LIT> << Fn << <STR_LIT> ) ; } JCE . emitAlignment ( <NUM_LIT> ) ; Addr = ( void * ) JCE . getCurrentPCValue ( ) ; if ( ! sys :: Memory :: setRangeWritable ( Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( LazyPtr - ( intptr_t ( Addr ) + <NUM_LIT> + <NUM_LIT> ) ) ; sys :: Memory :: InvalidateInstructionCache ( Addr , <NUM_LIT> ) ; if ( ! sys :: Memory :: setRangeExecutable ( Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } } else { JCE . emitAlignment ( <NUM_LIT> ) ; Addr = ( void * ) JCE . getCurrentPCValue ( ) ; if ( ! sys :: Memory :: setRangeWritable ( Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( ( intptr_t ) Fn ) ; sys :: Memory :: InvalidateInstructionCache ( Addr , <NUM_LIT> ) ; if ( ! sys :: Memory :: setRangeExecutable ( Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } } } else { JCE . emitAlignment ( <NUM_LIT> ) ; Addr = ( void * ) JCE . getCurrentPCValue ( ) ; if ( ! sys :: Memory :: setRangeWritable ( Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( ( intptr_t ) <ISA_LIT>CompilationCallback ) ; sys :: Memory :: InvalidateInstructionCache ( Addr , <NUM_LIT> ) ; if ( ! sys :: Memory :: setRangeExecutable ( Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } } return


<s> virtual bool hasCustomConstantPool (


<s> void * RelocPos = ( char * ) Function + MR -> getMachineCodeOffset ( ) ; intptr_t ResultPtr = resolveRelocDestAddr ( MR ) ; switch ( ( <STR_LIT> ) MR -> getRelocationType ( ) ) { case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : { ResultPtr = ResultPtr - ( intptr_t ) RelocPos - <NUM_LIT> ; if ( ResultPtr >= <NUM_LIT> ) * ( ( intptr_t * ) RelocPos ) |= <NUM_LIT> << <STR_LIT> ; else { * ( ( intptr_t * ) RelocPos ) &= ~ ( <NUM_LIT> << <STR_LIT> ) ; ResultPtr = - ResultPtr ; } if ( MR -> getRelocationType ( ) == <STR_LIT> ) ResultPtr = ResultPtr >> <NUM_LIT> ; * ( ( intptr_t * ) RelocPos ) |= ResultPtr ; * ( ( intptr_t * ) RelocPos ) |= <ISA_LIT>RegisterInfo :: getRegisterNumbering ( <STR_LIT> ) << <STR_LIT> ; break ; } case <STR_LIT> : case


<s> ConstPoolId2AddrMap . resize ( AFI -> getNumPICLabels ( ) ) ; JumpTableId2AddrMap . resize ( AFI -> getNumJumpTables ( ) ) ; IsPIC =


<s> void Initialize ( const MachineFunction & MF , bool isPIC ) { const <ISA_LIT>FunctionInfo * AFI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; ConstPoolId2AddrMap . resize ( AFI -> getNumPICLabels ( ) ) ; JumpTableId2AddrMap . resize ( AFI -> getNumJumpTables ( ) ) ; IsPIC =


<s> LazyPtr = ( intptr_t ) emitGlobalValueIndirectSym ( ( GlobalValue * ) F , Fn , JCE ) ; if ( F ) DOUT << <STR_LIT> << LazyPtr << <STR_LIT> << F -> getName ( ) << <STR_LIT> ; else DOUT << <STR_LIT> << LazyPtr << <STR_LIT> << Fn << <STR_LIT> ; } JCE . startGVStub ( F , <NUM_LIT> , <NUM_LIT> ) ; intptr_t Addr = ( intptr_t ) JCE . getCurrentPCValue ( ) ; JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( LazyPtr - ( Addr + <NUM_LIT> + <NUM_LIT> ) ) ; sys :: Memory :: InvalidateInstructionCache ( ( void * ) Addr , <NUM_LIT> ) ; } else


<s> if ( Fn != ( void * ) ( intptr_t ) <ISA_LIT>CompilationCallback ) { if ( IsPIC ) { intptr_t LazyPtr = getIndirectSymAddr ( Fn ) ; if ( ! LazyPtr ) { LazyPtr = ( intptr_t ) emitGlobalValueIndirectSym ( ( GlobalValue * ) F , Fn , JCE ) ; if ( F ) DOUT << <STR_LIT> << LazyPtr << <STR_LIT> << F -> getName ( ) << <STR_LIT> ; else DOUT << <STR_LIT> << LazyPtr << <STR_LIT> << Fn << <STR_LIT> ; } JCE . startGVStub ( F , <NUM_LIT> , <NUM_LIT> ) ; intptr_t Addr = ( intptr_t ) JCE . getCurrentPCValue ( ) ; JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( LazyPtr - ( Addr + <NUM_LIT> + <NUM_LIT> ) ) ; sys :: Memory :: InvalidateInstructionCache ( ( void * ) Addr , <NUM_LIT> ) ; } else { JCE . startGVStub ( F , <NUM_LIT> , <NUM_LIT>


<s> JCE . emitWordLE ( ( intptr_t ) Ptr ) ; void * PtrAddr = JCE . finishGVStub ( GV ) ; addIndirectSymAddr ( Ptr , ( intptr_t ) PtrAddr


<s> void * PtrAddr = JCE . finishGVStub ( GV ) ; addIndirectSymAddr ( Ptr , ( intptr_t ) PtrAddr


<s> JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( LazyPtr - ( Addr + <NUM_LIT> + <NUM_LIT> ) ) ; sys :: Memory :: InvalidateInstructionCache ( ( void * ) Addr , <NUM_LIT> ) ; if ( ! sys :: Memory :: setRangeExecutable ( ( void * ) Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } } else { JCE . startGVStub ( F , <NUM_LIT> , <NUM_LIT> ) ; intptr_t Addr = ( intptr_t ) JCE . getCurrentPCValue ( ) ; if ( ! sys :: Memory :: setRangeWritable ( ( void * ) Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( ( intptr_t ) Fn ) ; sys :: Memory :: InvalidateInstructionCache ( ( void * ) Addr , <NUM_LIT> ) ; if ( ! sys :: Memory :: setRangeExecutable ( ( void * ) Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } } } else { JCE . startGVStub ( F , <NUM_LIT> , <NUM_LIT> ) ; intptr_t Addr = ( intptr_t ) JCE . getCurrentPCValue ( ) ; if ( ! sys :: Memory :: setRangeWritable ( ( void * )


<s> if ( ! sys :: Memory :: setRangeExecutable ( ( void * ) Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } void * PtrAddr = JCE . finishGVStub ( GV ) ; addIndirectSymAddr ( Ptr , ( intptr_t


<s> } JCE . emitWordLE ( ( intptr_t ) Ptr ) ; if ( ! sys :: Memory :: setRangeExecutable ( ( void * ) Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } void * PtrAddr = JCE


<s> assert ( CPI < ConstPoolId2AddrMap .


<s> Sym2IndirectSymMap . insert ( std :: make_pair ( SymAddr , IndSymAddr )


<s> PCLabelMap . insert ( std :: make_pair


<s> PCLabelMap . insert ( std :: make_pair ( Id


<s> bool allocateSeparateGVMemory ( ) const override { return true ; return


<s> bool allocateSeparateGVMemory ( ) const override { return true ; return false


<s> else errs ( ) << <STR_LIT> << LazyPtr << <STR_LIT> << Fn << <STR_LIT> ) ; } JCE . emitAlignment ( <NUM_LIT> ) ; Addr = ( void * ) JCE . getCurrentPCValue ( ) ; if ( ! sys :: Memory :: setRangeWritable ( Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( LazyPtr - ( intptr_t ( Addr ) + <NUM_LIT> + <NUM_LIT> ) ) ; sys :: Memory :: InvalidateInstructionCache ( Addr , <NUM_LIT> ) ; if ( ! sys :: Memory :: setRangeExecutable ( Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } } else { JCE . emitAlignment ( <NUM_LIT> ) ; Addr = ( void * ) JCE . getCurrentPCValue ( ) ; if ( ! sys :: Memory :: setRangeWritable ( Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } JCE . emitWordLE ( <NUM_LIT> ) ; JCE . emitWordLE ( ( intptr_t ) Fn ) ; sys :: Memory :: InvalidateInstructionCache ( Addr , <NUM_LIT> ) ; if ( ! sys :: Memory :: setRangeExecutable ( Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } } } else { JCE . emitAlignment ( <NUM_LIT> ) ; Addr = ( void * ) JCE . getCurrentPCValue ( ) ; if ( ! sys :: Memory :: setRangeWritable ( Addr , <NUM_LIT> ) ) { llvm_unreachable ( <STR_LIT> ) ; } JCE . emitWordLE ( <NUM_LIT>


<s> void * <ISA_LIT>JITInfo :: emitGlobalValueIndirectSym ( const GlobalValue * GV , void * Ptr , JITCodeEmitter & JCE ) { uint8_t Buffer [ <NUM_LIT> ] ; uint8_t * Cur = Buffer ; MachineCodeEmitter :: emitWordLEInto ( Cur , ( intptr_t ) Ptr ) ; void * PtrAddr = JCE . allocIndirectGV ( GV , Buffer , sizeof ( Buffer )


<s> assert ( CPI < ConstPoolId2AddrMap . size ( ) ) ; return ConstPoolId2AddrMap [ CPI


<s> TargetJITInfo :: LazyResolverFn <ISA_LIT>JITInfo :: getLazyResolverFunction ( JITCompilerFn F ) { JITCompilerFunction = F


<s> TargetJITInfo :: StubLayout <ISA_LIT>JITInfo :: getStubLayout (


<s> bool hasCustomConstantPool ( ) const override { return true


<s> void <ISA_LIT>JITInfo :: Initialize ( const MachineFunction & MF , bool isPIC ) { const <ISA_LIT>FunctionInfo * AFI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; ConstPoolId2AddrMap . resize ( AFI -> getNumPICLabels ( )


<s> void <ISA_LIT>JITInfo :: replaceMachineCodeForFunction ( void * Old , void * New ) { report_fatal_error ( <STR_LIT>


<s> return getJumpTableBaseAddr ( MR -> getJumpTableIndex ( ) ) ; case <STR_LIT> : case <STR_LIT> : return getConstantPoolEntryAddr ( MR -> getConstantPoolIndex ( ) ) ; case <STR_LIT> : { <ISA_LIT>ConstantPoolValue * ACPV = ( <ISA_LIT>ConstantPoolValue * ) MR -> getConstantVal ( ) ; assert ( ( ! ACPV -> hasModifier ( ) && ! ACPV -> mustAddCurrentAddress ( ) ) && <STR_LIT> ) ; intptr_t Addr = ( intptr_t ) ( MR -> getResultPointer


<s> return ( intptr_t ) ( MR -> getResultPointer ( ) ) ; case <STR_LIT> : return ( intptr_t ) ( MR -> getResultPointer ( ) ) - MR -> getConstantVal ( ) ; case <STR_LIT> : return getJumpTableBaseAddr ( MR -> getJumpTableIndex ( ) ) ; case <STR_LIT> : case <STR_LIT> : return getConstantPoolEntryAddr ( MR -> getConstantPoolIndex ( ) ) ; case <STR_LIT>


<s> if ( pConfig . targets ( ) . triple ( ) . isOSWindows ( ) ) { assert ( <NUM_LIT> && <STR_LIT> ) ; } return new <ISA_LIT>GNULDBackend ( pConfig , new <ISA_LIT>GNUInfo ( pConfig . targets ( ) . triple ( )


<s> } if ( pConfig . targets ( ) . triple ( ) . isOSWindows ( ) ) { assert ( <NUM_LIT>


<s> mcld :: ResolveInfo * resolveInfo = pModule . getNamePool ( ) . createSymbol ( <STR_LIT> , false , mcld :: ResolveInfo :: Section , mcld :: ResolveInfo :: Define , mcld :: ResolveInfo :: Local , <NUM_LIT> , mcld :: ResolveInfo :: Hidden ) ; if ( resolveInfo == nullptr ) { return nullptr ; } mcld :: LDSymbol * inputSym = mcld :: LDSymbol :: Create


<s> if ( m_pEXIDX != NULL && m_pEXIDX -> size ( ) != <NUM_LIT> ) { ELFSegment * exidx_seg = elfSegmentTable ( ) . produce ( llvm :: ELF :: PT_<ISA_LIT>_EXIDX , llvm


<s> switch ( config ( ) . options ( ) . getStripSymbolMode ( ) ) { case GeneralOptions :: StripSymbolMode :: StripAllSymbols : case GeneralOptions :: StripSymbolMode :: StripLocals : break ; default : { assert ( stub -> symInfo ( ) != NULL && stub -> symInfo ( ) -> isLocal ( ) ) ; LDSection & symtab = file_format -> getSymTab ( ) ; LDSection & strtab = file_format -> getStrTab ( ) ; symtab . setSize ( symtab . size ( ) + sizeof ( llvm :: ELF :: Elf32_Sym ) ) ; symtab . setInfo ( symtab . getInfo ( ) + <NUM_LIT> ) ; strtab . setSize ( strtab . size ( ) + stub -> symInfo ( ) -> nameSize ( ) + <NUM_LIT> ) ; } } isRelaxed = true ; } break ; } case llvm :: ELF :: R_<ISA_LIT>_V4BX : break ; default : break ; } } } } std :: vector < Fragment * > invalid_frags ; pFinished = true ; for ( BranchIslandFactory :: iterator island = getBRIslandFactory ( ) -> begin ( ) , island_end = getBRIslandFactory ( ) -> end ( ) ; island != island_end ; ++ island ) { if ( ( * island ) . size ( ) > stubGroupSize ( ) ) { error ( diag :: err_no_space_to_place_stubs ) << stubGroupSize ( ) ; return false ; } if ( ( * island ) . numOfStubs ( ) == <NUM_LIT> ) { continue ; } Fragment * exit = & * ( * island ) . end ( ) ; if ( exit == & * ( * island ) . begin ( ) -> getParent ( ) -> end ( ) ) { continue ; } if ( ( ( * island ) . offset ( ) + ( * island ) . size ( ) ) > exit -> getOffset ( ) ) { if ( invalid_frags . empty ( ) || ( invalid_frags . back ( ) -> getParent ( ) != ( * island ) . getParent ( ) ) ) { invalid_frags . push_back ( exit ) ; pFinished = false ; } continue ; } } for ( auto it = invalid_frags . begin ( ) , ie = invalid_frags . end ( ) ; it != ie ; ++ it ) { Fragment * invalid = * it ; while ( invalid != NULL ) { invalid -> setOffset ( invalid -> getPrevNode ( ) -> getOffset ( ) + invalid -> getPrevNode ( ) -> size ( ) ) ; invalid = invalid ->


<s> const <ISA_LIT>ELFDynamic & <ISA_LIT>GNULDBackend :: dynamic ( ) const { assert ( m_pDynamic != NULL


<s> const <ISA_LIT>ELFDynamic & <ISA_LIT>GNULDBackend ::


<s> const <ISA_LIT>ELFAttributeData & <ISA_LIT>GNULDBackend :: getAttributeData ( ) const { assert ( m_pAttrData != NULL && <STR_LIT>


<s> assert ( m_pGOT != NULL && <STR_LIT>


<s> const LDSymbol * getGOTSymbol ( ) const


<s> assert ( m_pPLT != NULL && <STR_LIT> ) ; return *


<s> assert ( m_pRelDyn != NULL && <STR_LIT>


<s> if ( m_pRelocator == NULL ) { m_pRelocator = new <ISA_LIT>Relocator ( * this , config ( )


<s> m_pEXIDX = pBuilder . CreateSection ( <STR_LIT> , LDFileFormat :: Target , llvm :: ELF :: SHT_<ISA_LIT>_EXIDX , llvm :: ELF :: SHF_ALLOC | llvm :: ELF :: SHF_LINK_ORDER , config ( ) . targets ( ) . bitclass ( ) / <NUM_LIT> ) ; m_pEXTAB = pBuilder . CreateSection ( <STR_LIT> , LDFileFormat :: Target , llvm :: ELF :: SHT_PROGBITS , llvm :: ELF :: SHF_ALLOC , <NUM_LIT> ) ; m_pAttributes = pBuilder . CreateSection ( <STR_LIT> , LDFileFormat :: Target , llvm :: ELF :: SHT_<ISA_LIT>_ATTRIBUTES , <NUM_LIT> , <NUM_LIT> ) ; m_pAttrData = new <ISA_LIT>ELFAttributeData ( ) ; attribute ( ) . registerAttributeData ( * m_pAttrData ) ; if ( LinkerConfig :: Object != config ( ) . codeGenType ( ) ) { ELFFileFormat * file_format = getOutputFormat ( ) ; LDSection & got = file_format -> getGOT ( ) ; m_pGOT = new <ISA_LIT>GOT ( got ) ; LDSection & plt = file_format -> getPLT (


<s> getStubFactory ( ) -> addPrototype ( new THMToTHMStub ( config ( ) . isCodeIndep ( ) , m_pAttrData -> usingThumb2 ( ) ) ) ; getStubFactory ( ) -> addPrototype ( new THMTo<ISA_LIT>Stub ( config ( ) . isCodeIndep ( ) , m_pAttrData -> usingThumb2 ( ) ) ) ; return


<s> return THM2_MAX_FWD_BRANCH_OFFSET ; } else { return THM_MAX_FWD_BRANCH_OFFSET


<s> int64_t <ISA_LIT>GNULDBackend :: maxFwdBranchOffset ( ) const { if ( m_pAttrData -> usingThumb2 ( ) ) { return THM2_MAX_FWD_BRANCH_OFFSET ; } else { return THM_MAX_FWD_BRANCH_OFFSET


<s> return ! name . startswith ( <STR_LIT> ) && ! name . startswith ( <STR_LIT> ) && GNULDBackend

:: mayHaveUnsafeFunctionPointerAccess ( pSection ) ;


<s> SectionData * sectData = IRBuilder :: CreateSectionData ( * m_pEXIDX ) ; const size_t alignExIdx = <NUM_LIT> ; m_pEXIDX -> setAlign ( alignExIdx ) ; AlignFragment * frag = new AlignFragment ( alignExIdx , <NUM_LIT> , <NUM_LIT> , alignExIdx - <NUM_LIT> ) ; frag -> setOffset ( <NUM_LIT> ) ; frag -> setParent ( sectData ) ; sectData -> getFragmentList ( ) . push_back ( frag ) ; m_pEXIDX -> setSize ( frag -> size ( ) ) ; } uint64_t offset = m_pEXIDX -> size ( ) ; SectionData :: FragmentListType & src = pSection . getSectionData ( ) -> getFragmentList ( ) ; SectionData :: FragmentListType & dst = m_pEXIDX -> getSectionData ( ) -> getFragmentList ( ) ; SectionData :: FragmentListType :: iterator frag = src . begin ( ) ; SectionData :: FragmentListType :: iterator fragEnd = src . end ( ) ; while ( frag != fragEnd ) { if ( frag -> getKind (


<s> void <ISA_LIT>GNULDBackend :: preMergeSections ( Module


<s> uint32_t size = pSD . getSection ( ) . size ( ) ; llvm :: StringRef region = pInput . memArea ( ) -> request ( offset , size ) ; if ( region . size ( ) == <NUM_LIT> ) { frag = new FillFragment ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } else { frag = new RegionFragment ( region ) ; } ObjectBuilder :: AppendFragment ( * frag , pSD ) ; return


<s> if ( ! GNULDBackend :: relax ( pModule , pBuilder ) ) { return false ; } rewrite<ISA_LIT>ExIdxSection ( pModule ) ; return true


<s> uint64_t currTextBegin = currTextFrag -> getParent ( ) -> getSection ( ) . addr ( ) + currTextFrag -> getOffset ( ) ; if ( currTextBegin > prevTextEnd ) { RegionFragment * frag = new RegionFragment ( cantUnwindRegion , nullptr ) ; frag -> setParent ( sectData ) ; list . insert ( it , frag ) ; Relocation * reloc = Relocation :: Create ( static_cast < uint32_t > ( llvm :: ELF :: R_<ISA_LIT>_PREL31 ) , * FragmentRef :: Create ( * frag , <NUM_LIT> ) , <NUM_LIT> ) ; reloc -> setSymInfo ( CreateLocalSymbolToFragmentEnd ( pModule , * prevTextFrag ) ) ; addExtraRelocation ( reloc ) ; } prevTextEnd = currTextBegin + currTextFrag -> size ( ) ; prevTextFrag = currTextFrag ; ++ it ; } RegionFragment * frag = new RegionFragment ( cantUnwindRegion , nullptr ) ; frag -> setParent ( sectData ) ; list . push_back ( frag ) ; Relocation * reloc = Relocation :: Create ( static_cast < uint32_t > ( llvm :: ELF :: R_<ISA_LIT>_PREL31 ) ,


<s> assert ( last -> getKind ( ) == Fragment :: Null ) ; tmp . splice ( tmp . end ( ) , list , first ) ; tmp . splice ( tmp . end ( ) , list , last ) ; } sort ( list , ExIdxFragmentComparator ( * m_pExData ) ) ; llvm :: StringRef cantUnwindRegion ( g_CantUnwindEntry , sizeof ( g_CantUnwindEntry ) ) ; SectionData :: FragmentListType :: iterator it = list . begin ( ) ; if ( it != list . end ( ) ) { Fragment * prevTextFrag = m_pExData -> getTupleByExIdx ( & * it ) -> getTextFragment ( ) ; uint64_t prevTextEnd = prevTextFrag -> getParent ( ) -> getSection ( ) . addr ( ) + prevTextFrag -> getOffset ( ) + prevTextFrag -> size ( ) ; ++ it ; while ( it != list . end ( ) ) { Fragment * currTextFrag = m_pExData -> getTupleByExIdx ( & * it ) -> getTextFragment ( ) ; uint64_t currTextBegin = currTextFrag -> getParent ( ) -> getSection ( ) . addr ( ) + currTextFrag -> getOffset ( ) ; if ( currTextBegin > prevTextEnd ) { RegionFragment * frag = new RegionFragment ( cantUnwindRegion , nullptr ) ; frag -> setParent ( sectData ) ; list . insert ( it , frag ) ; Relocation * reloc = Relocation :: Create ( static_cast < uint32_t > ( llvm :: ELF :: R_<ISA_LIT>_PREL31 ) , * FragmentRef :: Create ( * frag , <NUM_LIT> ) , <NUM_LIT> ) ; reloc -> setSymInfo ( CreateLocalSymbolToFragmentEnd ( pModule , * prevTextFrag ) ) ; addExtraRelocation ( reloc ) ; } prevTextEnd = currTextBegin + currTextFrag -> size ( ) ; prevTextFrag = currTextFrag ; ++ it ; } RegionFragment * frag = new RegionFragment ( cantUnwindRegion , nullptr ) ; frag -> setParent ( sectData ) ; list . push_back ( frag ) ; Relocation * reloc = Relocation :: Create ( static_cast < uint32_t > ( llvm :: ELF :: R_<ISA_LIT>_PREL31 ) , * FragmentRef :: Create ( * frag , <NUM_LIT> ) , <NUM_LIT> ) ; reloc -> setSymInfo ( CreateLocalSymbolToFragmentEnd ( pModule , * prevTextFrag ) ) ; addExtraRelocation ( reloc ) ; } list . splice ( list . begin ( ) , tmp , tmp . begin ( ) ) ; list . splice ( list . end ( ) , tmp , tmp . begin ( ) ) ; uint64_t offset = <NUM_LIT> ; for ( SectionData :: iterator it = sectData -> begin ( ) , end = sectData -> end ( ) ; it != end ; ++ it


<s> static bool AEABI ( const <ISA_LIT>Subtarget & ST ) { return ST . isTargetAEABI ( ) || ST . isTargetGNUAEABI


<s> return ST . isTargetAEABI ( ) || ST . isTargetGNUAEABI ( ) || ST


<s> <ISA_LIT>LegalizerInfo :: FCmpLibcallsList <ISA_LIT>LegalizerInfo :: getFCmpLibcalls ( CmpInst :: Predicate Predicate , unsigned Size ) const { assert ( CmpInst :: isFPPredicate ( Predicate


<s> FCmp32Libcalls . resize ( CmpInst :: LAST_FCMP_PREDICATE + <NUM_LIT> ) ; FCmp32Libcalls [ CmpInst :: FCMP_OEQ ] = { { RTLIB :: OEQ_F32 , CmpInst :: ICMP_EQ } } ; FCmp32Libcalls [ CmpInst :: FCMP_OGE ] = { { RTLIB :: OGE_F32 , CmpInst :: ICMP_SGE } } ; FCmp32Libcalls [ CmpInst :: FCMP_OGT ] = { { RTLIB :: OGT_F32 , CmpInst :: ICMP_SGT } } ; FCmp32Libcalls [ CmpInst :: FCMP_OLE ] = { { RTLIB :: OLE_F32 , CmpInst :: ICMP_SLE } } ; FCmp32Libcalls [ CmpInst :: FCMP_OLT ] = { { RTLIB :: OLT_F32 , CmpInst :: ICMP_SLT } } ; FCmp32Libcalls [ CmpInst :: FCMP_ORD ] = { { RTLIB :: O_F32 , CmpInst :: ICMP_EQ } } ; FCmp32Libcalls [ CmpInst :: FCMP_UGE ] = { { RTLIB :: OLT_F32 , CmpInst :: ICMP_SGE } } ; FCmp32Libcalls [ CmpInst :: FCMP_UGT ] = { { RTLIB :: OLE_F32 , CmpInst :: ICMP_SGT } } ; FCmp32Libcalls [ CmpInst :: FCMP_ULE ] = { { RTLIB :: OGT_F32 , CmpInst :: ICMP_SLE } } ; FCmp32Libcalls [ CmpInst :: FCMP_ULT ] = { { RTLIB :: OGE_F32 , CmpInst :: ICMP_SLT } } ; FCmp32Libcalls [ CmpInst :: FCMP_UNE ] = { { RTLIB :: UNE_F32 , CmpInst :: ICMP_NE } } ; FCmp32Libcalls [ CmpInst :: FCMP_UNO ] = { { RTLIB :: UO_F32 , CmpInst :: ICMP_NE } } ; FCmp32Libcalls [ CmpInst :: FCMP_ONE ] = { { RTLIB :: OGT_F32 , CmpInst :: ICMP_SGT } , { RTLIB :: OLT_F32 , CmpInst :: ICMP_SLT } } ; FCmp32Libcalls [ CmpInst :: FCMP_UEQ ] = { { RTLIB :: OEQ_F32 , CmpInst :: ICMP_EQ } , { RTLIB :: UO_F32 , CmpInst :: ICMP_NE } } ; FCmp64Libcalls . resize ( CmpInst :: LAST_FCMP_PREDICATE + <NUM_LIT> ) ; FCmp64Libcalls [ CmpInst :: FCMP_OEQ ] = { { RTLIB :: OEQ_F64 , CmpInst :: ICMP_EQ } } ; FCmp64Libcalls [ CmpInst :: FCMP_OGE ] = { { RTLIB :: OGE_F64 , CmpInst :: ICMP_SGE } } ; FCmp64Libcalls [ CmpInst :: FCMP_OGT ] = { { RTLIB :: OGT_F64 , CmpInst :: ICMP_SGT } } ; FCmp64Libcalls [ CmpInst :: FCMP_OLE ] = { { RTLIB :: OLE_F64 , CmpInst :: ICMP_SLE } } ; FCmp64Libcalls [ CmpInst :: FCMP_OLT ] = { { RTLIB :: OLT_F64 , CmpInst :: ICMP_SLT } } ; FCmp64Libcalls [ CmpInst :: FCMP_ORD ] = { { RTLIB :: O_F64 , CmpInst :: ICMP_EQ } } ; FCmp64Libcalls [ CmpInst :: FCMP_UGE ] = { { RTLIB :: OLT_F64 ,


<s> LegalizerInfo :: SizeAndActionsVec result = { { <NUM_LIT> , Unsupported } , { <NUM_LIT> , WidenScalar } , { <NUM_LIT> , Unsupported } , { <NUM_LIT> , WidenScalar } , { <NUM_LIT> , Unsupported } } ; addAndInterleaveWithUnsupported ( result , v ) ; auto Largest = result . back ( ) . first ; result . push_back ( { Largest +


<s> } if ( ST . hasV5TOps ( ) ) { getActionDefinitionsBuilder ( G_CTLZ ) . legalFor ( { s32 } ) . clampScalar ( <NUM_LIT> , s32 , s32 ) ; getActionDefinitionsBuilder ( G_CTLZ_ZERO_UNDEF ) . lowerFor ( { s32 } ) . clampScalar ( <NUM_LIT> , s32 , s32 ) ; } else { getActionDefinitionsBuilder ( G_CTLZ_ZERO_UNDEF ) . libcallFor ( { s32 } ) . clampScalar ( <NUM_LIT> , s32 , s32 ) ; getActionDefinitionsBuilder ( G_CTLZ ) . lowerFor ( { s32 } ) . clampScalar ( <NUM_LIT> , s32 , s32 ) ; } getActionDefinitionsBuilder ( G_GEP ) . legalFor ( { { p0 , s32 } } ) ; getActionDefinitionsBuilder ( G_SELECT ) . legalForCartesianProduct ( { s32 , p0 } , { s1 } ) ; getActionDefinitionsBuilder ( G_BRCOND ) . legalFor ( { s1 } ) ; getActionDefinitionsBuilder ( G_ICMP ) . legalForCartesianProduct ( { s1 } , { s32 , p0 } ) . minScalar ( <NUM_LIT> , s32 ) ; auto & PhiBuilder = getActionDefinitionsBuilder ( G_PHI ) . legalFor ( { s32 , p0 } ) . minScalar ( <NUM_LIT> , s32 ) ; if ( ! ST . useSoftFloat ( ) && ST . hasVFP2 ( ) ) { getActionDefinitionsBuilder ( { G_FADD , G_FSUB , G_FMUL , G_FDIV , G_FCONSTANT , G_FNEG } ) . legalFor ( { s32 , s64 } ) ; LoadStoreBuilder . legalFor ( { { s64 , p0 } } ) ; PhiBuilder . legalFor ( { s64 } ) ; getActionDefinitionsBuilder ( G_FCMP ) . legalForCartesianProduct ( { s1 } , { s32 , s64 } ) ; getActionDefinitionsBuilder ( G_MERGE_VALUES ) . legalFor ( { { s64 , s32 } } ) ; getActionDefinitionsBuilder ( G_UNMERGE_VALUES ) . legalFor ( { { s32 , s64 } } ) ; getActionDefinitionsBuilder ( G_FPEXT ) . legalFor ( { { s64 , s32 } } ) ; getActionDefinitionsBuilder ( G_FPTRUNC ) . legalFor ( { { s32 , s64 } } ) ; getActionDefinitionsBuilder ( { G_FPTOSI , G_FPTOUI } ) . legalForCartesianProduct ( { s32 } , { s32 , s64 } ) ; getActionDefinitionsBuilder ( { G_SITOFP , G_UITOFP } ) . legalForCartesianProduct ( { s32 , s64 } , { s32 } ) ; } else { getActionDefinitionsBuilder ( { G_FADD , G_FSUB , G_FMUL , G_FDIV } ) . libcallFor ( { s32 , s64 } ) ; LoadStoreBuilder . maxScalar ( <NUM_LIT> , s32 ) ; for ( auto Ty : { s32 , s64 } ) setAction ( { G_FNEG , Ty } ,


<s> auto & LoadStoreBuilder = getActionDefinitionsBuilder ( { G_LOAD , G_STORE } ) . legalForTypesWithMemDesc ( { { s1 , p0 , <NUM_LIT> , <NUM_LIT> } , { s8 , p0 , <NUM_LIT> , <NUM_LIT> } , { s16 , p0 , <NUM_LIT> , <NUM_LIT> } , { s32 , p0 , <NUM_LIT> , <NUM_LIT> } , { p0 , p0 , <NUM_LIT> , <NUM_LIT> } } ) . unsupportedIfMemSizeNotPow2 ( ) ; getActionDefinitionsBuilder ( G_FRAME_INDEX ) . legalFor ( { p0 } ) ; getActionDefinitionsBuilder ( G_GLOBAL_VALUE ) . legalFor ( { p0 } ) ; auto & PhiBuilder = getActionDefinitionsBuilder ( G_PHI ) . legalFor ( { s32 , p0 } ) . minScalar ( <NUM_LIT> , s32 ) ; getActionDefinitionsBuilder ( G_PTR_ADD ) . legalFor ( { { p0 , s32 } } ) . minScalar ( <NUM_LIT> , s32 ) ; getActionDefinitionsBuilder ( G_BRCOND ) . legalFor ( { s1 } ) ; if ( ! ST . useSoftFloat ( ) && ST . hasVFP2Base ( ) ) { getActionDefinitionsBuilder ( { G_FADD , G_FSUB , G_FMUL , G_FDIV , G_FCONSTANT , G_FNEG } ) . legalFor ( { s32 , s64 } ) ; LoadStoreBuilder . legalForTypesWithMemDesc ( { { s64 , p0 , <NUM_LIT> , <NUM_LIT> } } ) . maxScalar ( <NUM_LIT> , s32 ) ; PhiBuilder . legalFor ( { s64 } ) ; getActionDefinitionsBuilder ( G_FCMP ) . legalForCartesianProduct ( { s1 } , { s32 , s64 } ) ; getActionDefinitionsBuilder ( G_MERGE_VALUES ) . legalFor ( { { s64 , s32 } } ) ; getActionDefinitionsBuilder ( G_UNMERGE_VALUES ) . legalFor ( { { s32 , s64 } } ) ; getActionDefinitionsBuilder ( G_FPEXT ) . legalFor ( { { s64 , s32 } } ) ; getActionDefinitionsBuilder ( G_FPTRUNC ) . legalFor ( { { s32 , s64 } } ) ; getActionDefinitionsBuilder ( { G_FPTOSI , G_FPTOUI } ) . legalForCartesianProduct ( { s32 } , { s32 , s64 } ) ; getActionDefinitionsBuilder ( { G_SITOFP , G_UITOFP } ) . legalForCartesianProduct ( { s32 , s64 } , { s32 } ) ; } else { getActionDefinitionsBuilder ( { G_FADD , G_FSUB , G_FMUL , G_FDIV } ) . libcallFor ( { s32 , s64 } ) ; LoadStoreBuilder . maxScalar ( <NUM_LIT> , s32 ) ; for ( auto Ty : { s32 , s64 } ) setAction ( { G_FNEG , Ty } , Lower ) ; getActionDefinitionsBuilder ( G_FCONSTANT ) . customFor ( { s32 , s64 } ) ; getActionDefinitionsBuilder ( G_FCMP ) . customForCartesianProduct ( { s1 } , { s32 , s64 } ) ; if ( AEABI ( ST ) )


<s> auto * RetTy = Type :: getInt32Ty ( Ctx ) ; SmallVector < Register , <NUM_LIT> > Results ; for ( auto Libcall : Libcalls ) { auto LibcallResult = MRI . createGenericVirtualRegister ( LLT :: scalar ( <NUM_LIT> ) ) ; auto Status = createLibcall ( MIRBuilder , Libcall . LibcallID , { LibcallResult , RetTy } , { { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy } , { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy } } ) ; if ( Status != LegalizerHelper :: Legalized ) return false ; auto ProcessedResult = Libcalls . size ( ) == <NUM_LIT> ? OriginalResult : MRI . createGenericVirtualRegister ( MRI . getType ( OriginalResult ) ) ; CmpInst :: Predicate ResultPred = Libcall . Predicate ; if ( ResultPred == CmpInst :: BAD_ICMP_PREDICATE ) { MIRBuilder . buildTrunc ( ProcessedResult , LibcallResult ) ; } else { assert ( CmpInst :: isIntPredicate ( ResultPred ) && <STR_LIT> ) ; auto Zero = MIRBuilder . buildConstant ( LLT :: scalar ( <NUM_LIT> ) , <NUM_LIT> ) ; MIRBuilder . buildICmp ( ResultPred , ProcessedResult , LibcallResult , Zero ) ; } Results . push_back ( ProcessedResult ) ; } if ( Results . size ( ) != <NUM_LIT> ) { assert ( Results . size ( ) == <NUM_LIT> && <STR_LIT>


<s> static void addAndInterleaveWithUnsupported ( LegacyLegalizerInfo :: SizeAndActionsVec & result , const LegacyLegalizerInfo :: SizeAndActionsVec & v ) { for ( unsigned i = <NUM_LIT> ; i < v . size


<s> MI . eraseFromParent ( ) ; return true ; } assert ( ( OpSize == <NUM_LIT> || OpSize == <NUM_LIT> ) && <STR_LIT> ) ; auto * ArgTy = OpSize == <NUM_LIT> ? Type :: getFloatTy ( Ctx ) : Type :: getDoubleTy ( Ctx ) ; auto * RetTy = Type :: getInt32Ty ( Ctx ) ; SmallVector < Register , <NUM_LIT> > Results ; for ( auto Libcall : Libcalls ) { auto LibcallResult = MRI . createGenericVirtualRegister ( LLT :: scalar ( <NUM_LIT> ) ) ; auto Status = createLibcall ( MIRBuilder , Libcall . LibcallID , { LibcallResult , RetTy , <NUM_LIT> } , { { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy , <NUM_LIT> } , { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy , <NUM_LIT> } } ) ; if ( Status != LegalizerHelper :: Legalized ) return false ; auto ProcessedResult = Libcalls . size ( ) == <NUM_LIT> ? OriginalResult : MRI . createGenericVirtualRegister ( MRI . getType ( OriginalResult ) ) ; CmpInst :: Predicate ResultPred = Libcall . Predicate ; if ( ResultPred == CmpInst :: BAD_ICMP_PREDICATE ) { MIRBuilder . buildTrunc ( ProcessedResult , LibcallResult ) ; } else { assert ( CmpInst :: isIntPredicate ( ResultPred ) && <STR_LIT> ) ; auto Zero = MIRBuilder . buildConstant ( LLT :: scalar ( <NUM_LIT> ) , <NUM_LIT> ) ; MIRBuilder . buildICmp ( ResultPred , ProcessedResult ,


<s> FCmp32Libcalls [ CmpInst :: FCMP_ORD ] = { { RTLIB :: UO_F32 , CmpInst :: ICMP_EQ } } ; FCmp32Libcalls [ CmpInst :: FCMP_UGE ] = { { RTLIB :: OLT_F32 , CmpInst :: ICMP_EQ } } ; FCmp32Libcalls [ CmpInst :: FCMP_UGT ] = { { RTLIB :: OLE_F32 , CmpInst :: ICMP_EQ } } ; FCmp32Libcalls [ CmpInst :: FCMP_ULE ] = { { RTLIB :: OGT_F32 , CmpInst :: ICMP_EQ } } ; FCmp32Libcalls [ CmpInst :: FCMP_ULT ] = { { RTLIB :: OGE_F32 , CmpInst :: ICMP_EQ } } ; FCmp32Libcalls [ CmpInst :: FCMP_UNE ] = { { RTLIB :: UNE_F32 , CmpInst :: ICMP_EQ } } ; FCmp32Libcalls [ CmpInst :: FCMP_UNO ] = { { RTLIB :: UO_F32 , CmpInst :: BAD_ICMP_PREDICATE } } ; FCmp32Libcalls [ CmpInst :: FCMP_ONE ] = { { RTLIB :: OGT_F32 , CmpInst :: BAD_ICMP_PREDICATE } , { RTLIB :: OLT_F32 , CmpInst :: BAD_ICMP_PREDICATE } } ; FCmp32Libcalls [ CmpInst :: FCMP_UEQ ] = { { RTLIB :: OEQ_F32 , CmpInst :: BAD_ICMP_PREDICATE } , { RTLIB :: UO_F32 , CmpInst :: BAD_ICMP_PREDICATE } } ; FCmp64Libcalls . resize ( CmpInst :: LAST_FCMP_PREDICATE + <NUM_LIT> ) ; FCmp64Libcalls [ CmpInst :: FCMP_OEQ ] = { { RTLIB :: OEQ_F64 , CmpInst :: BAD_ICMP_PREDICATE } } ; FCmp64Libcalls [ CmpInst :: FCMP_OGE ] = { { RTLIB :: OGE_F64 , CmpInst :: BAD_ICMP_PREDICATE } } ; FCmp64Libcalls [ CmpInst :: FCMP_OGT ] = { { RTLIB :: OGT_F64 , CmpInst :: BAD_ICMP_PREDICATE } } ; FCmp64Libcalls [ CmpInst :: FCMP_OLE ] = { { RTLIB :: OLE_F64 , CmpInst :: BAD_ICMP_PREDICATE } } ; FCmp64Libcalls [ CmpInst :: FCMP_OLT ] = { { RTLIB :: OLT_F64 , CmpInst :: BAD_ICMP_PREDICATE } } ; FCmp64Libcalls [ CmpInst :: FCMP_ORD ] = { { RTLIB :: UO_F64 , CmpInst :: ICMP_EQ } } ; FCmp64Libcalls [ CmpInst :: FCMP_UGE ] = { { RTLIB :: OLT_F64 , CmpInst :: ICMP_EQ } } ; FCmp64Libcalls [ CmpInst :: FCMP_UGT ] = { { RTLIB :: OLE_F64 , CmpInst :: ICMP_EQ } } ; FCmp64Libcalls [ CmpInst :: FCMP_ULE ] = { { RTLIB :: OGT_F64 , CmpInst :: ICMP_EQ } } ; FCmp64Libcalls [ CmpInst :: FCMP_ULT ] = { { RTLIB :: OGE_F64 , CmpInst :: ICMP_EQ } } ; FCmp64Libcalls [ CmpInst :: FCMP_UNE ] = { { RTLIB :: UNE_F64 , CmpInst ::


<s> FCmp32Libcalls [ CmpInst :: FCMP_OEQ ] = { { RTLIB :: OEQ_F32 , CmpInst :: ICMP_EQ } } ; FCmp32Libcalls [ CmpInst :: FCMP_OGE ] = { { RTLIB :: OGE_F32 , CmpInst :: ICMP_SGE } } ; FCmp32Libcalls [ CmpInst :: FCMP_OGT ] = { { RTLIB :: OGT_F32 , CmpInst :: ICMP_SGT } } ; FCmp32Libcalls [ CmpInst :: FCMP_OLE ] = { { RTLIB :: OLE_F32 , CmpInst :: ICMP_SLE } } ; FCmp32Libcalls [ CmpInst :: FCMP_OLT ] = { { RTLIB :: OLT_F32 , CmpInst :: ICMP_SLT } } ; FCmp32Libcalls [ CmpInst :: FCMP_ORD ] = { { RTLIB :: UO_F32 , CmpInst :: ICMP_EQ } } ; FCmp32Libcalls [ CmpInst :: FCMP_UGE ] = { { RTLIB :: OLT_F32 , CmpInst :: ICMP_SGE } } ; FCmp32Libcalls [ CmpInst :: FCMP_UGT ] = { { RTLIB :: OLE_F32 , CmpInst :: ICMP_SGT } } ; FCmp32Libcalls [ CmpInst :: FCMP_ULE ] = { { RTLIB :: OGT_F32 , CmpInst :: ICMP_SLE } } ; FCmp32Libcalls [ CmpInst :: FCMP_ULT ] = { { RTLIB :: OGE_F32 , CmpInst :: ICMP_SLT } } ; FCmp32Libcalls [ CmpInst :: FCMP_UNE ] = { { RTLIB :: UNE_F32 , CmpInst :: ICMP_NE } } ; FCmp32Libcalls [ CmpInst :: FCMP_UNO ] = { { RTLIB :: UO_F32


<s> FCmp32Libcalls [ CmpInst :: FCMP_ORD ] = { { RTLIB :: UO_F32 , CmpInst :: ICMP_EQ } } ; FCmp32Libcalls [ CmpInst :: FCMP_UGE ] = { { RTLIB :: OLT_F32 , CmpInst :: ICMP_SGE } } ; FCmp32Libcalls [ CmpInst :: FCMP_UGT ] = { { RTLIB :: OLE_F32 , CmpInst :: ICMP_SGT } } ; FCmp32Libcalls [ CmpInst :: FCMP_ULE ] = { { RTLIB :: OGT_F32 , CmpInst :: ICMP_SLE } } ; FCmp32Libcalls [ CmpInst :: FCMP_ULT ] = { { RTLIB :: OGE_F32 , CmpInst :: ICMP_SLT } } ; FCmp32Libcalls [ CmpInst :: FCMP_UNE ] = { { RTLIB :: UNE_F32 , CmpInst :: ICMP_NE } } ; FCmp32Libcalls [ CmpInst :: FCMP_UNO ] = { { RTLIB :: UO_F32 , CmpInst :: ICMP_NE } } ; FCmp32Libcalls [ CmpInst :: FCMP_ONE ] = { { RTLIB :: OGT_F32 , CmpInst :: ICMP_SGT } , { RTLIB :: OLT_F32 , CmpInst :: ICMP_SLT } } ; FCmp32Libcalls [ CmpInst :: FCMP_UEQ ] = { { RTLIB :: OEQ_F32 , CmpInst :: ICMP_EQ } , { RTLIB :: UO_F32 , CmpInst :: ICMP_NE } } ; FCmp64Libcalls . resize ( CmpInst :: LAST_FCMP_PREDICATE + <NUM_LIT> ) ; FCmp64Libcalls [ CmpInst :: FCMP_OEQ ] = { { RTLIB :: OEQ_F64 , CmpInst :: ICMP_EQ } } ; FCmp64Libcalls [ CmpInst :: FCMP_OGE ] = { { RTLIB :: OGE_F64 , CmpInst :: ICMP_SGE } } ; FCmp64Libcalls [ CmpInst :: FCMP_OGT ] = { { RTLIB :: OGT_F64 , CmpInst :: ICMP_SGT } } ; FCmp64Libcalls [ CmpInst :: FCMP_OLE ] = { { RTLIB :: OLE_F64 , CmpInst :: ICMP_SLE } } ; FCmp64Libcalls [ CmpInst :: FCMP_OLT ] = { { RTLIB :: OLT_F64 , CmpInst :: ICMP_SLT } } ; FCmp64Libcalls [ CmpInst :: FCMP_ORD ] = { { RTLIB :: UO_F64 , CmpInst :: ICMP_EQ } } ; FCmp64Libcalls [ CmpInst :: FCMP_UGE ] = { { RTLIB


<s> LegacyLegalizerInfo :: SizeAndActionsVec result = { { <NUM_LIT> , LegacyLegalizeActions :: Unsupported } , { <NUM_LIT> , LegacyLegalizeActions :: WidenScalar } , { <NUM_LIT> , LegacyLegalizeActions :: Unsupported } , { <NUM_LIT> , LegacyLegalizeActions :: WidenScalar } , { <NUM_LIT> , LegacyLegalizeActions :: Unsupported } } ; addAndInterleaveWithUnsupported ( result , v ) ; auto Largest = result . back ( ) . first ; result . push_back ( { Largest + <NUM_LIT> , LegacyLegalizeActions :: Unsupported } ) ; return


<s> { <NUM_LIT> , LegacyLegalizeActions :: Unsupported } , { <NUM_LIT> , LegacyLegalizeActions :: WidenScalar } , { <NUM_LIT> , LegacyLegalizeActions :: Unsupported } , { <NUM_LIT> , LegacyLegalizeActions :: WidenScalar } , { <NUM_LIT> , LegacyLegalizeActions :: Unsupported } } ; addAndInterleaveWithUnsupported ( result , v ) ; auto Largest = result . back ( ) . first ; result . push_back ( { Largest + <NUM_LIT> , LegacyLegalizeActions :: Unsupported } ) ; return result


<s> auto & Ctx = MIRBuilder . getMF ( ) . getFunction ( ) -> getContext ( ) ; assert ( ( OpSize == <NUM_LIT> || OpSize == <NUM_LIT> ) && <STR_LIT> ) ; auto * ArgTy = OpSize == <NUM_LIT> ? Type :: getFloatTy ( Ctx ) : Type :: getDoubleTy ( Ctx ) ; auto * RetTy = Type :: getInt32Ty ( Ctx ) ; SmallVector < unsigned , <NUM_LIT> > Results ; for ( auto Libcall : Libcalls ) { auto LibcallResult = MRI . createGenericVirtualRegister ( LLT :: scalar ( <NUM_LIT> ) ) ; auto Status = createLibcall ( MIRBuilder , Libcall . LibcallID , { LibcallResult , RetTy } , { { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy } , { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy } } ) ; if ( Status != LegalizerHelper :: Legalized ) return false ; auto ProcessedResult = Libcalls . size ( ) == <NUM_LIT> ? OriginalResult : MRI . createGenericVirtualRegister ( MRI . getType ( OriginalResult ) ) ; CmpInst :: Predicate ResultPred = Libcall . Predicate ; if ( ResultPred == CmpInst :: BAD_ICMP_PREDICATE ) { MIRBuilder . buildTrunc ( ProcessedResult , LibcallResult ) ; } else { assert ( CmpInst :: isIntPredicate ( ResultPred ) && <STR_LIT> ) ; auto Zero = MRI . createGenericVirtualRegister ( LLT :: scalar ( <NUM_LIT> ) ) ; MIRBuilder . buildConstant ( Zero , <NUM_LIT> ) ; MIRBuilder . buildICmp ( ResultPred , ProcessedResult , LibcallResult , Zero ) ; } Results . push_back ( ProcessedResult ) ; } if ( Results . size (


<s> Type * ArgTy = Type :: getInt32Ty ( Ctx ) ; StructType * RetTy = StructType :: get ( Ctx , { ArgTy , ArgTy } , true ) ; auto RetVal = MRI . createGenericVirtualRegister ( getLLTForType ( * RetTy , MIRBuilder . getMF ( ) . getDataLayout ( ) ) ) ; auto Status = createLibcall ( MIRBuilder , Libcall , { RetVal , RetTy } , { { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy } , { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy } } ) ; if ( Status != LegalizerHelper :: Legalized ) return false ; MIRBuilder . buildUnmerge ( { MRI . createGenericVirtualRegister ( LLT :: scalar ( <NUM_LIT> ) ) , OriginalResult } , RetVal ) ; break ; } case G_FCMP : { assert ( MRI . getType ( MI . getOperand ( <NUM_LIT> ) . getReg ( ) ) == MRI . getType ( MI . getOperand ( <NUM_LIT> ) . getReg ( ) ) && <STR_LIT> ) ; auto OpSize = MRI . getType ( MI . getOperand ( <NUM_LIT> ) . getReg ( ) ) . getSizeInBits ( ) ; auto OriginalResult = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; auto Predicate = static_cast < CmpInst :: Predicate > ( MI . getOperand ( <NUM_LIT> ) . getPredicate ( ) ) ; auto Libcalls = getFCmpLibcalls ( Predicate , OpSize ) ; if ( Libcalls . empty ( ) ) { assert ( ( Predicate == CmpInst :: FCMP_TRUE || Predicate == CmpInst :: FCMP_FALSE ) && <STR_LIT> ) ; MIRBuilder . buildConstant ( OriginalResult , Predicate == CmpInst :: FCMP_TRUE ? <NUM_LIT> : <NUM_LIT> ) ; MI . eraseFromParent ( ) ; return true ; } auto & Ctx = MIRBuilder . getMF ( ) . getFunction ( ) -> getContext ( ) ; assert ( ( OpSize == <NUM_LIT> || OpSize == <NUM_LIT> ) && <STR_LIT> ) ; auto * ArgTy = OpSize == <NUM_LIT> ? Type :: getFloatTy ( Ctx ) : Type :: getDoubleTy ( Ctx ) ; auto * RetTy = Type :: getInt32Ty ( Ctx ) ; SmallVector < unsigned , <NUM_LIT> > Results ; for ( auto Libcall : Libcalls ) { auto LibcallResult = MRI . createGenericVirtualRegister ( LLT :: scalar ( <NUM_LIT> ) ) ; auto Status = createLibcall ( MIRBuilder , Libcall . LibcallID , { LibcallResult , RetTy } , { { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy } , { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy } } ) ; if ( Status != LegalizerHelper :: Legalized ) return false ; auto ProcessedResult = Libcalls . size ( ) == <NUM_LIT> ? OriginalResult : MRI

. createGenericVirtualRegister ( MRI . getType ( OriginalResult ) ) ;


<s> for ( unsigned Op : { G_SDIV , G_UDIV } ) { for ( auto Ty : { s8 , s16 } ) setAction ( { Op , Ty } , WidenScalar ) ; if ( ST . hasDivideIn<ISA_LIT>Mode ( ) ) setAction ( { Op , s32 } , Legal ) ; else setAction ( { Op , s32 } , Libcall ) ; } for ( unsigned Op : { G_SREM , G_UREM } ) if ( ST . hasDivideIn<ISA_LIT>Mode ( ) ) setAction ( { Op , s32 } , Lower ) ; else if ( AEABI ( ST ) ) setAction ( { Op , s32 } , Custom ) ; else setAction ( { Op , s32 } , Libcall ) ; for ( unsigned Op : { G_SEXT , G_ZEXT } ) { setAction ( { Op , s32 } , Legal ) ; for ( auto Ty : { s1 , s8 , s16 } ) setAction ( { Op , <NUM_LIT> , Ty } , Legal ) ; } setAction ( { G_GEP , p0 } , Legal ) ; setAction ( { G_GEP , <NUM_LIT> , s32 } , Legal ) ; setAction ( { G_SELECT , s32 } , Legal ) ; setAction ( { G_SELECT , p0 } , Legal ) ; setAction ( { G_SELECT , <NUM_LIT> , s1 } , Legal ) ; setAction ( { G_BRCOND , s1 } , Legal ) ; setAction ( { G_CONSTANT , s32 } , Legal ) ; for ( auto Ty : { s1 , s8 , s16 } ) setAction ( { G_CONSTANT , Ty } , WidenScalar ) ; setAction ( { G_ICMP , s1 } , Legal ) ; for ( auto Ty : { s8 , s16 } ) setAction ( { G_ICMP , <NUM_LIT> , Ty } , WidenScalar ) ; for ( auto Ty : { s32 , p0 } ) setAction ( { G_ICMP , <NUM_LIT> , Ty } , Legal ) ; if ( ! ST . useSoftFloat ( ) && ST . hasVFP2 ( ) ) { setAction ( { G_FADD , s32 } , Legal ) ; setAction ( { G_FADD , s64 } , Legal ) ; setAction ( { G_LOAD , s64 } , Legal ) ; setAction ( { G_STORE , s64 } , Legal ) ; setAction ( { G_FCMP , s1 } , Legal ) ; setAction ( { G_FCMP , <NUM_LIT> , s32 } , Legal ) ; setAction ( { G_FCMP , <NUM_LIT> , s64 } , Legal ) ; } else { for ( auto Ty : { s32 , s64 } ) setAction ( { G_FADD , Ty } , Libcall ) ; setAction ( { G_FCMP , s1 } , Legal ) ; setAction ( { G_FCMP , <NUM_LIT> , s32 } , Custom ) ; setAction ( { G_FCMP , <NUM_LIT> , s64 } ,


<s> for ( unsigned Op : { G_ADD , G_SUB , G_MUL } ) for ( auto Ty : { s1 , s8 , s16 , s32 } ) setAction ( { Op , Ty } , Legal ) ; for ( unsigned Op : { G_SDIV , G_UDIV } ) { for ( auto Ty : { s8 , s16 } ) setAction ( { Op , Ty } , Custom ) ; if ( ST . hasDivideIn<ISA_LIT>Mode ( ) ) setAction ( { Op , s32 } , Legal ) ; else setAction ( { Op , s32 } , Libcall ) ; } for ( unsigned Op : { G_SEXT , G_ZEXT } ) { setAction ( { Op , s32 } , Legal ) ; for ( auto Ty : { s1 , s8 , s16 } ) setAction ( { Op , <NUM_LIT> , Ty } , Legal ) ; } setAction ( { G_GEP , p0 } , Legal ) ; setAction ( { G_GEP , <NUM_LIT> , s32 } , Legal ) ; setAction ( { G_CONSTANT , s32 } , Legal ) ; if ( ! ST . useSoftFloat ( ) && ST . hasVFP2 ( ) ) { setAction ( { G_FADD , s32 } , Legal ) ; setAction ( { G_FADD , s64 } , Legal ) ; setAction ( { G_LOAD , s64 } , Legal ) ; setAction ( { G_STORE , s64 } , Legal ) ; } else


<s> else setAction ( { Op , s32 } , Libcall ) ; } for ( unsigned Op : { G_SEXT , G_ZEXT } ) { setAction ( { Op , s32 } , Legal ) ; for ( auto Ty : { s1 , s8 , s16 } ) setAction ( { Op , <NUM_LIT> , Ty } , Legal ) ; } setAction ( { G_GEP , p0 } , Legal ) ; setAction ( { G_GEP , <NUM_LIT> , s32 } , Legal ) ; setAction ( { G_CONSTANT , s32 } , Legal ) ; if ( ! ST . useSoftFloat ( ) && ST . hasVFP2 ( ) ) { setAction ( { G_FADD , s32 } , Legal ) ; setAction ( { G_FADD , s64 } , Legal ) ; setAction ( { G_LOAD , s64


<s> LegalizerHelper Helper ( MIRBuilder . getMF ( ) ) ; MachineInstr * NewMI = nullptr ; Helper . MIRBuilder . recordInsertions ( [ & ] ( MachineInstr * MI ) { if ( MI -> getOpcode ( ) == G_SDIV || MI -> getOpcode ( ) == G_UDIV ) NewMI = MI ; } ) ; auto Result = Helper . widenScalar ( MI , <NUM_LIT> , LLT :: scalar ( <NUM_LIT> ) ) ; Helper . MIRBuilder . stopRecordingInsertions ( ) ; if ( Result == LegalizerHelper :: UnableToLegalize ) { return false ; } assert ( NewMI && <STR_LIT> ) ; assert ( ( NewMI -> getOpcode ( ) == G_SDIV || NewMI -> getOpcode ( ) == G_UDIV ) && <STR_LIT> ) ; assert ( MRI . getType ( NewMI -> getOperand ( <NUM_LIT> ) . getReg (

) ) . getSizeInBits ( ) == <NUM_LIT> && <STR_LIT> ) ;


<s> if ( ! ST . useSoftFloat ( ) && ST . hasVFP2Base ( ) ) { getActionDefinitionsBuilder ( { G_FADD , G_FSUB , G_FMUL , G_FDIV , G_FCONSTANT , G_FNEG } ) . legalFor ( { s32 , s64 } ) ; LoadStoreBuilder . legalForTypesWithMemDesc ( { { s64 , p0 , <NUM_LIT> , <NUM_LIT> } } ) . maxScalar ( <NUM_LIT> , s32 ) ; PhiBuilder . legalFor ( { s64 } ) ; getActionDefinitionsBuilder ( G_FCMP ) . legalForCartesianProduct ( { s1 } , { s32 , s64 } ) ; getActionDefinitionsBuilder ( G_MERGE_VALUES ) . legalFor ( { { s64 , s32 } } ) ; getActionDefinitionsBuilder ( G_UNMERGE_VALUES ) . legalFor ( { { s32 , s64 } } ) ; getActionDefinitionsBuilder ( G_FPEXT ) . legalFor ( { { s64 , s32 } } ) ; getActionDefinitionsBuilder ( G_FPTRUNC ) . legalFor ( { { s32 , s64 } } ) ; getActionDefinitionsBuilder ( { G_FPTOSI , G_FPTOUI } ) . legalForCartesianProduct ( { s32 } , { s32 , s64 } ) ; getActionDefinitionsBuilder ( { G_SITOFP , G_UITOFP } ) . legalForCartesianProduct ( { s32 , s64 } , { s32 } ) ; } else { getActionDefinitionsBuilder ( { G_FADD , G_FSUB , G_FMUL , G_FDIV } ) . libcallFor ( { s32 , s64 } ) ; LoadStoreBuilder . maxScalar ( <NUM_LIT> , s32 ) ; for ( auto Ty : { s32 , s64 } ) setAction ( { G_FNEG , Ty } , Lower ) ; getActionDefinitionsBuilder ( G_FCONSTANT ) . customFor ( { s32 , s64 } ) ; getActionDefinitionsBuilder ( G_FCMP ) . customForCartesianProduct ( { s1 } , { s32 , s64 } ) ; if ( AEABI ( ST ) ) setFCmpLibcallsAEABI ( ) ; else setFCmpLibcallsGNU ( ) ; getActionDefinitionsBuilder ( G_FPEXT ) . libcallFor ( { { s64 , s32 } } ) ; getActionDefinitionsBuilder ( G_FPTRUNC ) . libcallFor ( { { s32 , s64 } } ) ; getActionDefinitionsBuilder ( { G_FPTOSI , G_FPTOUI } ) . libcallForCartesianProduct ( { s32 } , { s32 , s64 } ) ; getActionDefinitionsBuilder ( { G_SITOFP , G_UITOFP } ) . libcallForCartesianProduct ( { s32 , s64 } , { s32 } ) ; } if ( ! ST . useSoftFloat ( ) && ST . hasVFP4Base ( ) ) getActionDefinitionsBuilder ( G_FMA ) . legalFor ( { s32 , s64 } ) ; else getActionDefinitionsBuilder ( G_FMA ) . libcallFor ( { s32 , s64 } ) ; getActionDefinitionsBuilder ( { G_FREM , G_FPOW } ) .


<s> case G_FCMP : { assert ( MRI . getType ( MI . getOperand ( <NUM_LIT> ) . getReg ( ) ) == MRI . getType ( MI . getOperand ( <NUM_LIT> ) . getReg ( ) ) && <STR_LIT> ) ; auto OpSize = MRI . getType ( MI . getOperand ( <NUM_LIT> ) . getReg ( ) ) . getSizeInBits ( ) ; auto OriginalResult = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; auto Predicate = static_cast < CmpInst :: Predicate > ( MI . getOperand ( <NUM_LIT> ) . getPredicate ( ) ) ; auto Libcalls = getFCmpLibcalls ( Predicate , OpSize ) ; if ( Libcalls . empty ( ) ) { assert ( ( Predicate == CmpInst :: FCMP_TRUE || Predicate == CmpInst :: FCMP_FALSE ) && <STR_LIT> ) ; MIRBuilder . buildConstant ( OriginalResult , Predicate == CmpInst :: FCMP_TRUE ? <NUM_LIT> : <NUM_LIT> ) ; MI . eraseFromParent ( ) ; return true ; } auto & Ctx = MIRBuilder . getMF ( ) . getFunction ( ) . getContext ( ) ; assert ( ( OpSize == <NUM_LIT> || OpSize == <NUM_LIT> ) && <STR_LIT> ) ; auto * ArgTy = OpSize == <NUM_LIT> ? Type :: getFloatTy ( Ctx ) : Type :: getDoubleTy ( Ctx ) ; auto * RetTy = Type :: getInt32Ty ( Ctx ) ; SmallVector < unsigned , <NUM_LIT> > Results ; for ( auto Libcall : Libcalls ) { auto LibcallResult = MRI . createGenericVirtualRegister ( LLT :: scalar ( <NUM_LIT> ) ) ; auto Status = createLibcall ( MIRBuilder , Libcall . LibcallID , { LibcallResult , RetTy } , { { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy } , { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy } } ) ; if ( Status != LegalizerHelper :: Legalized ) return false ; auto ProcessedResult = Libcalls . size ( ) == <NUM_LIT> ? OriginalResult : MRI . createGenericVirtualRegister ( MRI . getType ( OriginalResult ) ) ; CmpInst :: Predicate ResultPred = Libcall . Predicate ; if ( ResultPred == CmpInst :: BAD_ICMP_PREDICATE ) { MIRBuilder . buildTrunc ( ProcessedResult , LibcallResult ) ; } else { assert ( CmpInst :: isIntPredicate ( ResultPred ) && <STR_LIT> ) ; auto Zero = MRI . createGenericVirtualRegister ( LLT :: scalar ( <NUM_LIT> ) ) ; MIRBuilder . buildConstant ( Zero , <NUM_LIT> ) ; MIRBuilder . buildICmp ( ResultPred , ProcessedResult , LibcallResult , Zero ) ; } Results . push_back ( ProcessedResult ) ; } if ( Results . size ( ) != <NUM_LIT> ) { assert ( Results . size ( ) == <NUM_LIT> && <STR_LIT> ) ; MIRBuilder . buildOr ( OriginalResult , Results [ <NUM_LIT> ] , Results [ <NUM_LIT> ] ) ; } break ; } } MI . eraseFromParent (


<s> assert ( v . size ( ) >= <NUM_LIT> ) ; assert ( v [ <NUM_LIT> ] . first > <NUM_LIT> ) ; LegalizerInfo :: SizeAndActionsVec result = { { <NUM_LIT> , LegalizerInfo :: WidenScalar } , { <NUM_LIT> , LegalizerInfo :: Unsupported } , { <NUM_LIT> , LegalizerInfo :: WidenScalar } , { <NUM_LIT> , LegalizerInfo :: Unsupported } , { <NUM_LIT> , LegalizerInfo :: WidenScalar } , { <NUM_LIT> , LegalizerInfo :: Unsupported } } ; addAndInterleaveWithUnsupported ( result , v ) ; auto Largest = result . back ( ) . first ; result . push_back ( { Largest + <NUM_LIT> ,


<s> { <NUM_LIT> , LegalizerInfo :: WidenScalar } , { <NUM_LIT> , LegalizerInfo :: Unsupported } , { <NUM_LIT> , LegalizerInfo :: WidenScalar } , { <NUM_LIT> , LegalizerInfo :: Unsupported } , { <NUM_LIT> , LegalizerInfo :: WidenScalar } , { <NUM_LIT> , LegalizerInfo :: Unsupported } } ; addAndInterleaveWithUnsupported ( result


<s> const LLT s16 = LLT :: scalar ( <NUM_LIT> ) ; const LLT s32 = LLT :: scalar ( <NUM_LIT> ) ; const LLT s64 = LLT :: scalar ( <NUM_LIT> ) ; setAction ( { G_FRAME_INDEX , p0 } , Legal ) ; for ( unsigned Op : { G_LOAD , G_STORE } ) { for ( auto Ty : { s1 , s8 , s16 , s32 , p0 } ) setAction ( { Op , Ty } , Legal ) ; setAction ( { Op , <NUM_LIT> , p0 } , Legal ) ; } for ( auto Ty : { s1 , s8 , s16 , s32 } ) setAction ( { G_ADD , Ty } , Legal ) ; for ( unsigned Op : { G_SEXT , G_ZEXT } ) { setAction ( { Op , s32 } , Legal ) ; for ( auto Ty : { s1 , s8 , s16 } ) setAction ( { Op , <NUM_LIT> , Ty } , Legal ) ; } setAction ( { G_GEP , p0 } , Legal ) ; setAction ( { G_GEP , <NUM_LIT> , s32 } , Legal ) ; setAction ( { G_CONSTANT , s32 } , Legal ) ; if ( ! ST . useSoftFloat ( ) && ST . hasVFP2 ( ) ) { setAction ( { G_FADD , s32 } , Legal


<s> getActionDefinitionsBuilder ( G_ICMP ) . legalForCartesianProduct ( { s1 } , { s32 , p0 } ) . minScalar ( <NUM_LIT> , s32 ) ; getActionDefinitionsBuilder ( G_SELECT ) . legalForCartesianProduct ( { s32 , p0 } , { s1 } ) ; auto & LoadStoreBuilder = getActionDefinitionsBuilder ( { G_LOAD , G_STORE } ) . legalForTypesWithMemDesc ( { { s1 , p0 , <NUM_LIT> , <NUM_LIT> } , { s8 , p0 , <NUM_LIT> , <NUM_LIT> } , { s16 , p0 , <NUM_LIT> , <NUM_LIT> } , { s32 , p0 , <NUM_LIT> , <NUM_LIT> } , { p0 , p0 , <NUM_LIT> , <NUM_LIT> } } ) . unsupportedIfMemSizeNotPow2 ( ) ; getActionDefinitionsBuilder ( G_FRAME_INDEX ) . legalFor ( { p0 } ) ; getActionDefinitionsBuilder ( G_GLOBAL_VALUE ) . legalFor ( { p0 } ) ; auto & PhiBuilder = getActionDefinitionsBuilder ( G_PHI ) . legalFor ( { s32 , p0 } ) . minScalar ( <NUM_LIT> , s32 ) ; getActionDefinitionsBuilder ( G_GEP ) . legalFor ( { { p0 , s32 } } ) ; getActionDefinitionsBuilder ( G_BRCOND ) . legalFor ( { s1 } ) ; if ( ! ST . useSoftFloat ( ) && ST . hasVFP2 ( ) ) { getActionDefinitionsBuilder ( { G_FADD , G_FSUB , G_FMUL , G_FDIV , G_FCONSTANT , G_FNEG } ) . legalFor ( { s32 , s64 } ) ; LoadStoreBuilder . legalForTypesWithMemDesc ( { { s64 , p0 , <NUM_LIT> , <NUM_LIT> } } ) . maxScalar ( <NUM_LIT> , s32 ) ; PhiBuilder . legalFor ( { s64 } ) ; getActionDefinitionsBuilder ( G_FCMP ) . legalForCartesianProduct ( { s1 } , { s32 , s64 } ) ; getActionDefinitionsBuilder ( G_MERGE_VALUES ) . legalFor ( { { s64 , s32 } } ) ; getActionDefinitionsBuilder ( G_UNMERGE_VALUES ) . legalFor ( { { s32 , s64 } } ) ; getActionDefinitionsBuilder ( G_FPEXT ) . legalFor ( { { s64 , s32 } } ) ; getActionDefinitionsBuilder ( G_FPTRUNC ) . legalFor ( { { s32 , s64 } } ) ; getActionDefinitionsBuilder ( { G_FPTOSI , G_FPTOUI } ) . legalForCartesianProduct ( { s32 } , { s32 , s64 } ) ; getActionDefinitionsBuilder ( { G_SITOFP , G_UITOFP } ) . legalForCartesianProduct ( { s32 , s64 } , { s32 } ) ; } else { getActionDefinitionsBuilder ( { G_FADD , G_FSUB , G_FMUL , G_FDIV } ) . libcallFor ( { s32 , s64 } ) ; LoadStoreBuilder . maxScalar ( <NUM_LIT> , s32 ) ; for ( auto Ty : { s32 , s64 } ) setAction ( { G_FNEG , Ty } , Lower ) ; getActionDefinitionsBuilder ( G_FCONSTANT ) . customFor ( { s32 , s64 } ) ; getActionDefinitionsBuilder ( G_FCMP ) . customForCartesianProduct ( { s1 } , { s32 , s64 } ) ; if ( AEABI ( ST ) ) setFCmpLibcallsAEABI ( ) ; else setFCmpLibcallsGNU (


<s> auto OpSize = MRI . getType ( MI . getOperand ( <NUM_LIT> ) . getReg ( ) ) . getSizeInBits ( ) ; auto OriginalResult = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; auto Predicate = static_cast < CmpInst :: Predicate > ( MI . getOperand ( <NUM_LIT> ) . getPredicate ( ) ) ; auto Libcalls = getFCmpLibcalls ( Predicate , OpSize ) ; if ( Libcalls . empty ( ) ) { assert ( ( Predicate == CmpInst :: FCMP_TRUE || Predicate == CmpInst :: FCMP_FALSE ) && <STR_LIT> ) ; MIRBuilder . buildConstant ( OriginalResult , Predicate == CmpInst :: FCMP_TRUE ? <NUM_LIT> : <NUM_LIT> ) ; MI . eraseFromParent ( ) ; return true ; } assert ( ( OpSize == <NUM_LIT> || OpSize == <NUM_LIT> ) && <STR_LIT> ) ; auto * ArgTy = OpSize == <NUM_LIT> ? Type :: getFloatTy ( Ctx ) : Type :: getDoubleTy ( Ctx ) ; auto * RetTy = Type :: getInt32Ty ( Ctx ) ; SmallVector < Register , <NUM_LIT> > Results ; for ( auto Libcall : Libcalls ) { auto LibcallResult = MRI . createGenericVirtualRegister ( LLT :: scalar ( <NUM_LIT> ) ) ; auto Status = createLibcall ( MIRBuilder , Libcall . LibcallID , { LibcallResult , RetTy } , { { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy } , { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy } } ) ; if ( Status != LegalizerHelper :: Legalized ) return false ; auto ProcessedResult = Libcalls . size ( ) == <NUM_LIT> ? OriginalResult : MRI . createGenericVirtualRegister ( MRI . getType ( OriginalResult ) ) ; CmpInst :: Predicate ResultPred = Libcall . Predicate ; if ( ResultPred == CmpInst :: BAD_ICMP_PREDICATE ) { MIRBuilder . buildTrunc ( ProcessedResult , LibcallResult ) ; } else { assert ( CmpInst :: isIntPredicate ( ResultPred ) && <STR_LIT> ) ; auto Zero = MRI . createGenericVirtualRegister ( LLT :: scalar ( <NUM_LIT> ) ) ; MIRBuilder . buildConstant ( Zero ,


<s> return true ; } assert ( ( OpSize == <NUM_LIT> || OpSize == <NUM_LIT> ) && <STR_LIT> ) ; auto * ArgTy = OpSize == <NUM_LIT> ? Type :: getFloatTy ( Ctx ) : Type :: getDoubleTy ( Ctx ) ; auto * RetTy = Type :: getInt32Ty ( Ctx ) ; SmallVector < Register , <NUM_LIT> > Results ; for ( auto Libcall : Libcalls ) { auto LibcallResult = MRI . createGenericVirtualRegister ( LLT :: scalar ( <NUM_LIT> ) ) ; auto Status = createLibcall ( MIRBuilder , Libcall . LibcallID , { LibcallResult , RetTy } , { { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy } , { MI . getOperand ( <NUM_LIT> ) . getReg ( ) , ArgTy } } ) ; if ( Status != LegalizerHelper :: Legalized ) return false ; auto ProcessedResult = Libcalls . size ( ) == <NUM_LIT> ? OriginalResult : MRI . createGenericVirtualRegister ( MRI . getType ( OriginalResult ) ) ; CmpInst :: Predicate ResultPred = Libcall . Predicate ; if ( ResultPred == CmpInst :: BAD_ICMP_PREDICATE ) { MIRBuilder . buildTrunc ( ProcessedResult , LibcallResult ) ; } else { assert ( CmpInst :: isIntPredicate ( ResultPred ) && <STR_LIT> ) ; auto Zero = MRI . createGenericVirtualRegister ( LLT :: scalar ( <NUM_LIT> ) ) ; MIRBuilder . buildConstant ( Zero , <NUM_LIT> ) ; MIRBuilder . buildICmp ( ResultPred , ProcessedResult , LibcallResult , Zero ) ; } Results . push_back ( ProcessedResult ) ; } if ( Results . size (