<s> static Target TheDirectXTarget ; return


<s> PM . add ( create<ISA_LIT>PrepareModulePass ( ) ) ; switch ( FileType ) { case CGFT_AssemblyFile : PM . add ( createPrintModulePass ( Out ,


<s> RegisterTargetMachine < DirectXTargetMachine > X ( getTheDirectXTarget ( ) ) ; auto * PR = PassRegistry ::


<s> RegisterTargetMachine < DirectXTargetMachine > X ( getTheDirectXTarget ( ) ) ; auto * PR = PassRegistry :: getPassRegistry ( ) ; initialize<ISA_LIT>PrepareModulePass ( *


<s> bool DirectXTargetMachine :: addPassesToEmitMC ( PassManagerBase & PM , MCContext * & Ctx , raw_pwrite_stream & Out ,


<s> FunctionPass * createTargetRegisterAllocator ( bool )


<s> FunctionPass * createTargetRegisterAllocator ( bool ) override { return nullptr


<s> return getTM < DirectXTargetMachine >


<s> DirectXTargetMachine & getDirectXTargetMachine ( ) const { return getTM < DirectXTargetMachine


<s> MCSection * getExplicitSectionGlobal ( const GlobalObject * GO , SectionKind Kind , const TargetMachine & TM ) const override { llvm_unreachable ( <STR_LIT>


<s> TargetLoweringObjectFile * getObjFileLowering ( ) const override { return TLOF . get (


<s> return TargetTransformInfo ( DirectXTTIImpl ( this


<s> TargetTransformInfo DirectXTargetMachine :: getTargetTransformInfo ( const Function & F )


<s> RegisterTargetMachine < DirectXTargetMachine > X (


<s> MCSection * SelectSectionForGlobal ( const GlobalObject * GO , SectionKind Kind , const TargetMachine & TM ) const override { llvm_unreachable ( <STR_LIT> )


<s> MCSection * SelectSectionForGlobal ( const GlobalObject * GO , SectionKind Kind ,

const TargetMachine & TM ) const override {


<s> const DirectXSubtarget * getST ( ) const { return ST


<s> void assignValueId ( GlobalValue :: GUID ValGUID


<s> void BitcodeWriter :: copyStrtab ( StringRef Strtab ) { writeBlob ( bitc :: STRTAB_BLOCK_ID , bitc :: STRTAB_BLOB , Strtab ) ; WroteStrtab =


<s> Abbv -> Add ( BitCodeAbbrevOp ( BitCodeAbbrevOp :: VBR , <NUM_LIT> ) ) ; Abbv -> Add ( BitCodeAbbrevOp ( BitCodeAbbrevOp :: Array ) ) ; Abbv -> Add ( BitCodeAbbrevOp ( BitCodeAbbrevOp :: VBR , <NUM_LIT> ) ) ; return Stream . EmitAbbrev ( std ::


<s> Abbv -> Add ( BitCodeAbbrevOp ( BitCodeAbbrevOp :: VBR , <NUM_LIT> ) ) ; Abbv -> Add ( BitCodeAbbrevOp ( BitCodeAbbrevOp :: Fixed , <NUM_LIT> ) ) ; Abbv -> Add ( BitCodeAbbrevOp ( BitCodeAbbrevOp :: VBR , <NUM_LIT> ) ) ; Abbv -> Add ( BitCodeAbbrevOp ( BitCodeAbbrevOp :: Array ) ) ; Abbv -> Add ( BitCodeAbbrevOp ( BitCodeAbbrevOp :: VBR , <NUM_LIT> )


<s> auto Abbv = std :: make_shared < BitCodeAbbrev > ( ) ; Abbv -> Add ( BitCodeAbbrevOp ( bitc :: METADATA_STRING_OLD ) ) ; Abbv -> Add ( BitCodeAbbrevOp ( BitCodeAbbrevOp :: Array )


<s> <ISA_LIT>BitcodeWriter ( const Module & M , SmallVectorImpl < char > & Buffer , StringTableBuilder & StrtabBuilder , BitstreamWriter & Stream ) : Stream ( Stream ) , StrtabBuilder ( StrtabBuilder ) , M ( M ) , VE ( M , true ) , Buffer ( Buffer ) , BitcodeStartBit ( Stream . GetCurrentBitNo ( ) ) { GlobalValueId = VE . getValues ( ) . size (


<s> <ISA_LIT>BitcodeWriter ( const Module & M , SmallVectorImpl < char > & Buffer , StringTableBuilder & StrtabBuilder , BitstreamWriter & Stream ) : Stream ( Stream ) , StrtabBuilder ( StrtabBuilder ) , M ( M )

, VE ( M , true ) , Buffer ( Buffer ) , BitcodeStartBit ( Stream . GetCurrentBitNo ( ) ) {


<s> void <ISA_LIT>BitcodeWriter :: emitSignedInt64 ( SmallVectorImpl < uint64_t >


<s> unsigned getEncodedAlign ( MaybeAlign Alignment ) { return encode (


<s> return bitc :: BINOP_ADD ; case Instruction :: Sub : case Instruction :: FSub : return bitc :: BINOP_SUB ; case Instruction :: Mul : case Instruction :: FMul : return bitc :: BINOP_MUL ; case Instruction :: UDiv : return bitc :: BINOP_UDIV ; case Instruction :: FDiv : case Instruction :: SDiv : return bitc


<s> case Instruction :: Mul : case Instruction :: FMul : return bitc :: BINOP_MUL ; case Instruction :: UDiv : return bitc :: BINOP_UDIV ; case Instruction :: FDiv : case Instruction :: SDiv : return bitc :: BINOP_SDIV ; case Instruction :: URem : return bitc :: BINOP_UREM ; case Instruction :: FRem : case Instruction :: SRem : return bitc :: BINOP_SREM ; case Instruction :: Shl : return bitc :: BINOP_SHL ; case Instruction :: LShr : return bitc :: BINOP_LSHR ; case Instruction :: AShr : return bitc :: BINOP_ASHR ; case Instruction :: And : return bitc :: BINOP_AND ; case Instruction :: Or : return bitc ::


<s> switch ( Opcode ) { default : llvm_unreachable ( <STR_LIT> ) ; case Instruction :: Trunc : return bitc :: CAST_TRUNC ; case Instruction :: ZExt : return bitc :: CAST_ZEXT ; case Instruction :: SExt : return bitc :: CAST_SEXT ; case Instruction :: FPToUI : return bitc


<s> unsigned <ISA_LIT>BitcodeWriter :: getEncodedCastOpcode ( unsigned Opcode ) { switch ( Opcode ) { default : llvm_unreachable ( <STR_LIT> ) ; case Instruction :: Trunc : return bitc :: CAST_TRUNC ; case Instruction :: ZExt : return bitc :: CAST_ZEXT ; case Instruction :: SExt : return bitc :: CAST_SEXT ; case Instruction :: FPToUI : return bitc :: CAST_FPTOUI ; case Instruction :: FPToSI : return bitc :: CAST_FPTOSI ; case Instruction :: UIToFP : return bitc :: CAST_UITOFP ; case Instruction :: SIToFP : return bitc :: CAST_SITOFP ; case Instruction :: FPTrunc : return bitc :: CAST_FPTRUNC ; case Instruction :: FPExt


<s> case Comdat :: Largest : return bitc :: COMDAT_SELECTION_KIND_LARGEST ; case Comdat :: NoDeduplicate : return bitc :: COMDAT_SELECTION_KIND_NO_DUPLICATES ; case Comdat ::


<s> unsigned <ISA_LIT>BitcodeWriter :: getEncodedDLLStorageClass ( const GlobalValue & GV ) { switch ( GV . getDLLStorageClass ( ) ) { case GlobalValue


<s> unsigned <ISA_LIT>BitcodeWriter :: getEncodedLinkage (


<s> case AtomicOrdering :: NotAtomic : return bitc :: ORDERING_NOTATOMIC ; case AtomicOrdering :: Unordered : return bitc :: ORDERING_UNORDERED ; case AtomicOrdering :: Monotonic : return bitc :: ORDERING_MONOTONIC ; case AtomicOrdering :: Acquire : return bitc :: ORDERING_ACQUIRE ; case AtomicOrdering :: Release : return bitc :: ORDERING_RELEASE ; case AtomicOrdering :: AcquireRelease : return bitc :: ORDERING_ACQREL ; case AtomicOrdering :: SequentiallyConsistent : return bitc :: ORDERING_SEQCST


<s> return bitc :: RMW_NAND ; case AtomicRMWInst :: Or : return bitc :: RMW_OR ; case AtomicRMWInst :: Xor : return bitc :: RMW_XOR ; case AtomicRMWInst :: Max : return bitc :: RMW_MAX ; case AtomicRMWInst :: Min : return bitc :: RMW_MIN ; case AtomicRMWInst :: UMax : return bitc :: RMW_UMAX ; case AtomicRMWInst :: UMin : return bitc ::


<s> unsigned getEncodedSyncScopeID ( SyncScope :: ID SSID ) { return unsigned ( SSID


<s> if ( ! VI . haveGVs ( ) || ! VI . getValue (

) ) return getValueId ( VI . getGUID ( ) ) ;


<s> unsigned ValID = VE . getValueID ( V ) ; Vals . push_back ( InstID -


<s> Vals . push_back ( VE . getTypeID ( V -> getType ( ) ) ) ; return true ; } return false


<s> void <ISA_LIT>BitcodeWriter :: pushValueSigned ( const Value * V , unsigned InstID , SmallVectorImpl


<s> static uint64_t rotateSign ( DISubrange :: BoundType Val ) { return rotateSign ( Val . get < ConstantInt * > ( ) -> getValue (


<s> std :: map < GlobalValue :: GUID , unsigned


<s> uint64_t Val = getAttrKindEncoding ( Attr . getKindAsEnum ( ) ) ; assert ( Val <= bitc :: ATTR_KIND_ARGMEMONLY && <STR_LIT> ) ; Record . push_back ( <NUM_LIT> ) ; Record . push_back ( Val ) ; Record . push_back ( Attr . getValueAsInt ( ) ) ; } else { StringRef Kind = Attr . getKindAsString ( ) ; StringRef Val = Attr . getValueAsString ( ) ; Record . push_back ( Val . empty ( ) ? <NUM_LIT> : <NUM_LIT> ) ; Record . append ( Kind . begin ( ) , Kind . end ( ) ) ; Record . push_back ( <NUM_LIT> ) ; if ( ! Val . empty ( ) ) { Record . append ( Val . begin ( ) , Val . end ( ) ) ; Record . push_back ( <NUM_LIT> ) ; } } } Stream . EmitRecord ( bitc :: PARAMATTR_GRP_CODE_ENTRY , Record ) ; Record . clear (


<s> Record . push_back ( VE . getAttributeGroupID ( Pair ) ) ; Record . push_back ( AttrListIndex ) ; for ( Attribute Attr : AS ) { if ( Attr . isEnumAttribute ( ) ) { uint64_t Val = getAttrKindEncoding ( Attr . getKindAsEnum ( ) ) ; assert ( Val <= bitc :: ATTR_KIND_ARGMEMONLY && <STR_LIT> ) ; Record . push_back ( <NUM_LIT> ) ; Record . push_back ( Val ) ; } else if ( Attr . isIntAttribute ( ) ) { uint64_t Val = getAttrKindEncoding ( Attr . getKindAsEnum ( ) ) ; assert ( Val <= bitc :: ATTR_KIND_ARGMEMONLY && <STR_LIT> ) ; Record . push_back ( <NUM_LIT> ) ; Record . push_back ( Val ) ; Record . push_back ( Attr . getValueAsInt ( ) ) ; } else { StringRef Kind = Attr . getKindAsString ( ) ; StringRef Val = Attr . getValueAsString ( ) ; Record . push_back ( Val . empty ( ) ? <NUM_LIT> :


<s> const std :: vector < AttributeList > & Attrs = VE . getAttributeLists ( ) ; if ( Attrs . empty ( ) ) return ; Stream . EnterSubblock ( bitc :: PARAMATTR_BLOCK_ID , <NUM_LIT> ) ; SmallVector < uint64_t , <NUM_LIT> > Record ; for ( unsigned i = <NUM_LIT> , e = Attrs . size ( ) ; i != e ; ++ i ) { AttributeList AL = Attrs [ i ] ; for ( unsigned i : AL . indexes ( ) ) { AttributeSet AS = AL . getAttributes ( i ) ; if ( AS . hasAttributes ( ) ) Record . push_back ( VE . getAttributeGroupID ( { i , AS } ) ) ; } Stream . EmitRecord ( bitc :: PARAMATTR_CODE_ENTRY , Record ) ; Record . clear


<s> Abbv -> Add ( BitCodeAbbrevOp ( Record ) ) ; Abbv -> Add ( BitCodeAbbrevOp ( BitCodeAbbrevOp :: Blob ) ) ; auto AbbrevNo = Stream -> EmitAbbrev ( std


<s> assert ( isUInt < <NUM_LIT> > ( Size ) ) ; Vals . push_back ( Size ) ; for ( char Chr : C -> getName ( ) ) Vals . push_back ( ( unsigned char ) Chr ) ; Stream . EmitRecord ( bitc :: MODULE_CODE_COMDAT , Vals , <NUM_LIT> ) ; Vals . clear


<s> void writeDIArgList ( const DIArgList * N , SmallVectorImpl < uint64_t > & Record , unsigned Abbrev ) { llvm_unreachable ( <STR_LIT>


<s> Record . push_back ( N -> getAlignInBits ( ) ) ; Record . push_back ( N -> getEncoding ( ) ) ; Stream . EmitRecord ( bitc :: METADATA_BASIC_TYPE , Record , Abbrev ) ; Record . clear ( )


<s> void writeDICommonBlock ( const DICommonBlock * N , SmallVectorImpl < uint64_t > & Record ,


<s> void writeDICommonBlock ( const DICommonBlock * N , SmallVectorImpl < uint64_t > & Record , unsigned Abbrev ) { llvm_unreachable (


<s> Record . push_back ( VE . getMetadataOrNullID ( N -> getRetainedTypes ( ) . get ( ) ) ) ; Record . push_back ( <NUM_LIT> ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getGlobalVariables ( ) . get ( ) ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getImportedEntities ( ) . get ( ) ) ) ; Record . push_back ( N -> getDWOId


<s> Record . push_back ( N -> getLine ( ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getScope ( ) ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getBaseType ( ) ) ) ; Record . push_back ( N -> getSizeInBits ( ) ) ; Record . push_back ( N -> getAlignInBits ( ) ) ; Record . push_back ( N -> getOffsetInBits ( ) ) ; Record . push_back ( N -> getFlags ( ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getExtraData ( ) ) ) ; Stream . EmitRecord ( bitc :: METADATA_DERIVED_TYPE , Record , Abbrev ) ; Record . clear ( )


<s> Record . reserve ( N -> getElements ( ) . size ( ) + <NUM_LIT> ) ; Record . push_back ( N


<s> Record . reserve ( N -> getElements ( ) . size ( ) + <NUM_LIT> ) ; Record . push_back ( N -> isDistinct ( ) ) ; Record . append ( N -> elements_begin ( ) , N -> elements_end ( ) ) ; Stream . EmitRecord ( bitc :: METADATA_EXPRESSION , Record , Abbrev ) ; Record . clear (


<s> Record . push_back ( VE . getMetadataOrNullID ( N -> getRawDirectory ( ) ) ) ; Stream . EmitRecord ( bitc :: METADATA_FILE , Record , Abbrev


<s> Record . push_back ( VE . getMetadataOrNullID ( N -> getRawDirectory ( ) ) ) ; Stream . EmitRecord ( bitc :: METADATA_FILE ,


<s> void <ISA_LIT>BitcodeWriter :: writeDIGlobalVariable ( const DIGlobalVariable * N , SmallVectorImpl < uint64_t > & Record , unsigned Abbrev ) { Record . push_back ( N -> isDistinct ( ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getScope ( ) ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getRawName ( ) ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getRawLinkageName ( ) ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getFile ( ) ) ) ; Record . push_back ( N -> getLine ( ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N ->


<s> Record . push_back ( VE . getMetadataOrNullID ( N -> getRawName ( ) ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getRawLinkageName ( ) ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getFile ( ) ) ) ; Record . push_back ( N -> getLine ( ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getType ( ) ) ) ; Record . push_back ( N -> isLocalToUnit ( ) ) ; Record . push_back ( N -> isDefinition ( ) ) ; Record . push_back ( <NUM_LIT> ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getStaticDataMemberDeclaration ( ) ) ) ; Stream . EmitRecord ( bitc :: METADATA_GLOBAL_VAR , Record , Abbrev ) ; Record . clear


<s> void writeDIGlobalVariableExpression ( const DIGlobalVariableExpression * N , SmallVectorImpl < uint64_t > & Record , unsigned


<s> Record . push_back ( VE . getMetadataOrNullID ( N -> getEntity ( ) ) ) ; Record . push_back ( N -> getLine ( ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getRawName ( ) ) ) ; Stream . EmitRecord ( bitc :: METADATA_IMPORTED_ENTITY , Record


<s> void writeDILabel ( const DILabel * N , SmallVectorImpl < uint64_t > & Record , unsigned Abbrev ) { llvm_unreachable (


<s> Record . push_back ( N -> isDistinct ( ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getScope ( ) ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getFile ( ) ) ) ; Record . push_back ( N -> getLine ( )


<s> void <ISA_LIT>BitcodeWriter :: writeDILexicalBlockFile ( const DILexicalBlockFile * N , SmallVectorImpl < uint64_t > & Record , unsigned Abbrev ) { Record . push_back ( N ->


<s> void <ISA_LIT>BitcodeWriter :: writeDILexicalBlockFile ( const DILexicalBlockFile * N , SmallVectorImpl < uint64_t > & Record , unsigned Abbrev ) { Record . push_back ( N -> isDistinct ( ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getScope ( ) ) ) ; Record . push_back ( VE . getMetadataOrNullID (


<s> Record . push_back ( VE . getMetadataOrNullID ( N -> getFile ( ) ) ) ; Record . push_back ( N -> getLine ( ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getType ( ) ) ) ; Record . push_back ( N -> getArg ( ) ) ; Record . push_back ( N -> getFlags ( ) ) ; Stream . EmitRecord ( bitc :: METADATA_LOCAL_VAR , Record , Abbrev ) ; Record . clear


<s> Record . push_back ( VE . getMetadataID ( N -> getScope ( ) ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getInlinedAt ( ) ) ) ; Stream . EmitRecord ( bitc :: METADATA_LOCATION , Record , Abbrev ) ; Record . clear (


<s> void writeDIMacroFile ( const DIMacroFile * N , SmallVectorImpl < uint64_t


<s> for ( auto & I : N -> operands ( ) ) Record . push_back ( VE . getMetadataOrNullID ( I ) ) ; Stream . EmitRecord ( bitc :: METADATA_MODULE , Record , Abbrev


<s> Record . push_back ( VE . getMetadataOrNullID ( N -> getScope ( ) ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getFile ( ) ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getRawName ( ) ) ) ; Record . push_back ( <NUM_LIT> ) ; Stream . EmitRecord ( bitc :: METADATA_NAMESPACE , Record , Abbrev ) ; Record . clear


<s> void <ISA_LIT>BitcodeWriter :: writeDIObjCProperty ( const DIObjCProperty * N , SmallVectorImpl

< uint64_t > & Record , unsigned Abbrev ) {


<s> Record . push_back ( N -> getScopeLine ( ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getContainingType ( ) ) ) ; Record . push_back ( N -> getVirtuality ( ) ) ; Record . push_back ( N -> getVirtualIndex ( ) ) ; Record . push_back ( N -> getFlags ( ) ) ; Record . push_back ( N -> isOptimized ( ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getRawUnit ( ) ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getTemplateParams ( ) . get ( ) ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N


<s> void <ISA_LIT>BitcodeWriter :: writeDISubrange ( const DISubrange * N , SmallVectorImpl < uint64_t > & Record , unsigned Abbrev ) { Record . push_back ( N ->


<s> Record . push_back ( rotateSign ( N -> getLowerBound ( ) ) ) ; Stream . EmitRecord ( bitc :: METADATA_SUBRANGE , Record , Abbrev ) ; Record . clear ( )


<s> void <ISA_LIT>BitcodeWriter :: writeDISubroutineType ( const DISubroutineType * N , SmallVectorImpl < uint64_t > & Record , unsigned Abbrev ) { Record . push_back ( N ->


<s> void <ISA_LIT>BitcodeWriter :: writeDITemplateTypeParameter ( const DITemplateTypeParameter * N , SmallVectorImpl < uint64_t > & Record , unsigned Abbrev ) { Record . push_back ( N -> isDistinct ( ) ) ; Record . push_back ( VE . getMetadataOrNullID (


<s> void <ISA_LIT>BitcodeWriter :: writeDITemplateTypeParameter ( const DITemplateTypeParameter * N , SmallVectorImpl < uint64_t > & Record , unsigned Abbrev ) { Record . push_back ( N -> isDistinct ( ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getRawName ( ) ) ) ; Record . push_back ( VE . getMetadataOrNullID ( N -> getType ( ) )


<s> writeFunctionMetadata ( F ) ; unsigned InstID = CstEnd ; bool NeedsMetadataAttachment = F . hasMetadata ( ) ; DILocation * LastDL = nullptr ; for ( Function :: const_iterator BB = F . begin ( ) , E = F . end ( ) ; BB != E ; ++ BB ) for ( BasicBlock :: const_iterator I = BB -> begin ( ) , E = BB -> end ( ) ; I != E ; ++ I ) { writeInstruction ( * I , InstID , Vals ) ; if ( ! I -> getType ( ) -> isVoidTy ( ) ) ++ InstID ; NeedsMetadataAttachment |= I -> hasMetadataOtherThanDebugLoc ( ) ; DILocation * DL = I -> getDebugLoc ( ) ; if ( ! DL ) continue ; if ( DL == LastDL ) { Stream . EmitRecord ( bitc :: FUNC_CODE_DEBUG_LOC_AGAIN , Vals ) ; continue ; } Vals . push_back ( DL -> getLine ( ) ) ; Vals . push_back ( DL -> getColumn ( ) ) ; Vals . push_back ( VE . getMetadataOrNullID ( DL -> getScope ( ) ) ) ; Vals . push_back ( VE . getMetadataOrNullID ( DL -> getInlinedAt ( ) ) ) ; Stream . EmitRecord ( bitc :: FUNC_CODE_DEBUG_LOC , Vals ) ; Vals . clear ( ) ; LastDL = DL ; } if ( auto * Symtab = F . getValueSymbolTable ( ) ) writeFunctionLevelValueSymbolTable ( * Symtab ) ; if ( NeedsMetadataAttachment ) writeFunctionMetadataAttachment ( F ) ; if ( VE . shouldPreserveUseListOrder ( ) ) writeUseListBlock ( & F ) ; VE . purgeFunction (


<s> if ( isChar6 ) isChar6 = BitCodeAbbrevOp :: isChar6 ( * C ) ; if ( ( unsigned char ) * C & <NUM_LIT> ) { is7Bit = false ; break ; } } unsigned AbbrevToUse = VST_ENTRY_8_ABBREV ; unsigned Code ; if ( isa < BasicBlock > ( SI -> getValue ( ) ) ) { Code = bitc :: VST_CODE_BBENTRY ; if ( isChar6 ) AbbrevToUse = VST_BBENTRY_6_ABBREV ; } else { Code = bitc :: VST_CODE_ENTRY ; if ( isChar6 ) AbbrevToUse = VST_ENTRY_6_ABBREV ; else if ( is7Bit ) AbbrevToUse = VST_ENTRY_7_ABBREV ; } NameVals . push_back ( VE . getValueID ( SI -> getValue ( ) ) ) ; for ( const char * P = Name . getKeyData ( ) , *

E = Name . getKeyData ( ) + Name . getKeyLength ( ) ;


<s> writeMetadataStrings ( VE . getMDStrings ( ) , Record ) ; writeMetadataRecords ( VE . getNonMDStrings ( ) , Record


<s> void writeGenericDINode ( const GenericDINode * N , SmallVectorImpl < uint64_t > & Record , unsigned &


<s> void writeGenericDINode ( const GenericDINode * N , SmallVectorImpl < uint64_t > & Record , unsigned & Abbrev ) { llvm_unreachable ( <STR_LIT>


<s> void <ISA_LIT>BitcodeWriter :: writeMDTuple ( const MDTuple * N , SmallVectorImpl < uint64_t > & Record , unsigned Abbrev ) { for ( unsigned i = <NUM_LIT> , e = N -> getNumOperands ( ) ; i != e ; ++ i ) { Metadata * MD = N -> getOperand ( i ) ; assert ( ! ( MD && isa < LocalAsMetadata > ( MD ) ) && <STR_LIT> ) ; Record . push_back ( VE . getMetadataOrNullID ( MD ) ) ; } Stream . EmitRecord ( N -> isDistinct ( ) ? bitc :: METADATA_DISTINCT_NODE : bitc :: METADATA_NODE , Record , Abbrev ) ; Record . clear (


<s> void <ISA_LIT>BitcodeWriter :: writeMDTuple ( const MDTuple * N , SmallVectorImpl < uint64_t > & Record , unsigned Abbrev ) { for ( unsigned i = <NUM_LIT> , e = N -> getNumOperands ( ) ; i !=


<s> <ISA_LIT>BitcodeWriter ModuleWriter ( M , Buffer , StrtabBuilder , * Stream ) ; ModuleWriter . write


<s> std :: vector < uint64_t > IndexPos ; IndexPos . reserve ( VE . getNonMDStrings ( ) . size ( ) ) ; writeMetadataRecords ( VE . getNonMDStrings ( ) , Record , & MDAbbrevs , & IndexPos ) ; for ( const NamedMDNode & NMD : M . named_metadata ( ) ) { StringRef Str = NMD . getName ( ) ; Record . append ( Str . bytes_begin ( ) , Str . bytes_end ( ) ) ; Stream . EmitRecord ( bitc :: METADATA_NAME , Record , NameAbbrev ) ; Record . clear (


<s> SmallVector < uint64_t , <NUM_LIT> > Record ; SmallVector < StringRef , <NUM_LIT> > Names ; M . getMDKindNames ( Names ) ; if ( Names . empty ( ) ) return ; Stream . EnterSubblock ( bitc :: METADATA_BLOCK_ID , <NUM_LIT> ) ; for ( unsigned MDKindID = <NUM_LIT> , e = Names . size ( ) ; MDKindID != e ; ++ MDKindID ) { Record . push_back ( MDKindID ) ; StringRef KName = Names [ MDKindID ] ; Record . append ( KName . begin ( )


<s> Stream . EmitRecord ( bitc :: MODULE_CODE_VERSION , ArrayRef < unsigned


<s> writeBlob ( bitc :: STRTAB_BLOCK_ID , bitc :: STRTAB_BLOB , { Strtab . data ( ) , Strtab . size ( )


<s> assert ( ! WroteStrtab ) ; std :: vector < char > Strtab ; StrtabBuilder . finalizeInOrder ( ) ; Strtab . resize ( StrtabBuilder . getSize


<s> assert ( Order . Shuffle . size ( ) >= <NUM_LIT> && <STR_LIT> ) ; unsigned Code ; if ( isa < BasicBlock > ( Order . V ) ) Code = bitc :: USELIST_CODE_BB ; else Code = bitc :: USELIST_CODE_DEFAULT ; SmallVector < uint64_t , <NUM_LIT> > Record ( Order . Shuffle . begin ( ) , Order . Shuffle . end ( ) ) ; Record . push_back ( VE . getValueID ( Order . V ) ) ; Stream . EmitRecord ( Code , Record


<s> if ( isa < BasicBlock > ( Order . V ) ) Code = bitc :: USELIST_CODE_BB ; else Code = bitc :: USELIST_CODE_DEFAULT ; SmallVector < uint64_t , <NUM_LIT> > Record ( Order . Shuffle . begin ( ) , Order . Shuffle . end ( ) ) ; Record . push_back ( VE . getValueID


<s> void <ISA_LIT>BitcodeWriter :: writeUseListBlock ( const Function * F ) { assert ( VE . shouldPreserveUseListOrder ( ) && <STR_LIT> ) ; auto hasMore = [ & ] ( ) { return ! VE . UseListOrders . empty ( ) && VE . UseListOrders . back ( ) . F == F ; } ; if ( ! hasMore ( ) ) return ; Stream . EnterSubblock ( bitc :: USELIST_BLOCK_ID , <NUM_LIT> ) ; while ( hasMore ( ) ) { writeUseList ( std :: move ( VE . UseListOrders . back ( ) ) ) ; VE . UseListOrders . pop_back ( ) ; } Stream . ExitBlock (


<s> static std :: string constructOverloadName ( OverloadKind Kind , Type * Ty , const OpCodeProperty & Prop ) { if ( Kind == OverloadKind :: VOID ) { return ( Twine ( <ISA_LIT>OpNamePrefix ) + getOpCodeClassName ( Prop ) )


<s> const OpCodeProperty * Prop = getOpCodeProperty ( <ISA_LIT>Op ) ; Type * OverloadTy = F . getReturnType ( ) ; OverloadKind Kind = getOverloadKind ( OverloadTy ) ; if ( ( Prop -> OverloadTys & ( uint16_t ) Kind ) == <NUM_LIT> ) { llvm_unreachable ( <STR_LIT> ) ; } std :: string FnName = constructOverloadName ( Kind , OverloadTy , * Prop ) ; assert ( ! M . getFunction ( FnName )


<s> if ( ( Prop -> OverloadTys & ( uint16_t ) Kind ) == <NUM_LIT> ) { llvm_unreachable ( <STR_LIT> ) ; } std :: string FnName = constructOverloadName ( Kind , OverloadTy , * Prop ) ; assert ( ! M . getFunction ( FnName ) && <STR_LIT> ) ; auto & Ctx = M . getContext ( ) ; Type * OpCodeTy = Type :: getInt32Ty ( Ctx ) ; SmallVector < Type *


<s> return new <ISA_LIT>OpLoweringLegacy (


create<ISA_LIT>OpLoweringLegacyPass ( ) {


<s> assert ( Index < ( sizeof ( OpCodeClassNames ) / sizeof ( OpCodeClassNames [


<s> return OverloadKind :: FLOAT ; case Type :: DoubleTyID : return OverloadKind :: DOUBLE ; case Type :: IntegerTyID : { IntegerType * ITy = cast < IntegerType > ( Ty ) ; unsigned Bits = ITy -> getBitWidth ( ) ; switch ( Bits ) { case <NUM_LIT> : return OverloadKind :: I1 ; case <NUM_LIT> : return OverloadKind :: I8 ; case <NUM_LIT> : return OverloadKind :: I16 ; case <NUM_LIT> : return OverloadKind :: I32 ; case <NUM_LIT> : return OverloadKind :: I64 ; default : llvm_unreachable ( <STR_LIT> ) ; return OverloadKind :: VOID ; } } case Type :: PointerTyID : return OverloadKind ::


<s> switch ( T ) { case Type :: VoidTyID : return OverloadKind :: VOID ; case Type :: HalfTyID : return OverloadKind :: HALF ; case Type :: FloatTyID : return OverloadKind :: FLOAT ; case Type :: DoubleTyID : return OverloadKind :: DOUBLE ; case Type :: IntegerTyID : { IntegerType * ITy = cast < IntegerType > ( Ty ) ; unsigned Bits = ITy -> getBitWidth ( ) ; switch ( Bits ) { case <NUM_LIT> : return OverloadKind :: I1 ; case <NUM_LIT> : return OverloadKind ::


<s> static const char * getOverloadTypeName ( OverloadKind Kind ) { switch ( Kind ) { case OverloadKind :: HALF : return <STR_LIT> ; case OverloadKind :: FLOAT : return


<s> auto <ISA_LIT>OpFn = create<ISA_LIT>OpFunction ( <ISA_LIT>Op , F , M ) ; IRBuilder < > B ( M . getContext ( ) ) ; Value * <ISA_LIT>OpArg = B . getInt32 ( static_cast < unsigned > ( <ISA_LIT>Op ) ) ; for ( User * U : make_early_inc_range ( F . users ( ) ) ) { CallInst * CI = dyn_cast < CallInst > ( U ) ; if ( ! CI ) continue ; SmallVector < Value * > Args ; Args . emplace_back ( <ISA_LIT>OpArg ) ; Args . append ( CI -> arg_begin ( ) , CI -> arg_end ( ) ) ; B . SetInsertPoint ( CI ) ; CallInst * <ISA_LIT>CI = B . CreateCall ( <ISA_LIT>OpFn , Args ) ; CI -> replaceAllUsesWith ( <ISA_LIT>CI ) ; CI -> eraseFromParent (


<s> static void lowerIntrinsic ( <STR_LIT> <ISA_LIT>Op , Function & F , Module & M ) { auto <ISA_LIT>OpFn = create<ISA_LIT>OpFunction ( <ISA_LIT>Op , F , M ) ; IRBuilder < > B ( M . getContext ( ) ) ; Value * <ISA_LIT>OpArg = B . getInt32 ( static_cast < unsigned > ( <ISA_LIT>Op ) ) ; for ( User * U : make_early_inc_range (


<s> static SmallDenseMap < <STR_LIT> , <STR_LIT> > LowerMap = { { <STR_LIT> , <STR_LIT> :: Sin } } ; for ( Function & F : make_early_inc_range ( M . functions ( ) ) ) { if ( ! F . isDeclaration ( ) ) continue ; <STR_LIT> ID = F . getIntrinsicID ( ) ; auto LowerIt = LowerMap . find ( ID ) ; if ( LowerIt == LowerMap . end ( ) ) continue ; lowerIntrinsic ( LowerIt -> second , F , M ) ; Updated = true


<s> bool runOnModule ( Module & M ) override { return lowerIntrinsics ( M )


<s> TypedPointerType * TypedPointerType :: get ( Type * EltTy , unsigned AddressSpace ) { assert ( EltTy && <STR_LIT> ) ; assert ( isValidElementType ( EltTy ) && <STR_LIT> ) ; llvm :: Any & TargetData = EltTy -> getContext ( ) . getTargetData ( ) ; if ( ! TargetData . hasValue ( ) ) TargetData = Any { std :: make_shared <


<s> unsigned getAddressSpace ( ) const { return getSubclassData (


<s> return ! ElemTy -> isVoidTy ( ) && ! ElemTy -> isLabelTy ( ) && ! ElemTy -> isMetadataTy

( ) && ! ElemTy -> isTokenTy ( ) && ! ElemTy -> isX86_AMXTy ( ) ;


<s> static Value * maybeGenerateBitcast ( IRBuilder < > & Builder , PointerTypeMap & PointerTypes , Instruction & Inst , Value * Operand , Type * Ty ) { auto It = PointerTypes . find ( Operand ) ; if ( It != PointerTypes . end ( ) ) if ( cast < TypedPointerType > ( It -> second ) -> getElementType ( ) == Ty ) return nullptr ; Builder . SetInsertPoint ( & Inst ) ; return Builder . Insert ( CastInst :: Create ( Instruction :: BitCast , Operand , Builder


<s> auto It = PointerTypes . find ( Operand ) ; if ( It != PointerTypes . end ( ) ) if ( cast < TypedPointerType > ( It -> second ) -> getElementType ( ) == Ty ) return nullptr ; Builder . SetInsertPoint (


<s> ModulePass * llvm :: create<ISA_LIT>PrepareModulePass (


<s> return is_contained ( { Attribute :: Alignment , Attribute :: AlwaysInline , Attribute :: Builtin , Attribute :: ByVal , Attribute :: InAlloca , Attribute :: Cold , Attribute :: Convergent , Attribute :: InlineHint , Attribute :: InReg , Attribute :: JumpTable , Attribute :: MinSize , Attribute :: Naked , Attribute :: Nest , Attribute :: NoAlias , Attribute :: NoBuiltin , Attribute :: NoCapture , Attribute :: NoDuplicate , Attribute :: NoImplicitFloat , Attribute :: NoInline , Attribute :: NonLazyBind , Attribute :: NonNull , Attribute :: Dereferenceable , Attribute :: DereferenceableOrNull , Attribute :: NoRedZone , Attribute :: NoReturn , Attribute :: NoUnwind , Attribute :: OptimizeForSize , Attribute ::

OptimizeNone , Attribute :: ReadNone , Attribute :: ReadOnly , Attribute :: ArgMemOnly , Attribute :: Returned , Attribute :: ReturnsTwice , Attribute :: SExt , Attribute :: StackAlignment , Attribute :: StackProtect , Attribute :: StackProtectReq , Attribute :: StackProtectStrong , Attribute :: SafeStack , Attribute :: StructRet , Attribute :: SanitizeAddress , Attribute :: SanitizeThread , Attribute :: SanitizeMemory , Attribute :: UWTable , Attribute :: ZExt } , Attr ) ;


<s> I = Attribute :: AttrKind ( I + <NUM_LIT> ) ) { if ( ! isValidFor<ISA_LIT> ( I ) ) AttrMask . addAttribute ( I ) ; } for ( auto & F : M . functions ( ) ) { F . removeFnAttrs ( AttrMask ) ; F . removeRetAttrs ( AttrMask ) ; for ( size_t Idx = <NUM_LIT> ; Idx < F . arg_size ( ) ; ++ Idx ) F . removeParamAttrs ( Idx , AttrMask ) ; for ( auto & BB : F ) { IRBuilder < > Builder ( & BB ) ; for ( auto & I : make_early_inc_range ( BB ) ) { if ( I . getOpcode ( ) == Instruction :: FNeg ) { Builder . SetInsertPoint ( & I


<s> static uint32_t ConstMDToUint32 ( const MDOperand & MDO ) { ConstantInt * pConst = mdconst :: extract


<s> ModulePass * llvm :: create<ISA_LIT>TranslateMetadataPass (


<s> return new <ISA_LIT>TranslateMetadata


<s> static void emit<ISA_LIT>ValidatorVersion ( Module & M , VersionTuple & ValidatorVer ) { NamedMDNode * <ISA_LIT>ValidatorVersionMD = M . getNamedMetadata ( ValVerKey ) ; if ( <ISA_LIT>ValidatorVersionMD ) M

. eraseNamedMetadata ( <ISA_LIT>ValidatorVersionMD ) ;


<s> return ConstantAsMetadata :: get ( Constant :: getIntegerValue ( IntegerType :: get ( Ctx , <NUM_LIT> ) , APInt ( <NUM_LIT>


<s> return Log2_32_Ceil ( getTypes ( ) . size ( ) + <NUM_LIT>


<s> void ValueEnumerator :: dropFunctionFromMetadata ( MetadataMapType :: value_type & FirstMD ) { SmallVector < const MDNode * , <NUM_LIT> > Worklist ; auto push = [ & Worklist ] ( MetadataMapType :: value_type & MD ) { auto & Entry = MD . second ; if ( ! Entry . F ) return ; Entry . F


<s> print ( dbgs ( ) , ValueMap , <STR_LIT> ) ; dbgs ( ) <<


<s> print ( dbgs ( ) , ValueMap , <STR_LIT> ) ; dbgs ( ) << '\n' ; print ( dbgs ( ) , MetadataMap , <STR_LIT> ) ; dbgs ( ) <<


<s> void ValueEnumerator :: EnumerateAttributes ( AttributeList PAL ) { if ( PAL . isEmpty ( ) ) return ; unsigned & Entry = AttributeListMap [ PAL ] ; if ( Entry == <NUM_LIT> ) { AttributeLists . push_back ( PAL ) ; Entry = AttributeLists . size ( ) ; } for ( unsigned i : PAL . indexes (


<s> for ( ValueAsMetadata * VAM : ArgList -> getArgs ( ) ) { if ( isa < LocalAsMetadata > ( VAM ) ) { assert ( MetadataMap . count ( VAM ) && <STR_LIT> ) ; assert ( MetadataMap [ VAM ] . F == F && <STR_LIT> ) ; } else { assert ( isa < ConstantAsMetadata > ( VAM ) && <STR_LIT> ) ; assert ( ValueMap . count ( VAM -> getValue ( ) ) && <STR_LIT> ) ; EnumerateMetadata ( F , VAM ) ; } } MDs . push_back ( ArgList ) ; Index . F = F ; Index . ID = MDs


<s> assert ( Index . F == F && <STR_LIT> ) ; return ; } MDs . push_back ( Local ) ; Index . F = F ; Index . ID = MDs .


<s> assert ( ( isa < MDNode > ( MD ) || isa < MDString > ( MD ) || isa < ConstantAsMetadata > ( MD ) ) && <STR_LIT> ) ; auto Insertion = MetadataMap . insert ( std :: make_pair ( MD , MDIndex ( F ) ) ) ; MDIndex & Entry = Insertion . first -> second ; if ( ! Insertion . second ) { if ( Entry . hasDifferentFunction ( F ) ) dropFunctionFromMetadata ( * Insertion . first ) ; return nullptr ; } if ( auto * N = dyn_cast < MDNode > ( MD ) ) return N ; MDs . push_back ( MD ) ; Entry . ID = MDs . size ( ) ; if ( auto * C = dyn_cast < ConstantAsMetadata > ( MD ) ) EnumerateValue ( C -> getValue (


<s> const Constant * C = dyn_cast < Constant > ( V ) ; if ( ! C ) return ; if ( ValueMap . count ( C ) ) return ; for ( const Value * Op : C -> operands ( ) ) { if ( isa < BasicBlock > ( Op ) ) continue ; EnumerateOperandType (


<s> if ( StructType * STy = dyn_cast < StructType > ( Ty ) ) if ( ! STy -> isLiteral ( ) ) * TypeID = ~ <NUM_LIT> ; for ( Type * SubTy : Ty -> subtypes (


<s> assert ( ! V -> getType ( ) -> isVoidTy ( ) && <STR_LIT> ) ; assert ( ! isa < MetadataAsValue > ( V ) && <STR_LIT> ) ; unsigned & ValueID = ValueMap [ V ] ; if ( ValueID ) { Values [ ValueID - <NUM_LIT> ] . second ++ ; return ; } if ( auto * GO = dyn_cast < GlobalObject > ( V ) ) if ( const Comdat * C = GO -> getComdat ( ) ) Comdats . insert ( C ) ; EnumerateType ( V -> getType ( ) ) ; if ( const Constant * C = dyn_cast < Constant > ( V ) ) { if ( isa < GlobalValue > ( C


<s> void ValueEnumerator :: EnumerateValueSymbolTable ( const ValueSymbolTable & VST ) { for ( ValueSymbolTable :: const_iterator VI = VST . begin ( ) , VE = VST .


<s> const Metadata * get ( ArrayRef < const Metadata * > MDs ) const { assert ( ID && <STR_LIT>


<s> const Metadata * get ( ArrayRef < const Metadata * > MDs ) const { assert ( ID && <STR_LIT> ) ; assert ( ID <= MDs . size ( ) && <STR_LIT> ) ; return MDs [ ID


<s> if ( ! Group . second . hasAttributes ( ) ) return <NUM_LIT> ; AttributeGroupMapType :: const_iterator I = AttributeGroupMap . find ( Group ) ; assert ( I != AttributeGroupMap . end ( ) && <STR_LIT> ) ; return I -> second


<s> const std :: vector < IndexAndAttrSet > & getAttributeGroups (


<s> const std :: vector < IndexAndAttrSet > & getAttributeGroups ( ) const { return


<s> AttributeListMapType :: const_iterator I = AttributeListMap . find ( PAL ) ; assert ( I != AttributeListMap . end ( )


<s> const std :: vector < AttributeList > & getAttributeLists ( ) const { return


<s> const std :: vector < const BasicBlock


<s> unsigned ValueEnumerator :: getComdatID ( const Comdat * C ) const { unsigned ComdatID = Comdats . idFor


<s> unsigned ValueEnumerator :: getGlobalBasicBlockID ( const BasicBlock * BB ) const { unsigned & Idx = GlobalBasicBlockIDs [ BB ] ; if ( Idx != <NUM_LIT> ) return Idx - <NUM_LIT> ; IncorporateFunctionInfoGlobalBBIDs ( BB -> getParent ( ) ,


<s> unsigned ValueEnumerator :: getGlobalBasicBlockID ( const BasicBlock * BB ) const { unsigned & Idx = GlobalBasicBlockIDs


<s> unsigned ValueEnumerator :: getInstructionID ( const Instruction * Inst ) const { InstructionMapType :: const_iterator I = InstructionMap . find ( Inst ) ; assert ( I != InstructionMap . end ( ) && <STR_LIT> ) ; return I -> second


<s> ArrayRef < const Metadata * > getMDStrings ( ) const { return makeArrayRef ( MDs ) . slice ( NumModuleMDs


<s> unsigned ValueEnumerator :: getMetadataFunctionID ( const Function * F ) const { return F ? getValueID ( F )


<s> unsigned getMetadataID ( const Metadata * MD ) const { auto ID = getMetadataOrNullID ( MD ) ; assert ( ID != <NUM_LIT> && <STR_LIT> ) ; return ID - <NUM_LIT>


<s> unsigned getMetadataOrNullID ( const Metadata * MD ) const { return MetadataMap . lookup ( MD


<s> if ( isa < MDString > ( MD ) ) return <NUM_LIT> ; auto * N = dyn_cast < MDNode > ( MD ) ; if ( ! N ) return <NUM_LIT> ; return N -> isDistinct ( ) ?


<s> ArrayRef < const Metadata * > getNonMDStrings ( ) const { return makeArrayRef ( MDs ) . slice ( NumModuleMDs ) . slice ( NumMDStrings


<s> return makeArrayRef ( MDs ) . slice ( NumModuleMDs


<s> assert ( I != TypeMap . end ( ) && <STR_LIT> ) ; return I -> second -


<s> unsigned ValueEnumerator :: getValueID ( const Value * V ) const { if ( auto * MD = dyn_cast < MetadataAsValue > ( V ) ) return getMetadataID ( MD -> getMetadata ( ) ) ; ValueMapType :: const_iterator I = ValueMap . find ( V


<s> bool hasDifferentFunction ( unsigned NewF )


<s> unsigned Counter = <NUM_LIT> ; for ( const BasicBlock & BB : * F ) IDMap [ & BB


<s> MDs . insert ( MDs . end ( ) , FunctionMDs . begin ( ) + R .

First , FunctionMDs . begin ( ) + R . Last ) ;


<s> NumMDStrings = R . NumStrings ; MDs . insert ( MDs . end ( ) , FunctionMDs . begin ( ) + R . First , FunctionMDs . begin


<s> std :: pair < unsigned , bool > lookup


<s> unsigned numMDs ( ) const { return MDs . size


<s> if ( ShouldPreserveUseListOrder ) return ; std :: stable_sort ( Values . begin ( ) + CstStart , Values . begin ( ) + CstEnd , [ this ] ( const std :: pair < const Value * , unsigned > & LHS , const std :: pair < const Value * , unsigned > & RHS ) { if ( LHS . first -> getType ( ) != RHS . first -> getType ( ) ) return getTypeID ( LHS . first -> getType ( ) ) < getTypeID ( RHS . first -> getType ( ) ) ; return LHS . second > RHS . second ; } ) ; std :: stable_partition ( Values . begin ( ) + CstStart ,

Values . begin ( ) + CstEnd , isIntOrIntVectorValue ) ;


<s> for ( const Argument & A : F . args ( ) ) predictValueUseListOrder ( & A , & F , OM , Stack ) ; for ( const BasicBlock & BB : F ) for ( const Instruction & I : BB ) { for ( const Value * Op : I . operands ( ) ) if ( isa < Constant > ( * Op ) || isa < InlineAsm > ( * Op ) ) predictValueUseListOrder ( Op , & F , OM , Stack ) ; if ( auto * SVI = dyn_cast < ShuffleVectorInst > ( & I ) ) predictValueUseListOrder ( SVI -> getShuffleMaskForBitcode ( ) , & F , OM , Stack ) ; } for ( const BasicBlock & BB : F ) for ( const Instruction & I : BB ) predictValueUseListOrder ( & I , & F , OM , Stack ) ; } for ( const GlobalVariable & G : M . globals ( ) ) predictValueUseListOrder ( & G , nullptr , OM , Stack ) ; for ( const Function & F : M ) predictValueUseListOrder ( & F , nullptr , OM , Stack ) ; for ( const GlobalAlias & A : M . aliases ( ) ) predictValueUseListOrder ( & A , nullptr , OM , Stack ) ; for ( const GlobalIFunc & I : M . ifuncs ( ) ) predictValueUseListOrder ( & I , nullptr , OM , Stack ) ; for ( const GlobalVariable & G : M . globals ( ) ) if ( G . hasInitializer ( ) ) predictValueUseListOrder ( G . getInitializer ( ) , nullptr , OM , Stack ) ; for ( const GlobalAlias & A : M . aliases ( ) ) predictValueUseListOrder ( A . getAliasee ( ) , nullptr , OM , Stack ) ; for ( const GlobalIFunc & I : M . ifuncs ( ) ) predictValueUseListOrder ( I . getResolver ( ) , nullptr , OM , Stack ) ; for ( const Function & F : M ) { for ( const Use & U : F . operands ( ) ) predictValueUseListOrder ( U . get (


<s> IDPair . second = true ; if ( ! V -> use_empty ( ) && std :: next ( V -> use_begin ( ) ) != V -> use_end ( ) ) predictValueUseListOrderImpl ( V , F , IDPair . first , OM , Stack ) ; if ( const Constant * C = dyn_cast < Constant > ( V ) ) { if ( C -> getNumOperands (


<s> for ( const auto & I : Map ) { const Metadata * MD = I . first ; OS << <STR_LIT> << I . second .


<s> for ( const BasicBlock * BB : BasicBlocks ) ValueMap . erase ( BB ) ; Values . resize ( NumModuleValues ) ; MDs . resize ( NumModuleMDs ) ; BasicBlocks . clear ( ) ; NumMDStrings =


<s> void ValueEnumerator :: setInstructionID ( const Instruction *


<s> bool shouldPreserveUseListOrder ( ) const { return


<s> unsigned size ( ) const { return IDs . size (


<s> EnumerateValue ( & GV ) ; EnumerateType ( GV . getValueType ( ) ) ; } for ( const Function & F : M ) { EnumerateValue ( & F ) ; EnumerateType ( F . getValueType ( ) ) ; EnumerateAttributes ( F . getAttributes ( ) ) ; } for ( const GlobalAlias & GA : M . aliases ( ) ) { EnumerateValue ( & GA ) ; EnumerateType ( GA . getValueType ( ) ) ; } for ( const GlobalIFunc & GIF : M . ifuncs ( ) ) { EnumerateValue ( & GIF ) ; EnumerateType ( GIF . getValueType ( ) ) ; } unsigned FirstConstant = Values . size ( ) ; for ( const GlobalVariable & GV : M . globals ( ) ) { if ( GV . hasInitializer ( ) ) EnumerateValue ( GV . getInitializer ( ) ) ; if ( GV . hasAttributes ( ) ) EnumerateAttributes ( GV . getAttributesAsList ( AttributeList :: FunctionIndex ) ) ; } for ( const GlobalAlias & GA : M . aliases ( ) ) EnumerateValue ( GA . getAliasee ( ) ) ; for ( const GlobalIFunc & GIF : M . ifuncs ( ) ) EnumerateValue ( GIF . getResolver ( ) ) ; for ( const Function & F : M ) for ( const Use & U : F . operands ( ) ) EnumerateValue ( U . get ( ) ) ; EnumerateType ( Type :: getMetadataTy ( M . getContext ( ) ) ) ; EnumerateValueSymbolTable ( M . getValueSymbolTable ( )


<s> ModulePass * llvm :: create<ISA_LIT>WriterPass


<s> ModulePass * llvm :: create<ISA_LIT>WriterPass (


<s> void getAnalysisUsage ( AnalysisUsage & AU ) const override { AU . setPreservesAll


<s> StringRef getPassName ( ) const override { return


<s> explicit Write<ISA_LIT>Pass ( raw_ostream & o ) : ModulePass ( ID ) , OS ( o ) { initializeWrite<ISA_LIT>PassPass ( * PassRegistry :: getPassRegistry


<s> for ( const auto & I : B ) { if ( const auto * RetInst = dyn_cast_or_null < ReturnInst > ( & I ) ) { Type * NewRetTy = classifyPointerType ( RetInst -> getReturnValue ( ) ) ; if ( ! RetTy ) RetTy = NewRetTy ; else if ( RetTy != NewRetTy ) RetTy = TypedPointerType :: get ( Type :: getInt8Ty ( I . getContext ( ) ) , F . getReturnType ( ) -> getPointerAddressSpace ( ) ) ; } } } } for ( auto & A : F . args ( ) ) { Type * ArgTy = A . getType ( ) ; if ( ArgTy -> isOpaquePointerTy ( ) ) { TypedPointerType * NewTy = classifyPointerType ( & A ) ; Map [ & A ] = NewTy ; ArgTy = NewTy ; HasOpaqueTy =