<s> void <ISA_LIT>AsmBackend :: applyFixup ( const MCAssembler & Asm , const MCFixup & Fixup , const MCValue & Target , MutableArrayRef < char > Data , uint64_t Value , bool

IsResolved , const MCSubtargetInfo * STI ) const {


<s> MCAsmBackend * create<ISA_LIT>AsmBackend ( const Triple &


<s> std :: unique_ptr < MCObjectTargetWriter > <ISA_LIT>AsmBackend :: createObjectTargetWriter ( )


<s> bool <ISA_LIT>AsmBackend :: fixupNeedsRelaxation ( const MCFixup & Fixup , uint64_t Value , const MCRelaxableFragment

* DF , const MCAsmLayout & Layout ) const {


<s> bool <ISA_LIT>AsmBackend :: fixupNeedsRelaxation ( const MCFixup & Fixup , uint64_t Value

, const MCRelaxableFragment * DF , const MCAsmLayout & Layout ) const {


<s> unsigned <ISA_LIT>AsmBackend :: getNumFixupKinds ( ) const { return <NUM_LIT>


<s> unsigned <ISA_LIT>AsmBackend :: getNumFixupKinds ( )


<s> bool <ISA_LIT>AsmBackend :: mayNeedRelaxation ( const MCInst & Inst , const MCSubtargetInfo & STI ) const { return false


<s> void <ISA_LIT>AsmBackend :: relaxInstruction ( const MCInst & Inst , const MCSubtargetInfo & STI , MCInst &


<s> bool <ISA_LIT>AsmBackend :: writeNopData ( raw_ostream & OS , uint64_t Count


<s> bool <ISA_LIT>AsmBackend :: writeNopData ( raw_ostream & OS , uint64_t


<s> ClassDef += <STR_LIT> ; for ( auto & TyFIDPair : CompFields ) EmitFieldAllocation ( ClassDef , TyFIDPair . first , ClassName , TyFIDPair . second ) ; ClassDef += <STR_LIT> ; return


<s> std :: string ClassDef = EmitClassDefinition ( TyNmPair . first , ClassName ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << ClassDef ; ) ; std :: error_code EC ; sys :: fs :: OpenFlags OpenFlags = sys :: fs :: F_None ; raw_fd_ostream ClassFile ( ClassName + <STR_LIT> , EC , OpenFlags ) ; ClassFile <<


<s> <ISA_LIT>Assembler obj ; Optional < std :: unique_ptr < <STR_LIT> >> classPkt = obj . AssembleClass ( TM . getMCAsmInfo ( ) -> getAsmMemoryBuffer ( ) ) ; if ( Dump<ISA_LIT>ClassFile && classPkt . hasValue ( ) ) { std :: error_code EC ; sys :: fs :: OpenFlags OpenFlags = sys :: fs :: F_None ; std :: string ModName ( M . getName ( ) . data ( ) ) ; std :: string ClassName = ModName . substr ( <NUM_LIT> , ModName . find ( <STR_LIT> ) ) ; raw_fd_ostream ClassFile ( ClassName + <STR_LIT> , EC , OpenFlags ) ; ClassFile . write ( classPkt -> get ( ) -> getPayload ( ) ,


<s> if ( isa < ArrayType > ( Ty ) ) { char IDStr [ <NUM_LIT> ] = { '\0' } ; Type * ElmTy = cast < ArrayType > ( Ty ) -> getElementType ( ) ; unsigned NumElm = cast < ArrayType > ( Ty ) -> getNumElements ( ) ; std :: string ElmTyStr = EmitTypeString ( ElmTy ) ; FieldInit += <STR_LIT> ; FieldInit += <STR_LIT> ; sprintf ( IDStr , <STR_LIT> , NumElm ) ; FieldInit += IDStr ; if ( isa < StructType > ( ElmTy ) ) FieldInit += <STR_LIT> ; else FieldInit += <STR_LIT> ; FieldInit += ElmTyStr ; FieldInit += <STR_LIT> ; FieldInit += ClassName ; FieldInit += <STR_LIT> ; IDStr [ <NUM_LIT> ] = '\0' ; sprintf ( IDStr , <STR_LIT> , FieldID ) ; FieldInit += IDStr ; FieldInit += <STR_LIT> ; MFI -> getTypeDescriptor ( Ty , FieldInit ) ; if ( isa < StructType > ( ElmTy ) ) { for ( unsigned i = <NUM_LIT> ; i < NumElm ; i ++ ) { FieldInit += <STR_LIT> ; FieldInit += <STR_LIT> ; FieldInit += ClassName ; FieldInit += <STR_LIT> ; IDStr [ <NUM_LIT> ] = '\0' ; sprintf ( IDStr , <STR_LIT> , FieldID ) ; FieldInit += IDStr ; FieldInit += <STR_LIT> ; MFI -> getTypeDescriptor ( Ty , FieldInit ) ; if ( i < <NUM_LIT> ) FieldInit += <STR_LIT> ; else FieldInit += <STR_LIT> ; IDStr [ <NUM_LIT> ] = '\0' ; sprintf ( IDStr , <STR_LIT> , i ) ; FieldInit += IDStr ; FieldInit += <STR_LIT> ; FieldInit += ElmTyStr ; FieldInit += <STR_LIT> ; FieldInit += <STR_LIT> ; FieldInit += ElmTyStr ; FieldInit += <STR_LIT> ; FieldInit += <STR_LIT> ; } } } else if ( isa < StructType > ( Ty ) ) { char IDStr [ <NUM_LIT> ] = { '\0' } ; std :: string TypeStr = EmitTypeString ( Ty ) ; FieldInit += <STR_LIT> ; FieldInit += <STR_LIT> ; FieldInit += TypeStr ; FieldInit += <STR_LIT> ; FieldInit += <STR_LIT> ; FieldInit += TypeStr ; FieldInit += <STR_LIT> ; FieldInit += <STR_LIT> ; FieldInit += ClassName ; FieldInit +=


<s> FieldInit += IDStr ; if ( isa < StructType > ( ElmTy ) ) FieldInit += <STR_LIT> ; else FieldInit += <STR_LIT> ; FieldInit += ElmTyStr ; FieldInit += <STR_LIT> ; FieldInit += ClassName ; FieldInit += <STR_LIT> ; IDStr [ <NUM_LIT> ] = '\0' ; sprintf ( IDStr , <STR_LIT> , FieldID ) ; FieldInit += IDStr ; FieldInit += <STR_LIT> ; MFI -> getTypeDescriptor ( Ty , FieldInit ) ; if ( isa < StructType > ( ElmTy ) ) { for ( unsigned i = <NUM_LIT> ; i < NumElm ; i ++ ) { FieldInit += <STR_LIT> ; FieldInit += <STR_LIT> ; FieldInit += ClassName ; FieldInit += <STR_LIT> ; IDStr [ <NUM_LIT> ] = '\0' ; sprintf ( IDStr , <STR_LIT> , FieldID ) ; FieldInit += IDStr ; FieldInit += <STR_LIT> ; MFI -> getTypeDescriptor ( Ty , FieldInit ) ; if ( i < <NUM_LIT> ) FieldInit += <STR_LIT> ; else FieldInit += <STR_LIT> ; IDStr [ <NUM_LIT> ] = '\0' ; sprintf ( IDStr , <STR_LIT> , i ) ; FieldInit += IDStr ; FieldInit += <STR_LIT> ; FieldInit += ElmTyStr ; FieldInit += <STR_LIT> ; FieldInit += <STR_LIT> ; FieldInit += ElmTyStr ; FieldInit += <STR_LIT> ; FieldInit += <STR_LIT> ; } } } else if ( isa < StructType > ( Ty ) ) { char IDStr [ <NUM_LIT> ] = { '\0' } ; std :: string TypeStr = EmitTypeString ( Ty ) ; FieldInit += <STR_LIT> ; FieldInit += <STR_LIT> ; FieldInit += TypeStr ; FieldInit += <STR_LIT> ; FieldInit += <STR_LIT> ; FieldInit += TypeStr ; FieldInit += <STR_LIT> ; FieldInit += <STR_LIT> ; FieldInit += ClassName ; FieldInit += <STR_LIT> ; sprintf ( IDStr , <STR_LIT>


<s> Type * ElmTy = cast < ArrayType > ( Ty ) -> getElementType ( ) ; unsigned NumElems = cast < ArrayType > ( Ty ) -> getNumElements ( ) ; for ( unsigned i = <NUM_LIT> ; i < NumElems ; i ++ ) { if ( i < NumElems - <NUM_LIT> ) AsmBuf += <STR_LIT> ; AsmBuf += <STR_LIT> ; IDStr [ <NUM_LIT> ] = '\0' ; sprintf ( IDStr , <STR_LIT> , i ) ; AsmBuf += IDStr ; EmitFieldInitialization ( AsmBuf , Ty , ElmTy , ConstIdx , CVec , FieldID , false ) ; } } else if ( isa < StructType > ( Ty ) ) { char IDStr [ <NUM_LIT> ] = { '\0' } ; AsmBuf += GetLoadString ( PTy ) ; if ( isa < StructType > ( PTy ) ) { AsmBuf += <STR_LIT> ; AsmBuf += MFI -> getFromTypeNameMap ( PTy ) ; AsmBuf += <STR_LIT> ; IDStr [ <NUM_LIT> ] = '\0' ; sprintf ( IDStr , <STR_LIT> , FieldID


<s> Type * FldTy = cast < StructType > ( Ty ) -> getTypeAtIndex ( i ) ; if ( i < NumFields - <NUM_LIT> ) AsmBuf += <STR_LIT> ; EmitFieldInitialization ( AsmBuf , FldTy , Ty , ConstIdx , CVec , i , false ) ; } } else { char IDStr [ <NUM_LIT> ] = { '\0' } ; assert ( isa < ConstantInt > ( CVec [ ConstIdx ] ) ) ; unsigned InitVal = cast < ConstantInt > ( CVec [ ConstIdx ++ ] ) -> getZExtValue ( ) ; sprintf ( IDStr , <STR_LIT> , InitVal ) ; AsmBuf += <STR_LIT> ; AsmBuf += IDStr ; AsmBuf += GetStoreString ( PTy ) ; if ( isa < StructType > ( PTy ) ) { AsmBuf += MFI -> getFromTypeNameMap ( PTy ) ; AsmBuf += <STR_LIT> ; IDStr [ <NUM_LIT> ] = '\0' ; sprintf ( IDStr , <STR_LIT> , FieldID ) ; AsmBuf += IDStr ; AsmBuf += <STR_LIT> ; MFI -> getTypeDescriptor ( Ty


<s> TS -> emitString ( <STR_LIT> ) ; EmitClassDefinitions (


<s> <ISA_LIT>TargetStreamer * TS = getTargetStreamer ( ) ; TS -> emitString ( <STR_LIT>


<s> std :: string ClassName = ModName . substr ( <NUM_LIT> , ModName . find ( <STR_LIT> ) ) ; const GlobalVariable * GCStructObj = Mod -> getNamedGlobal ( <STR_LIT> ) ; Type * GCStructTy = GetRootType ( GCStructObj -> getType ( ) ) ; assert ( isa < StructType > ( GCStructTy ) ) ; StructType * STy = cast < StructType > ( GCStructTy ) ; FieldTypeIndexVec CompFields ; EmitClassFields ( ConstrStr , STy , CompFields ) ; ConstrStr += <STR_LIT> ; for ( auto TyIdx : CompFields ) EmitFieldAllocation ( ConstrStr , TyIdx . first , ClassName , TyIdx . second ) ; PopulateConstValVector ( GCStructObj -> getInitializer ( ) , CVec ) ; for ( auto TyIdx : CompFields ) EmitFieldInitialization ( ConstrStr , STy , TyIdx . first , ConstIdx , CVec , TyIdx . second , true ) ; <ISA_LIT>FunctionInfo :: TypeNameMap * STyName = const_cast < <ISA_LIT>FunctionInfo * > ( MFI ) -> getTypeNameMap ( ) ; STyName -> erase ( STy ) ; } else { ConstrStr += <STR_LIT> ; } ConstrStr += <STR_LIT> ; ConstrPrint = true ; } TS -> emitString ( ConstrStr ) ; std :: string str ( <STR_LIT> ) ; str += F . getName ( ) ; str += <STR_LIT> ; for ( auto & Arg : F . args ( ) ) { Type * T = Arg . getType ( ) ; if ( isa < PointerType > ( T ) ) T = cast < PointerType > ( T ) -> getElementType ( ) ; MFI -> getTypeDescriptor ( T , str ) ; } Type * RetType = F . getReturnType ( ) ; str += <STR_LIT> ; MFI -> getTypeDescriptor ( RetType , str ) ; TS -> emitString ( str ) ; str = <STR_LIT> ; limit [ <NUM_LIT> ] = '\0' ; sprintf ( limit , <STR_LIT> , MFI -> getLocalsLimit ( ) ) ; str += limit ; TS -> emitString (


<s> void <ISA_LIT>AsmPrinter :: EmitGlobalVariable ( const GlobalVariable * GV ) { assert ( GV -> isConstant


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << * MI << '\n' ) ; <ISA_LIT>MCInstLower InstLower ( OutContext , * this ) ; MCInst TmpInst ; InstLower . Lower ( MI


<s> std :: string str ( <STR_LIT> ) ; str += <STR_LIT> ; str += ClassName ; str += <STR_LIT> ; TS -> emitString


<s> switch ( VT . getSimpleVT ( ) . SimpleTy ) { default : assert ( <STR_LIT> ) ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case


<s> if ( isa < StructType > ( Ty ) ) return <STR_LIT> ; else if ( isa < ArrayType > ( Ty ) ) { Type * ElmTy = cast < ArrayType > ( Ty ) -> getElementType ( ) ; if ( isa < CompositeType > ( ElmTy ) ) return <STR_LIT> ; return GetLoadString ( ElmTy ) ; } else { const DataLayout & DL = MF -> getDataLayout ( ) ; const <ISA_LIT>TargetLowering & TLI = * MF -> getTarget ( ) . getSubtarget < <ISA_LIT>Subtarget > ( MF -> getFunction ( ) ) . getTargetLowering ( ) ; EVT VT = TLI . getValueType ( DL , Ty


<s> Type * ElmTy = cast < ArrayType > ( Ty ) -> getElementType ( ) ; if ( isa < CompositeType > ( ElmTy ) ) return <STR_LIT> ; return GetLoadString ( ElmTy ) ; } else { const DataLayout & DL = MF -> getDataLayout ( ) ; const <ISA_LIT>TargetLowering & TLI = * MF -> getTarget ( ) . getSubtarget < <ISA_LIT>Subtarget > ( MF -> getFunction ( ) ) . getTargetLowering ( ) ; EVT VT = TLI . getValueType ( DL , Ty ) ; switch ( VT . getSimpleVT ( ) . SimpleTy ) { default : llvm_unreachable ( <STR_LIT> ) ; case <STR_LIT> : return


<s> const <ISA_LIT>TargetLowering & TLI = * MF -> getTarget ( ) . getSubtarget < <ISA_LIT>Subtarget > ( MF -> getFunction ( ) ) . getTargetLowering ( ) ; EVT VT = TLI . getValueType ( DL , Ty ) ; switch ( VT . getSimpleVT ( ) . SimpleTy ) { default : llvm_unreachable ( <STR_LIT> ) ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT>


<s> const <ISA_LIT>Subtarget & getSubtarget ( )


<s> const <ISA_LIT>Subtarget & getSubtarget ( ) const


<s> <ISA_LIT>TargetStreamer * <ISA_LIT>AsmPrinter :: getTargetStreamer ( ) { MCTargetStreamer * TS = OutStreamer -> getTargetStreamer ( ) ; return static_cast < <ISA_LIT>TargetStreamer *


<s> <ISA_LIT>TargetStreamer * <ISA_LIT>AsmPrinter :: getTargetStreamer ( ) { MCTargetStreamer * TS = OutStreamer ->


<s> unsigned Opcode = MI . getOpcode ( ) ; if ( MI . getDesc ( ) . isRegCConv ( ) ) return true ; switch ( Opcode ) { default : return false ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT>


<s> RegisterAsmPrinter < <ISA_LIT>AsmPrinter > X ( getThe<ISA_LIT>Target32 ( ) ) ; RegisterAsmPrinter < <ISA_LIT>AsmPrinter > Y (


<s> return AsmPrinter :: lowerConstant (


<s> Type * Ty = Init -> getType ( ) ; if ( isa < ArrayType > ( Ty ) || isa < StructType > ( Ty ) ) { unsigned NumElems = isa < ArrayType > ( Ty ) ? cast < ArrayType > ( Ty ) -> getNumElements ( ) : cast < StructType > ( Ty ) -> getNumElements ( ) ; for ( unsigned i = <NUM_LIT> ; i < NumElems ; i ++ ) PopulateConstValVector ( Init -> getAggregateElement ( i ) , CVec ) ; } else CVec . push_back ( Init


<s> void <ISA_LIT>AsmPrinter :: PopulateConstValVector ( const Constant * Init , ConstantVals & CVec ) { Type * Ty = Init -> getType ( ) ; if ( isa < ArrayType > ( Ty ) || isa < StructType > ( Ty ) ) { unsigned NumElems = isa < ArrayType > ( Ty ) ? cast < ArrayType > ( Ty ) -> getNumElements ( ) : cast <

StructType > ( Ty ) -> getNumElements ( ) ;


<s> MRI = & MF . getRegInfo ( ) ; MFI = MF . getInfo <


<s> JNIEXPORT void JNICALL Java_jasmin_Main_llc_1dump_1classObj ( JNIEnv * env , jobject obj , jbyteArray bytes ) { jint len = env -> GetArrayLength ( reinterpret_cast < jarray * > ( & bytes ) [ <NUM_LIT> ] ) ; classObjectBuffer = ( char * ) malloc ( sizeof ( int ) + len + <NUM_LIT> ) ; int * payLoadSize = ( int * ) classObjectBuffer ; char * objectPayLoad = classObjectBuffer + sizeof ( int ) ; std :: cout << <STR_LIT>


<s> jobject jobj = env -> NewObject ( cls , cnstr ) ; if ( NULL == jobj ) return nullptr ; jmethodID mid = env -> GetMethodID ( cls , <STR_LIT> , <STR_LIT> ) ; if ( NULL == mid ) return nullptr ; jstring jstr = env -> NewStringUTF ( asmFile . c_str ( ) ) ; if ( NULL == jstr ) return nullptr ; LLVM_DEBUG ( llvm :: dbgs ( ) << <STR_LIT> << strlen ( asmFile . c_str ( ) ) << <STR_LIT> ) ; env -> CallVoidMethod ( jobj ,


<s> void <ISA_LIT>AssemblerImpl :: freeClassObjectBuffer ( ) { if ( classObjectBuffer ) free ( classObjectBuffer


<s> inst = new <ISA_LIT>AssemblerImpl ( ) ; } return


<s> <ISA_LIT>AssemblerImpl :: <ISA_LIT>AssemblerImpl ( ) { JavaVMInitArgs vm_args ; JavaVMOption options [ <NUM_LIT> ] ; std :: string libPath = <STR_LIT> ; std :: string classPath = <STR_LIT> ; if ( ! Process :: GetEnv ( <STR_LIT> ) . hasValue ( ) ) report_fatal_error ( <STR_LIT> ) ; classPath = classPath + Process :: GetEnv ( <STR_LIT> ) . getValue ( ) ; classPath = classPath + <STR_LIT> ; libPath = libPath + Process :: GetEnv ( <STR_LIT> ) . getValue ( ) ; classObjectBuffer = nullptr ; llvm :: outs (


<s> <STR_LIT> <ISA_LIT>Assembler ( ) { delete Impl


<s> <ISA_LIT>AssemblerImpl :: ~ <ISA_LIT>AssemblerImpl (


<s> jvm -> DestroyJavaVM ( ) ; freeClassObjectBuffer (


<s> if ( DeletionSet . find ( Elm ) == DeletionSet . end ( ) ) DeletionSet . insert


<s> Value * CastHandler :: GenMask ( IRBuilder < > & IRB , Type * SrcTy , Type * DestTy , Value * Offset , bool IsLoad ) { LLVMContext & Cxt = Func -> getContext ( ) ; const DataLayout & DL = Func -> getParent ( ) -> getDataLayout ( ) ; unsigned SrcSz = DL . getTypeSizeInBits ( SrcTy ) ; unsigned DestSz = DL . getTypeSizeInBits ( DestTy ) ; return llvm :: GenMask ( Cxt , DL , IRB , SrcSz


<s> if ( User -> getNumUses ( ) ) PopulateEraseUsers ( User , Users ) ; Users . insert ( User


<s> for ( auto * User : I . users ( ) ) ProcessUser ( MemOpOffsetMap , * User , Offset , false ) ; ProcessMemOpWRTCompositeSource ( SrcMem , MemOpOffsetMap , DestTy , <NUM_LIT>


<s> for ( auto * User : I . users ( ) ) ProcessUser ( MemOpOffsetMap


<s> void CastHandler :: ProcessFunction ( ) { LLVMContext & Cxt = Func -> getContext ( ) ; const DataLayout & DL = Func -> getParent ( ) -> getDataLayout ( ) ; TargetIdxTy = GetTargetIndexType (


<s> bool RetVal = true ; bool AllConstantIndices = I . hasAllConstantIndices ( ) ; if ( isStruct && ! AllConstantIndices ) return false ; Offset = ComputeOffsetForGEP ( IRB , I , Offset ) ; AddToLazyDeletionSet ( & I ) ; for ( auto * User : I . users ( ) ) RetVal &= ProcessUser ( MemOpOffsetMap


<s> bool CastHandler :: ProcessGEPChain ( SrcMemOpOffset & MemOpOffsetMap , GetElementPtrInst & I , Value * Offset , bool isStruct ) { IRBuilder < > IRB ( & I ) ; bool RetVal


<s> Users . insert ( Val ) ; } for ( auto * I : Users ) cast < Instruction > ( I ) ->


<s> Users . insert ( Val ) ; } for ( auto * I : Users ) cast < Instruction > ( I ) -> eraseFromParent ( ) ; DeletionSet . clear ( )


<s> for ( auto * User : I . users ( ) ) ProcessUser ( MemOpOffsetMap ,


<s> assert ( isa < StructType > ( SrcTy ) && <STR_LIT> ) ; const DataLayout & DL = Func -> getParent ( ) -> getDataLayout ( ) ; const StructLayout * SL = DL . getStructLayout ( cast < StructType >


<s> assert ( isa < StructType > ( SrcTy ) && <STR_LIT> ) ; const DataLayout & DL = Func -> getParent ( ) -> getDataLayout ( ) ; const StructLayout * SL = DL . getStructLayout ( cast < StructType > ( SrcTy ) ) ; unsigned Align = SL -> hasPadding ( ) ? SL -> getAlignment ( ) * <NUM_LIT> : <NUM_LIT> ; SrcMemOpOffset MemOpOffsetMap ; for ( auto * User : I . users ( ) ) ProcessUser ( MemOpOffsetMap , * User , Offset , false ) ; ProcessMemOpWRTCompositeSource ( SrcMem , MemOpOffsetMap , DestTy ,


<s> AddToLazyDeletionSet ( & I ) ; for ( auto * BCUser : cast < BitCastInst > ( & I ) -> users ( ) ) RetVal &= ProcessUser ( MemOpOffsetMap , * BCUser , Offset , isStruct ) ; } else llvm_unreachable ( <STR_LIT> ) ; return


<s> Value * Offset = ConstantInt :: get ( TargetIdxTy , <NUM_LIT> ) ; Value * Root = GetRootObject ( & I , & Offset , HasBitCastInChain ) ; assert ( Root && isa < PointerType > ( Root -> getType ( ) ) && <STR_LIT> ) ; if ( HasBitCastInChain ) return ; Type * RootTy = GetRootType ( Root -> getType ( ) ) ; Type * DestTy = GetRootType ( I . getDestTy ( )


<s> for ( auto & Idx : GI -> indices ( ) ) if ( ! isa < ConstantInt > ( Idx ) ) return false ; } } return true


<s> Argument * NewArguments = std :: allocator < Argument > ( ) . allocate ( ArgsCnt ) ; Func -> setArguments ( NewArguments , ArgsCnt ) ; for ( unsigned i = <NUM_LIT> , e = ArgsCnt ; i != e ; ++ i ) { Type * ArgTy = Func -> getFunctionType ( ) -> getParamType ( i ) ; assert ( ! ArgTy -> isVoidTy ( ) && <STR_LIT> ) ; new ( NewArguments + i ) Argument ( ArgTy , <STR_LIT> , const_cast < Function * > ( Func ) , i ) ; CopyArgumentAttributes ( Arguments + i , Func , i ) ; } } return


<s> Argument * NewArguments = std :: allocator < Argument > ( ) . allocate ( ArgsCnt ) ; Func -> setArguments ( NewArguments , ArgsCnt ) ; for ( unsigned i = <NUM_LIT> , e = ArgsCnt ; i != e ; ++ i ) { Type * ArgTy = Func -> getFunctionType (


<s> for ( StructType :: element_iterator EB = STy -> element_begin ( ) , EI = EB , EE = STy -> element_end ( ) ; EI != EE ; ++ EI ) { if ( isa < StructType > ( * EI ) ) return false ; else if ( isa < ArrayType > ( * EI ) ) retVal &= CheckIfFlattendType


<s> if ( Old -> hasSwiftSelfAttr ( ) ) Func -> addParamAttr ( ArgNo , Attribute :: SwiftSelf ) ; if ( Old -> hasSwiftErrorAttr ( ) ) Func -> addParamAttr ( ArgNo , Attribute :: SwiftError ) ; if ( Old -> hasInAllocaAttr ( ) ) Func -> addParamAttr ( ArgNo , Attribute :: InAlloca ) ; if ( Old -> hasNestAttr ( ) ) Func ->

addParamAttr ( ArgNo , Attribute :: Nest ) ;


<s> if ( Old -> hasNestAttr ( ) ) Func -> addParamAttr ( ArgNo , Attribute :: Nest ) ; if ( Old -> hasNoAliasAttr ( ) ) Func -> addParamAttr ( ArgNo , Attribute :: NoAlias ) ; if ( Old -> hasNoCaptureAttr ( ) ) Func -> addParamAttr ( ArgNo , Attribute :: NoCapture ) ; if ( Old -> hasStructRetAttr ( ) ) Func -> addParamAttr ( ArgNo , Attribute :: StructRet ) ; if ( Old -> hasReturnedAttr ( ) ) Func -> addParamAttr ( ArgNo , Attribute ::


<s> assert ( objFlatObjArr . find ( Src ) != objFlatObjArr . end ( ) && <STR_LIT> ) ; ValueVec IdxVec ; IdxVec . push_back ( ConstantInt :: get ( Type :: getInt32Ty ( Func -> getContext ( ) ) , APInt ( <NUM_LIT> , <NUM_LIT> ) ) ) ; if ( ! isa < ConstantInt > ( Src ) ) { if ( isBlastedType ( Ty ) ) { Type * BlTy = typeDefs [ Ty ] ; assert ( isa < StructType > ( BlTy ) ) ; for ( unsigned i = <NUM_LIT> ; i < cast < StructType > ( BlTy ) -> getNumElements ( ) ; i ++ ) { Type * ElmTy = cast < StructType > ( BlTy ) -> getElementType ( i ) ; Value * SrcObj = objFlatObjArr [ Src ] [ i ] ; Value * DstObj = objFlatObjArr [ Dst ] [ i ] ; if ( isa < SequentialType > ( ElmTy ) ) { int NumElms = cast < SequentialType > ( ElmTy ) -> getNumElements ( ) ; CopyCompositeObj ( DstObj , SrcObj , ElmTy , NumElms , IdxVec , IRB , Func -> getContext ( ) ) ; } else { CopyScalarObj ( DstObj , SrcObj , ElmTy , IRB ) ; } } } else { Value * SrcObj = objFlatObjArr [ Src ] [ <NUM_LIT> ] ; Value * DstObj = objFlatObjArr [ Dst ] [ <NUM_LIT> ] ; Type * SrcObjTy = GetRootType ( SrcObj -> getType ( ) ) ; Type * DstObjTy = GetRootType ( DstObj -> getType ( ) ) ; assert ( isa < ArrayType > ( SrcObjTy ) &&


<s> static void CopyScalarObj ( Value * Dst , Value * Src , Type * ElmTy , IRBuilder < > & IRB ) { Value * SrcLoad = IRB . CreateLoad ( Src


<s> static void CopyScalarObj ( Value * Dst , Value * Src , Type * ElmTy , IRBuilder < > & IRB ) { Value * SrcLoad = IRB . CreateLoad


<s> DenseSet < Argument * > WorkListArgs ; IRBuilder < > IRB ( & Func -> getEntryBlock ( ) . front ( ) ) ; for ( auto & TyValPair : typeValues ) { for ( Value * V : TyValPair . second ) { if ( isa < AllocaInst > ( V ) ) { ValueVec ValArr ; Value * ArraySize = nullptr ; Type * FlatTy = typeDefs [ TyValPair . first ] ; FlatTy = GetRootType ( FlatTy ) ; if ( isBlastedType ( TyValPair . first ) ) { for ( unsigned i = <NUM_LIT> ; i < cast < StructType > ( FlatTy ) -> getNumElements ( ) ; i ++ ) { Type * ElmTy = cast < StructType > ( FlatTy ) -> getStructElementType ( i ) ; if ( isa < ArrayType > ( ElmTy ) ) { uint64_t ElemCount = cast < ArrayType > ( ElmTy ) -> getNumElements ( ) ; ArraySize = Constant :: getIntegerValue ( Type :: getInt32Ty ( Func -> getContext ( ) ) , APInt ( <NUM_LIT> , ElemCount ) ) ; ElmTy = cast < ArrayType > ( ElmTy ) -> getElementType ( ) ; } AllocaInst * AI = IRB . CreateAlloca ( ElmTy , ArraySize ) ; ValArr . push_back ( AI ) ; IRB . SetInsertPoint ( AI ) ; } } else ValArr . push_back ( IRB . CreateAlloca ( FlatTy , ArraySize ) ) ; if ( objFlatObjArr . find ( V ) == objFlatObjArr . end ( ) ) objFlatObjArr [ V ] = ValArr ; } else if ( isa < Argument > ( V ) ) WorkListArgs . insert ( cast < Argument > ( V ) ) ; } } if ( WorkListArgs . size ( ) > <NUM_LIT> ) { Argument * OldArgs = BuildAndSetArgsList ( Func ) ; for ( unsigned i = <NUM_LIT> ; i < Func -> arg_size ( ) ; i ++ ) { Argument * OldArg = OldArgs + i ; Type * ArgTy = OldArg -> getType ( ) ; if ( WorkListArgs . find ( OldArg ) == WorkListArgs . end ( ) ) OldArg -> replaceAllUsesWith ( Func -> arg_begin ( ) + i ) ; else { ValueVec ValArr ; assert ( typeDefs . find ( ArgTy ) != typeDefs . end ( ) && typeDefs [ ArgTy ] ) ; Argument * NewArg = new ( Func -> arg_begin ( ) + i ) Argument ( typeDefs [ ArgTy ] , <STR_LIT> , const_cast < Function * > ( Func ) , i ) ; CopyArgumentAttributes ( OldArg ,


<s> if ( Ty . second ) Ty . second -> dump ( ) ; else dbgs ( ) << <STR_LIT> ; dbgs ( ) << <STR_LIT> ; } )


<s> for ( auto Val : typeValues [ Ty . first ] ) Val -> dump ( ) ; dbgs ( ) << <STR_LIT> ; if ( Ty . second ) Ty . second -> dump ( ) ; else dbgs ( ) << <STR_LIT> ; dbgs ( )


<s> IList . append ( Elm -> idx_begin ( ) , Elm -> idx_begin ( ) + NumLeadingNonLeafArrDim + <NUM_LIT> ) ; } else IList . append ( Elm -> idx_begin ( ) , Elm -> idx_end ( ) ) ; User * OnlyUse = * ( Elm -> user_begin ( ) ) ; if ( dyn_cast < GetElementPtrInst > ( OnlyUse ) ) { InsertIntoSet ( LazyRemovalSet


<s> Type * MPT = GetMostPreferredTypeForStruct ( Func -> getContext ( ) , TyVec , NumElements ) ; NewTy = ArrayType :: get ( MPT , NumElements ) ; typeIsBlasted [ Ty ] = false ; } else { NewTy = StructType :: get ( Cxt , TyVec ) ; typeIsBlasted [ Ty ] = true ; } if ( Ty -> isPointerTy ( ) ) return PointerType :: get ( NewTy , cast < PointerType > ( Ty ) -> getAddressSpace ( ) ) ; else return NewTy


<s> Type * MPT = Type :: getInt32Ty ( Cxt ) ; for ( auto Ty : TyVec ) { int ElmCnt = <NUM_LIT> ; Type * ElmTy = nullptr ; if ( isa < ArrayType > ( Ty ) ) { ElmCnt = cast < ArrayType > ( Ty ) -> getNumElements ( ) ; ElmTy = cast < ArrayType > ( Ty ) -> getElementType ( ) ; while ( isa < ArrayType > ( ElmTy ) ) { ElmCnt *= cast < ArrayType > ( ElmTy ) -> getNumElements ( ) ; ElmTy = cast < ArrayType > ( ElmTy ) -> getElementType ( ) ; } } else { ElmTy = Ty ; ElmCnt = <NUM_LIT> ; } if ( ElmTy -> getPrimitiveSizeInBits ( ) > MPT -> getPrimitiveSizeInBits ( ) ) { ElmCnt *= ElmTy -> getPrimitiveSizeInBits ( ) / MPT -> getPrimitiveSizeInBits ( ) ; llvm_unreachable ( <STR_LIT> ) ; } NumElements +=


<s> Type * ElmTy = cast < ArrayType > ( Ty ) -> getElementType ( ) ; bool exploreArr = ! CheckIfFlattendType ( ElmTy ) || ! AccessMemFormFlatStruct ; if ( isa < StructType > ( ElmTy ) || ( isa < ArrayType > ( ElmTy ) && exploreArr ) ) { int NumArrElems = cast < ArrayType > ( Ty ) -> getNumElements ( ) ; NumElems += NumArrElems * getNumElements ( ElmTy , AccessMemFormFlatStruct ) ; } else NumElems += exploreArr ? cast < ArrayType > ( Ty ) -> getNumElements ( ) : <NUM_LIT> ; } else if ( isa < PointerType > ( Ty )


<s> static unsigned GetNumLeadingNonLeafArrDim ( GetElementPtrInst * GI ) { if ( GI -> getNumIndices ( ) > <NUM_LIT> ) return ( GI -> getNumIndices ( )

- ( GetNumLeafArrayDimensions ( GI ) + <NUM_LIT> ) ) ;


<s> static unsigned GetNumLeafArrayDimensions ( GetElementPtrInst * V ) { int i = <NUM_LIT> ; SmallVector < Type * , <NUM_LIT> > WorkList ; for ( gep_type_iterator Itr = gep_type_begin ( V ) ; Itr != gep_type_end ( V ) ; Itr ++ ) WorkList . push_back ( Itr . getIndexedType ( ) ) ; WorkList . pop_back ( ) ; while ( WorkList . size ( ) ) { Type * Ty = WorkList .


<s> OTy = GetRootType ( OTy ) ; gep_type_iterator IdxTyItr = gep_type_begin ( GI ) ; assert ( OTy == IdxTyItr . getIndexedType ( ) && <STR_LIT> ) ; return getTyIndexInFlattenedType_core ( Func , ConstantInt :: get ( Int32Ty , APInt ( <NUM_LIT> , <NUM_LIT> ) )


<s> IdxOffset = ConstantInt :: get ( Int32Ty , CumulativeIndex ) ; } else if ( NextRef == ArrayElemRef ) { IdxOffset = IRB . CreateBinOp ( Instruction :: Mul , ConstantInt :: get ( Int32Ty , APInt ( <NUM_LIT> , getNumElements ( cast < ArrayType > ( PrevTy ) -> getElementType ( ) , AccessMemFormFlatStruct ) ) ) , IdxVal ) ; } else IdxOffset = IdxVal ; if ( isa < ArrayType > ( IdxTy ) ) NextRef = ArrayElemRef ; else if ( isa < StructType > ( IdxTy ) || isa < PointerType > ( IdxTy ) ) NextRef = StructFieldRef ; else NextRef = ScalarRef ; Idx = IRB . CreateBinOp ( Instruction :: Add , Idx , IdxOffset ) ; if ( -- NumLeadingNonLeafArrDim == <NUM_LIT> ) return Idx ; PrevTy = IdxTy ; } if ( isa < GetElementPtrInst > ( * ( GI -> user_begin ( ) ) ) ) return getTyIndexInFlattenedType_core ( Func , Idx , cast < GetElementPtrInst > ( * ( GI -> user_begin ( )


<s> bool CompositeHandler :: isBlastedType ( Type *


<s> assert ( typeIsBlasted . find ( Ty ) != typeIsBlasted .


<s> dump ( ) ; flattenTypes ( ) ; dump ( ) ; doAllocations ( ) ; doReplacements (


<s> void CompositeHandler :: replaceAllUsesWithUnwrapped ( Value * Old , Value * New ) { assert ( Old -> getType ( ) != New -> getType (


<s> assert ( Old -> getType ( ) != New -> getType ( ) && <STR_LIT> ) ; for ( auto * User : Old -> users ( ) ) for ( unsigned i = <NUM_LIT> ; i < User -> getNumOperands ( ) ; i ++ )

if ( User -> getOperand ( i ) == Old ) User -> setOperand ( i , New ) ;


<s> void CompositeHandler :: replaceCastChainAndMemIntrinsics ( Type * Ty , BitCastInst * V , ValueSet & LazyRemovalSet , ValueVec & ValArr ) { if ( ! isa < BitCastInst > ( V ) || ! cast < BitCastInst > ( V ) -> hasOneUse ( ) ) return ; Value * OnlyUser = * ( V -> user_begin ( ) ) ; if ( isa < CallInst > ( OnlyUser ) && cast < CallInst > ( OnlyUser ) -> getCalledFunction ( ) ) { unsigned ID = cast < CallInst > ( OnlyUser ) -> getCalledFunction ( ) -> getIntrinsicID ( ) ; assert ( ( ID == <STR_LIT> || ID == <STR_LIT>


<s> Value * Base = AIArr [ <NUM_LIT> ] ; Type * Int32Ty = Type :: getInt32Ty ( Func -> getContext ( ) ) ; Mem = IRB . CreateGEP ( Base , { ConstantInt :: get ( Int32Ty , APInt ( <NUM_LIT> , <NUM_LIT> ) ) , AIArrIdx } ) ; } if ( isa < ArrayType > ( IndexType ) ) { int NumLeadingNonLeafArrDim = GetNumLeadingNonLeafArrDim ( lastGEP ) ; bool CreateNewLeafGEP = NumLeadingNonLeafArrDim > <NUM_LIT> ; if ( CreateNewLeafGEP ) { IRB . SetInsertPoint ( lastGEP ) ; SmallVector < Value * , <NUM_LIT> > IdxVec ; IdxVec . append ( lastGEP -> idx_begin ( ) + NumLeadingNonLeafArrDim , lastGEP -> idx_end ( ) ) ; Value * NewGEP = IRB . CreateGEP ( Mem , IdxVec ) ; lastGEP -> replaceAllUsesWith ( NewGEP ) ; InsertIntoSet ( LazyRemovalSet , lastGEP ) ; } else lastGEP -> getOperand ( <NUM_LIT> ) -> replaceAllUsesWith ( Mem ) ; } else if ( isa < StructType > ( IndexType ) ) { replaceAllUsesWithUnwrapped ( lastGEP , Mem ) ; InsertIntoSet ( LazyRemovalSet , lastGEP ) ; } else { lastGEP -> replaceAllUsesWith ( Mem ) ; InsertIntoSet ( LazyRemovalSet , lastGEP )


<s> unsigned TySize = Func -> getParent ( ) -> getDataLayout ( ) . getTypeSizeInBits ( RootTy ) / <NUM_LIT> ; IRBuilder < > IRB ( CI ) ; if ( isa < ConstantInt > ( Size ) && TySize == cast < ConstantInt > ( Size ) -> getZExtValue ( ) ) { copyMemory ( Dst , Src , Ty , ValArr , IRB ) ; RemoveInstrs . push_back ( CI ) ; for ( auto Val : RemoveInstrs ) InsertIntoSet ( LazyRemovalSet , Val ) ; } else { llvm_unreachable (


<s> ValueVec RemoveInstrs ; auto GetRootValue = [ & ] ( Value * V ) -> Value * { while ( isa < CastInst > ( V ) ) { RemoveInstrs . push_back ( V ) ; V = cast < User > ( V ) -> getOperand ( <NUM_LIT> ) ; } return V ; } ; Value * Dst = CI -> getOperand ( <NUM_LIT> ) ; Value * Src = CI -> getOperand ( <NUM_LIT> ) ; Value * Size = CI -> getOperand ( <NUM_LIT> ) ; Dst = GetRootValue ( Dst


<s> void CompositeHandler :: visitAlloca (


<s> void CompositeHandler :: visitCallInst ( CallInst & I ) { for ( Value * Arg : I . arg_operands ( ) ) { visitValue ( Arg , Arg -> getType ( )


<s> if ( canFlattenType ( VT ) ) { if ( typeDefs . find ( VT ) == typeDefs . end ( ) ) typeDefs [ VT ] = nullptr ; typeValues [ VT ] . push_back ( V


<s> if ( EraseSet . find ( MI ) == EraseSet . end ( ) ) EraseSet .


<s> for ( DeferredEraseSetIter I = EraseSet . begin ( ) , E = EraseSet . end ( ) ; I != E ; I ++


<s> I ++ ) { ( * I ) -> eraseFromParent ( ) ; } EraseSet . clear


<s> FunctionPass * create<ISA_LIT>CopyElision ( ) { return new <ISA_LIT>CopyElision


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MBB -> getName


<s> void <ISA_LIT>CopyElision :: ExitScope ( MachineBasicBlock * MBB ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MBB


<s> AU . setPreservesCFG ( ) ; MachineFunctionPass :: getAnalysisUsage ( AU ) ; AU . addRequired < MachineDominatorTree > (


<s> MachineOperand RHS = MI -> getOperand ( <NUM_LIT> ) ; const TargetRegisterClass * LHSRC = MRI -> getRegClass ( LHS . getReg ( ) ) ; const TargetRegisterClass * RHSRC = MRI -> getRegClass ( RHS . getReg ( ) ) ; if ( LHSRC !=


<s> Scopes . push_back ( Node ) ; const std :: vector < MachineDomTreeNode * > & Children = Node -> getChildren ( ) ; OpenChildren [ Node ] = Children . size ( ) ; for ( MachineDomTreeNode * Child : Children ) WorkList . push_back ( Child ) ; } while ( ! WorkList . empty ( ) ) ; for ( MachineDomTreeNode * Node : Scopes ) { MachineBasicBlock * MBB = Node -> getBlock ( ) ; EnterScope ( MBB ) ; ProcessCopyElisionBlock ( MBB


<s> DenseMap < MachineDomTreeNode * , unsigned > OpenChildren ; WorkList . push_back ( Node ) ; do { Node = WorkList . pop_back_val ( ) ; Scopes . push_back ( Node ) ; const std :: vector < MachineDomTreeNode * > & Children = Node -> getChildren ( ) ; OpenChildren [ Node ] = Children . size ( ) ; for ( MachineDomTreeNode * Child : Children ) WorkList . push_back ( Child ) ; } while ( ! WorkList . empty ( ) ) ; for ( MachineDomTreeNode * Node : Scopes ) { MachineBasicBlock * MBB = Node -> getBlock ( ) ; EnterScope ( MBB


<s> MachineOperand MORHS = MI -> getOperand ( <NUM_LIT> ) ; unsigned NewReg = MRI -> createVirtualRegister ( MRI -> getRegClass ( MORHS . getReg ( ) ) ) ; if ( HasConstantDriver ( MRI , MORHS , isInt , & ConstNode ) ) { BuildMI ( * MBB , I , MI -> getDebugLoc ( ) , TII -> get ( <STR_LIT> ( MRI -> getRegClass ( MORHS . getReg ( ) ) ) ) ) . addDef ( NewReg ) . addImm ( ConstNode -> getOperand ( <NUM_LIT> ) . getImm ( ) ) ; AddToDeferredEraseSet ( ConstNode ) ; } else { unsigned LoadOpcode = <STR_LIT> ( MRI -> getRegClass ( MORHS . getReg ( ) ) ) ; BuildMI ( * MBB , I , MI -> getDebugLoc ( ) , TII -> get ( LoadOpcode ) ) . addDef ( NewReg ) . addUse ( MORHS . getReg ( ) ) ; } MachineOperand MOLHS = MI -> getOperand ( <NUM_LIT> ) ; unsigned StoreOpcode = <STR_LIT> ( MRI -> getRegClass ( MOLHS . getReg ( ) ) ) ; BuildMI ( * MBB , I , MI -> getDebugLoc ( ) , TII -> get ( StoreOpcode ) ) . addDef ( MOLHS . getReg ( ) ) . addUse ( NewReg ) ; AddToDeferredEraseSet (


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MBB -> getName ( ) << '\n' ) ; bool isInt ; MachineInstr * ConstNode = nullptr ; MachineOperand MORHS = MI -> getOperand ( <NUM_LIT> ) ; unsigned NewReg = MRI -> createVirtualRegister ( MRI -> getRegClass ( MORHS . getReg ( ) ) ) ; if ( HasConstantDriver ( MRI , MORHS , isInt , & ConstNode ) ) { BuildMI ( * MBB , I , MI -> getDebugLoc ( ) , TII -> get ( <STR_LIT> ( MRI -> getRegClass ( MORHS . getReg ( ) ) ) ) ) . addDef ( NewReg ) . addImm ( ConstNode -> getOperand ( <NUM_LIT> ) . getImm ( ) ) ; AddToDeferredEraseSet ( ConstNode ) ; } else { unsigned LoadOpcode = <STR_LIT> ( MRI -> getRegClass ( MORHS . getReg ( ) ) ) ; BuildMI ( * MBB , I , MI -> getDebugLoc ( ) , TII -> get ( LoadOpcode ) ) .

addDef ( NewReg ) . addUse ( MORHS . getReg ( ) ) ;


<s> MCDisassembler :: DecodeStatus <ISA_LIT>Disassembler :: getInstruction ( MCInst & MI , uint64_t & Size , ArrayRef < uint8_t > Bytes , uint64_t , raw_ostream & OS , raw_ostream


<s> void LLVMInitialize<ISA_LIT>Disassembler ( ) { TargetRegistry :: RegisterMCDisassembler ( getThe<ISA_LIT>Target32 ( ) , create<ISA_LIT>Disassembler ) ; TargetRegistry :: RegisterMCDisassembler ( getThe<ISA_LIT>Target64 ( ) ,


<s> bool <ISA_LIT>FrameLowering :: hasFP ( const MachineFunction & MF ) const { return false


<s> void <ISA_LIT>InstPrinter :: printInst ( const MCInst * MI , raw_ostream & OS , StringRef Annot ,


<s> assert ( DescVec && <STR_LIT> ) ; StringRef Desc = ( * DescVec ) [ MI -> getOperand ( OpNo )


<s> if ( Op . isReg ( ) ) { llvm_unreachable ( <STR_LIT> ) ; } else if ( Op . isImm ( ) ) { O << Op . getImm ( ) ; } else if ( Op . isFPImm ( ) ) { assert ( OpNo < Desc . getNumOperands ( ) && <STR_LIT> ) ; assert ( Desc . TSFlags == <NUM_LIT> && <STR_LIT> ) ; if ( Info . OperandType == <STR_LIT> ) { O << Op . getFPImm ( ) ; } else { assert ( Info . OperandType == <STR_LIT> ) ; O << Op . getFPImm (


<s> } else { assert ( ! CBR && <STR_LIT> ) ; CBR = & MI ; } } if ( nullptr == CBR && nullptr == UBR ) return true ; else if ( UBR && ! CBR ) { TBB = UBR -> getOperand ( <NUM_LIT> ) . getMBB ( ) ; } else if ( CBR ) { TBB = CBR -> getOperand ( CBR -> getNumOperands ( ) - <NUM_LIT> ) . getMBB ( ) ; for ( unsigned i = <NUM_LIT> ; i < CBR -> getNumOperands ( ) - <NUM_LIT> ; i ++ ) Cond . push_back ( CBR -> getOperand ( i ) ) ; FBB = UBR ? UBR -> getOperand ( <NUM_LIT> ) . getMBB ( ) : nullptr ; } else { llvm_unreachable ( <STR_LIT> ) ; } return


<s> bool analyzeSelect ( const MachineInstr & MI , SmallVectorImpl < MachineOperand > & Cond , unsigned & TrueOp ,

unsigned & FalseOp , bool & Optimizable ) const override {


<s> void <ISA_LIT>InstrInfo :: copyPhysReg ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator I , const DebugLoc & DL , unsigned DestReg , unsigned SrcReg , bool KillSrc ) const { llvm_unreachable ( <STR_LIT>


<s> else if ( ! IsConditionalBranch ( MI ) ) return MI . getOperand ( <NUM_LIT> ) . getMBB ( ) ; else return MI . getOperand ( MI . getNumOperands ( )


<s> bool <ISA_LIT>InstrInfo :: IsConditionalBranch ( const MachineInstr & MI ) const { assert ( MI . isBranch ( ) && <STR_LIT> ) ; switch ( MI . getOpcode ( ) ) { default : return true


<s> II . replaceAllUsesWith ( Const ) ; DelList . push_back ( & II ) ; } for ( auto Inst : DelList ) { DropAllReferences ( Inst ) ; Inst -> removeFromParent ( )


<s> for ( Use & U : V -> operands ( ) ) { if ( isa < ConstantExpr > ( U . get ( ) ) ) DropAllReferences ( cast < User > ( U . get (


<s> void <ISA_LIT>IRDecorator :: DropAllReferences ( User * V ) { for ( Use & U : V -> operands ( ) ) { if ( isa < ConstantExpr > ( U . get ( ) ) ) DropAllReferences ( cast < User > ( U . get ( ) ) ) ; U . set


<s> void <ISA_LIT>IRDecorator :: EmitArgumentInitializationWrappers ( ) { LLVM_DEBUG ( dbgs ( )


<s> void getAnalysisUsage ( AnalysisUsage &


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


<s> void <ISA_LIT>IRDecorator :: HandleBitCastOperation ( Function *


<s> TyDefCol . setFunction ( * F ) ; TyDefCol . ProcessFunction (


<s> void <ISA_LIT>IRDecorator :: HandleGlobalConstants ( Function * F ) { Module * M = F -> getParent ( ) ; if ( M -> global_empty ( ) ) return ; unsigned FieldIndex = <NUM_LIT> ; SmallVector < Type * , <NUM_LIT> > TypeList ; SmallVector < Constant * , <NUM_LIT> > InitVals ; GlobFieldOffsetMap GlobOffsetMap ; for ( auto & Glob : M -> globals ( ) ) { TypeList . push_back ( GetRootType ( Glob . getType ( ) ) ) ; InitVals . push_back ( Glob . getInitializer ( ) ) ; GlobOffsetMap [ & Glob ] = FieldIndex


<s> for ( auto & BB : * F ) for ( auto & II : BB ) if ( isa < SelectInst >

( & II ) ) WorkList . push_back ( & II ) ;


<s> BasicBlock * NewBlk = OldTI -> getParent ( ) ; BasicBlock * TrueBlk = BasicBlock :: Create ( Cxt , NewBlk -> getName ( ) + <STR_LIT> , Func ) ; TrueBlk -> moveAfter ( NewBlk ) ; BasicBlock * FalseBlk = BasicBlock :: Create ( Cxt , NewBlk -> getName ( ) + <STR_LIT> , Func ) ; FalseBlk -> moveAfter ( TrueBlk ) ; IRB . SetInsertPoint ( OldTI ) ; IRB . CreateCondBr ( Cond , TrueBlk , FalseBlk ) ; OldTI -> eraseFromParent ( ) ; IRB . SetInsertPoint ( TrueBlk ) ; IRB . CreateBr ( EndBlk ) ; IRB . SetInsertPoint ( FalseBlk ) ; IRB . CreateBr ( EndBlk ) ; IRB . SetInsertPoint ( EndBlk -> getFirstNonPHI ( ) ) ; PHINode * PHI = IRB . CreatePHI ( Select -> getType ( ) , <NUM_LIT> ) ; PHI -> addIncoming ( TrueVal , TrueBlk ) ; PHI -> addIncoming ( FalseVal , FalseBlk ) ; Select -> replaceAllUsesWith ( PHI )


<s> Value * FalseVal = Select -> getFalseValue ( ) ; BasicBlock :: iterator SplitIt = Select -> getIterator ( ) ; BasicBlock * EndBlk = SplitBlock ( Select -> getParent ( ) , & * ++ SplitIt , DT ) ; Instruction * OldTI = cast < Instruction > ( * EndBlk -> user_begin ( ) ) ; BasicBlock * NewBlk = OldTI -> getParent ( ) ; BasicBlock * TrueBlk = BasicBlock :: Create ( Cxt , NewBlk -> getName ( ) + <STR_LIT> , Func ) ; TrueBlk -> moveAfter ( NewBlk ) ; BasicBlock * FalseBlk = BasicBlock :: Create ( Cxt , NewBlk -> getName ( ) + <STR_LIT> , Func ) ; FalseBlk -> moveAfter ( TrueBlk ) ; IRB . SetInsertPoint ( OldTI ) ; IRB . CreateCondBr ( Cond , TrueBlk , FalseBlk ) ; OldTI -> eraseFromParent ( ) ; IRB . SetInsertPoint ( TrueBlk ) ; IRB . CreateBr ( EndBlk ) ; IRB . SetInsertPoint ( FalseBlk ) ; IRB . CreateBr


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; Func -> dump ( ) ; FixupCompositeIndexes ( Func ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; Func -> dump ( ) ; LinearizeGEPChains ( Func ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; Func -> dump ( ) ; UniquifyGEPOperands ( Func ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; Func -> dump ( ) ; PerformIRFixups ( Func ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; Func -> dump


<s> void <ISA_LIT>IRDecorator :: ReplaceConstantGlobsRefs ( GlobalVariable * GV , GlobalVariable * GCStruct , GlobFieldOffsetMap & GlobOffsetMap ) { LLVMContext & Cxt = Func -> getContext ( ) ; const DataLayout & DL = Func -> getParent ( ) -> getDataLayout ( ) ; Type * TargetIdxTy = GetTargetIndexType ( DL , Cxt ) ; SmallVector < Instruction * , <NUM_LIT> > RemoveList ; SmallVector < std :: pair < Instruction * , Value * > , <NUM_LIT> > UserGEPClonePairVec ; for ( auto Use = GV -> use_begin ( ) ; Use != GV -> use_end ( ) ; Use ++ ) { SmallVector < Value * , <NUM_LIT> > Indices ; unsigned FldIndex = GlobOffsetMap [ GV ] ; Indices . push_back ( ConstantInt :: get ( TargetIdxTy , <NUM_LIT> ) ) ; Indices . push_back ( ConstantInt :: get ( TargetIdxTy


<s> DT = & getAnalysis < DominatorTreeWrapperPass > ( ) . getDomTree ( ) ; return ProcessFunction ( )


<s> DT = & getAnalysis < DominatorTreeWrapperPass > ( ) . getDomTree ( ) ; return ProcessFunction (


<s> if ( isa < GetElementPtrInst > ( GEPPtr ) ) { SmallVector < Value * , <NUM_LIT> > Indices ; for ( auto & Index : cast < GetElementPtrInst > ( GEPPtr ) -> indices ( ) ) Indices . push_back ( Index ) ; IRBuilder < > IRB ( cast < Instruction >


<s> if ( isa < GetElementPtrInst > ( GEPPtr ) ) { SmallVector < Value * , <NUM_LIT> > Indices ; for ( auto & Index : cast < GetElementPtrInst > ( GEPPtr ) -> indices ( ) ) Indices . push_back ( Index ) ; IRBuilder < > IRB ( cast < Instruction


<s> for ( auto & BB : * F ) for ( auto & II : BB ) if ( isa < GetElementPtrInst > ( & II ) ) { for ( auto * User : II . users ( ) ) { if ( ! isa < GetElementPtrInst > ( User ) ) { WorkList . push_back ( & II ) ; break ; } } } for ( auto * II : WorkList ) { GetElementPtrInst * GEP = cast < GetElementPtrInst > ( II ) ; if ( GEP -> use_empty ( ) ) continue ; SmallVector < Value * , <NUM_LIT> > Indices ; for ( auto & Index : GEP -> indices ( ) ) Indices . push_back ( Index ) ; Value * GEPclone = nullptr ; SmallVector < std :: pair < Instruction * , Value


<s> return new <ISA_LIT>DAGToDAGISel ( TM


<s> FunctionPass * llvm :: create<ISA_LIT>ISelDag ( <ISA_LIT>TargetMachine & TM , CodeGenOpt :: Level OptLevel ) { return new <ISA_LIT>DAGToDAGISel ( TM ,


<s> StringRef getPassName ( ) const override { return <STR_LIT>


<s> ForCodeSize = MF . getFunction ( ) . hasFnAttribute ( Attribute :: OptimizeForSize ) || MF . getFunction ( ) . hasFnAttribute ( Attribute :: MinSize ) ; Subtarget = & MF . getSubtarget < <ISA_LIT>Subtarget > ( ) ; <ISA_LIT>FunctionInfo * MFI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; for ( auto & STy : Cxt . getNamedStructTypes ( ) ) MFI -> addToTypeNameMap ( STy . getValue ( ) ) ; const Function & F = MF . getFunction ( ) ; if ( F . hasFnAttribute ( Attribute :: <ISA_LIT>InstMethod ) ) { const Module * Mod = F . getParent ( ) ; StringRef ModName = Mod -> getName ( ) ; const GlobalVariable * GCStructObj = Mod -> getNamedGlobal ( <STR_LIT> ) ; assert ( GCStructObj && <STR_LIT> ) ; std :: string ClassName = ModName . substr ( <NUM_LIT> , ModName .


<s> static bool CallingConvSupported ( CallingConv :: ID CallConv ) { return CallConv == CallingConv :: C


<s> static bool CallingConvSupported ( CallingConv


<s> bool <ISA_LIT>TargetLowering :: CanLowerReturn ( CallingConv :: ID , MachineFunction & , bool , const SmallVectorImpl < <STR_LIT> > & Outs , LLVMContext & ) const { return Outs . size


<s> bool <ISA_LIT>TargetLowering :: CanLowerReturn ( CallingConv :: ID , MachineFunction & , bool ,

const SmallVectorImpl < <STR_LIT> > & Outs , LLVMContext & ) const {


<s> SDNodeFlags Flags = V . getNode ( ) ->


<s> const AllocaInst * AI = cast < const AllocaInst > ( & I ) ; SDValue ArrSz = SDB -> getValue ( AI -> getArraySize ( ) ) ; EVT VTs [ ] = { CompVT , <STR_LIT> } ; SDValue Ops [ ] = { SDB -> getRoot ( ) , ArrSz , DAG . getConstant ( <NUM_LIT> , DL , <STR_LIT> ) } ; SDValue DSA = DAG . getNode ( <STR_LIT> , DL , VTs , Ops ) ; Type * AllocatedTy = AI -> getAllocatedType ( ) ; MFI -> addToNodeTypeMap ( DSA . getNode ( ) , AllocatedTy ) ; if ( isa < StructType > ( AllocatedTy ) ) MFI -> addToTypeNameMap ( AllocatedTy ) ; DAG . setRoot ( DSA . getValue ( <NUM_LIT>


<s> SDValue <ISA_LIT>TargetLowering :: createAllocationMacros ( SelectionDAGBuilder * SDB , const User & I , const SDLoc & DL ) const { SelectionDAG & DAG = SDB -> DAG ; <ISA_LIT>FunctionInfo * MFI = DAG . getMachineFunction ( ) . getInfo < <ISA_LIT>FunctionInfo > ( ) ; EVT CompVT ( <STR_LIT> ) ; const AllocaInst * AI = cast < const AllocaInst > ( & I ) ; SDValue ArrSz = SDB -> getValue ( AI -> getArraySize ( ) ) ; EVT VTs [ ] = { CompVT , <STR_LIT> } ; SDValue Ops [ ] = { SDB -> getRoot ( ) , ArrSz , DAG . getConstant ( <NUM_LIT> , DL , <STR_LIT> ) } ; SDValue DSA = DAG . getNode ( <STR_LIT> , DL , VTs , Ops ) ; Type * AllocatedTy = AI -> getAllocatedType ( ) ; MFI -> addToNodeTypeMap ( DSA . getNode ( ) , AllocatedTy


<s> GTI != E ; ++ GTI ) { NumIndices -- ; const Value * Idx = GTI . getOperand ( ) ; Type * IdxTy = GTI . getIndexedType ( ) ; if ( NextIndex == ARRAY_REF || NextIndex == STRUCT_REF ) { unsigned NodeOpcode = NextIndex == STRUCT_REF ? <STR_LIT> : <STR_LIT> ; IsInChain |= <NUM_LIT> << <NUM_LIT> ; IsInChain |= ( <NUM_LIT> == NumIndices ) << <NUM_LIT> ; SDValue InChainUse = DAG . getConstant ( IsInChain , dl , <STR_LIT> ) ; IsInChain &= ~ <NUM_LIT> ; SDValue Ops [ ] = { SDB -> getRoot ( ) , N , SDB -> getValue ( Idx ) , InChainUse } ; if ( isa < CompositeType > ( IdxTy ) ) { EVT VTs [ ] = { <STR_LIT> , <STR_LIT> } ; N = DAG . getNode ( NodeOpcode , dl , VTs , Ops ) ; SDNodeFlags Flags = N . getNode ( ) -> getFlags ( ) ; Flags . setIsComposite ( true ) ; N . getNode ( ) -> setFlags ( Flags ) ; } else { EVT IdxVT = getValueType ( DL , IdxTy ) ; EVT VTs [ ] = { IdxVT , <STR_LIT>


<s> <ISA_LIT>FunctionInfo * MFI = DAG . getMachineFunction ( ) . getInfo < <ISA_LIT>FunctionInfo > ( ) ; PointerType * MemPtr = cast < PointerType > ( PtrVal -> getType ( ) ) ; assert ( isa < StructType > ( MemPtr -> getElementType ( ) ) || isa < ArrayType > ( MemPtr -> getElementType ( ) ) ) ; int NumIndices = cast < GetElementPtrInst > ( & I ) -> getNumIndices ( ) ; int IsInChain = ! isa < GetElementPtrInst > ( PtrVal ) ; for ( gep_type_iterator GTI = gep_type_begin ( & I ) , E = gep_type_end ( & I ) ; GTI != E ; ++ GTI ) { NumIndices -- ; const Value * Idx = GTI . getOperand ( ) ; Type * IdxTy = GTI . getIndexedType ( ) ; if ( NextIndex == ARRAY_REF || NextIndex == STRUCT_REF ) { unsigned NodeOpcode = NextIndex == STRUCT_REF ? <STR_LIT> : <STR_LIT> ; IsInChain |= <NUM_LIT> << <NUM_LIT> ; IsInChain |= ( <NUM_LIT> == NumIndices ) << <NUM_LIT> ; SDValue InChainUse = DAG . getConstant ( IsInChain , dl , <STR_LIT> ) ; IsInChain &= ~ <NUM_LIT> ; SDValue Ops [ ] = { SDB -> getRoot ( ) , N , SDB -> getValue ( Idx ) , InChainUse } ; if ( isa < CompositeType > ( IdxTy ) ) { EVT VTs [ ] = { <STR_LIT> , <STR_LIT> } ; N = DAG . getNode ( NodeOpcode


<s> auto & MRI = MF . getRegInfo ( ) ; MRI . freezeReservedRegs (


<s> auto & MRI = MF . getRegInfo ( ) ; MRI . freezeReservedRegs


<s> SDValue Chain = Alloc . getValue ( <NUM_LIT> ) ; EVT DupVTs [ ] = { Alloc . getValueType ( ) , <STR_LIT> } ; SDValue DupOps [ ] = { Chain , Alloc } ; SDValue Dup = DAG . getNode ( <STR_LIT> , dl , DupVTs , DupOps ) ; Chain = Dup . getValue ( <NUM_LIT> ) ; std :: string MethodDescStr = MFI -> getFromTypeNameMap


<s> SDValue Chain = Mem . getValue ( <NUM_LIT> ) ; EVT AllocStoreVTs [ ] = { Mem . getValueType ( ) , <STR_LIT> } ; SDValue AllocStoreOps [ ] = { Chain , Mem } ; SDValue AllocStore = DAG . getNode ( <STR_LIT> , dl , AllocStoreVTs , AllocStoreOps ) ; SDNodeFlags Flags = AllocStore . getNode ( ) -> getFlags ( ) ; Flags . setIsComposite (


<s> assert ( Mem . getNode ( ) -> getValueType ( Mem . getNode ( ) -> getNumValues ( ) - <NUM_LIT> ) == <STR_LIT> ) ; SDValue Chain = Mem . getValue ( <NUM_LIT> ) ; EVT AllocStoreVTs [ ] = { Mem . getValueType ( ) , <STR_LIT> } ; SDValue AllocStoreOps [ ] = { Chain , Mem } ; SDValue AllocStore = DAG . getNode ( <STR_LIT> , dl , AllocStoreVTs , AllocStoreOps ) ; SDNodeFlags Flags = AllocStore . getNode ( ) -> getFlags ( ) ; Flags . setIsComposite ( isComposite ) ; AllocStore . getNode ( ) -> setFlags ( Flags ) ; return


<s> unsigned N = Node -> getNumValues ( ) ; while ( N && Node -> getValueType ( N - <NUM_LIT>


<s> <ISA_LIT>FunctionInfo * MFI = DAG . getMachineFunction ( ) . getInfo < <ISA_LIT>FunctionInfo > ( ) ; Type * ObjTy = MFI -> getFromNodeTypeMap ( Obj . getNode ( ) ) ; assert ( ObjTy && <STR_LIT> ) ; assert ( isa < StructType > ( ObjTy ) && <STR_LIT> ) ; assert ( isa < ConstantSDNode > ( Idx . getNode ( ) ) ) ; uint64_t IdxNum = cast < ConstantSDNode > ( Idx . getNode ( ) ) -> getZExtValue ( ) ; Type * FTy = cast < StructType > ( ObjTy ) -> getElementType ( ( unsigned )


<s> SDUse & Use = itr . getUse ( ) ; if ( CompRefNode != Use . getUser ( ) && Use . getValueType ( ) != <STR_LIT> ) { User =


<s> return Opcode == <STR_LIT> || Opcode == <STR_LIT> || Opcode == <STR_LIT> || Opcode == <STR_LIT> ||


<s> SDValue Ptr = Opr . getOperand ( <NUM_LIT> ) ; return ! Ptr . getNode ( ) -> getFlags ( ) . hasIsAbsorptionCandidate ( ) ; } case


<s> bool isSuitableForJumpTable ( const SwitchInst * SI , uint64_t NumCases , uint64_t Range ) const override { return false


<s> bool isSuitableForJumpTable ( const SwitchInst * SI , uint64_t NumCases ,


<s> static SDValue LoadOperand ( SelectionDAG & DAG , const SDLoc & DL , EVT VT , SDValue Val ) { SDNodeFlags Flags = Val . getNode ( ) -> getFlags ( ) ; auto CompatibleLoad = [ = ] ( SDValue Opr , EVT VT ) -> bool { if ( IsLoadOperand ( Opr ) && Opr . getValueType ( ) == VT ) return true ; else return false ; } ; bool CanSkipF = ( ! Flags . hasIsAbsorptionCandidate ( ) && ( CompatibleLoad ( Val ,

VT ) || IsLoadLike ( Val . getOpcode ( ) ) ) ) ;


<s> assert ( Vals [ <NUM_LIT> ] . getValueType ( ) == <STR_LIT> && VTs [ <NUM_LIT> ] == <STR_LIT> ) ; SDNode * ValNode = Vals [ <NUM_LIT> ] . getNode ( ) ; SDNodeFlags Flags = ValNode -> getFlags ( ) ; auto CompatibleLoad = [ = ] ( SDValue Opr , EVT VT ) -> bool { if ( Opr . getOpcode ( ) == <STR_LIT> && Opr . getValueType ( ) == VT ) return true ; else return


<s> LoadInp1 = DAG . getNode ( <STR_LIT> , DL , <STR_LIT> , Opr1 ) ; LoadInp2 = DAG . getNode ( <STR_LIT> , DL , <STR_LIT> , Opr2 ) ; if ( isa < ConstantSDNode > ( LoadInp1 . getNode ( ) ) ) LoadInp1 = LoadOperand ( DAG , DL , <STR_LIT> , LoadInp1 ) ; if ( isa < ConstantSDNode > ( LoadInp2 . getNode ( ) ) ) LoadInp2 = LoadOperand ( DAG , DL , <STR_LIT> , LoadInp2 ) ; BinOp = DAG . getNode ( LowerBinOp , DL ,


<s> return <STR_LIT> ; case <STR_LIT> : case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : case <STR_LIT> : return <STR_LIT> ; } } ; SDValue Chain = Op . getOperand ( <NUM_LIT> ) ; SDValue CondNode = Op . getOperand ( <NUM_LIT> ) ; SDValue Opr1 = Op . getOperand ( <NUM_LIT> ) ; SDValue Opr2 = Op . getOperand ( <NUM_LIT> ) ; SDValue BBlock = Op . getOperand ( <NUM_LIT> ) ; EVT VT = Opr1 . getValueType ( ) ; SDValue LoadInp1 = LoadOperand ( DAG , DL , VT , Opr1 ) ; SDValue LoadInp2 = LoadOperand ( DAG , DL , VT , Opr2 ) ; <STR_LIT> CCode = cast < CondCodeSDNode > ( CondNode . getNode ( ) ) -> get ( ) ; if ( VT == <STR_LIT> ) { SDValue Ops [ ] = { LoadInp2 , LoadInp1 } ; SDValue LCmp = DAG . getNode ( <STR_LIT> , DL , <STR_LIT> , Ops ) ; LoadInp1 = LCmp ; LoadInp2 = LoadOperand ( DAG , DL , <STR_LIT> , DAG . getConstant ( <NUM_LIT> , DL , <STR_LIT> ) ) ; CCode = GetNewCCode ( CCode ) ; } CondNode = DAG . getConstant ( CCode , DL , <STR_LIT> ) ; SDValue Ops [ ] = { Chain , CondNode , LoadInp1 , LoadInp2 ,


<s> SDValue LoadInp = LoadOperand ( DAG , DL , <STR_LIT> , CondNode ) ; SDValue CondCode = DAG . getConstant ( <STR_LIT> , DL , <STR_LIT> ) ; SDValue Ops [ ] = { Chain , CondCode , LoadInp , BBlock } ; SDValue BrConstcc = DAG . getNode ( <STR_LIT> , DL , <STR_LIT> , Ops ) ; TransferNodeFlagsWithGlue ( CondNode , BrConstcc ) ; return BrConstcc


<s> if ( isa < ArrayType > ( AllocatedTy ) ) { int IsClassArr = isa < StructType > ( cast < ArrayType > ( AllocatedTy ) -> getElementType ( ) ) ; int ArrSz = cast < ArrayType > ( AllocatedTy ) -> getNumElements ( ) ; SDValue ArrSzVal = DAG . getConstant ( ArrSz , dl , <STR_LIT> ) ; EVT LoadVTs [ ] = { ArrSzVal . getValueType ( ) , <STR_LIT> } ; SDValue LoadOps [ ] = { Chain , ArrSzVal } ; LoadSz = DAG . getNode ( <STR_LIT> , dl , LoadVTs , LoadOps ) ; Chain = LoadSz . getValue ( <NUM_LIT> ) ; SDValue Ops [ ] = { Chain , LoadSz , TypeStrID , DAG . getConstant ( <NUM_LIT> , dl , <STR_LIT> ) , DAG . getConstant ( IsClassArr , dl , <STR_LIT> ) } ; Alloc = DAG . getNode ( <STR_LIT> , dl , VTs , Ops ) ; } else if ( isa < StructType > ( AllocatedTy ) ) { SDValue Ops [ ] = { Chain , LoadSz , TypeStrID , DAG . getConstant ( <NUM_LIT> , dl , <STR_LIT> ) , DAG . getConstant


<s> if ( Op . getOpcode ( ) == <STR_LIT> ) return Op0 ; Op0 = LoadOperand ( DAG , DL , Op0 .


<s> SDLoc DL ( Op ) ; const GlobalValue * GV = cast < GlobalAddressSDNode > ( Op )


<s> assert ( Op . getOperand ( <NUM_LIT> ) . isUndef ( ) && <STR_LIT> ) ; EVT VTs [ ] = { Op . getValueType ( ) , <STR_LIT> } ; SDValue Ops [ ] = { Op . getOperand ( <NUM_LIT> ) , Ptr } ; return DAG . getNode ( <STR_LIT> , DL ,


<s> } assert ( Op . getOperand ( <NUM_LIT> ) . isUndef ( ) && <STR_LIT> ) ; SDValue LoadVal = LoadOperand ( DAG , DL , Val . getValueType ( ) , Val ) ; SDValue Ops [ ] = { Chain , LoadVal , Ptr } ; return DAG . getNode ( <STR_LIT> , DL , <STR_LIT>


<s> assert ( AloadNode -> getValueType ( AloadNode -> getNumValues ( ) - <NUM_LIT> ) == <STR_LIT> && <STR_LIT> ) ; EVT VTs [ ] = { Use . getOperand ( <NUM_LIT> ) . getValueType ( ) , <STR_LIT> } ; SDValue StoreSrc [ ] = { Chain , Use . getOperand ( <NUM_LIT> ) } ; SDValue SrcLoad = LoadOperandWCh ( DAG , DL , VTs , StoreSrc ) ; TransferNodeFlags ( Use . getOperand ( <NUM_LIT> ) , SrcLoad ) ; SDValue Opr [ ] = { SrcLoad . getValue ( <NUM_LIT> ) , Aload , SrcLoad , DescID } ; FieldAcc = DAG . getNode ( <STR_LIT> , DL , <STR_LIT> , Opr ) ; TransferNodeFlags ( Op , FieldAcc ) ; } else { EVT VTs [ ] = { Op . getValueType ( ) , <STR_LIT> } ; SDValue Opr [ ] = { Chain , Aload , DescID } ; FieldAcc = DAG . getNode ( <STR_LIT> , DL , VTs , Opr ) ; Chain = FieldAcc . getValue ( <NUM_LIT> ) ; TransferNodeFlags ( Op , FieldAcc ) ; if ( Use . getOpcode (


<s> SDValue Use = GetRefUse ( Op ) ; SDValue Aload = Obj ; if ( IS_START_OF_CHAIN ( InChainUseFlag ) ) { EVT VTs [ ] = { <STR_LIT> , <STR_LIT> } ; SDValue Ops [ ] = { Chain , Obj } ; Aload = DAG . getNode ( <STR_LIT> , DL , VTs , Ops ) ; SDNodeFlags Flags = Aload . getNode ( ) -> getFlags ( ) ; Flags . setIsComposite ( true ) ; Aload . getNode ( ) -> setFlags ( Flags ) ; Chain = Aload . getValue ( <NUM_LIT> ) ; } SDValue DescID = GetFieldSpecDescID ( DL , DAG , Obj , Idx ) ; SDNodeFlags Flags = Op . getNode ( ) -> getFlags ( ) ; Idx . getNode ( ) -> setFlags ( Flags ) ; SDValue FieldAcc ; if ( Use . getOpcode ( ) == <STR_LIT> ) { SDNode * AloadNode = Aload . getNode ( ) ; assert ( AloadNode -> getValueType ( AloadNode -> getNumValues ( ) - <NUM_LIT> ) == <STR_LIT> && <STR_LIT> ) ; EVT VTs [ ] = { Use . getOperand ( <NUM_LIT> ) . getValueType ( ) , <STR_LIT> } ; SDValue StoreSrc [ ] = { Chain , Use . getOperand ( <NUM_LIT> ) } ; SDValue SrcLoad = LoadOperandWCh ( DAG , DL , VTs , StoreSrc ) ; TransferNodeFlags ( Use . getOperand ( <NUM_LIT> ) , SrcLoad ) ; SDValue Opr [ ] = { SrcLoad . getValue ( <NUM_LIT> ) , Aload , SrcLoad , DescID } ; FieldAcc = DAG . getNode ( <STR_LIT> , DL , <STR_LIT> , Opr ) ; TransferNodeFlags ( Op , FieldAcc ) ; } else { EVT VTs [ ] = { Op . getValueType ( ) , <STR_LIT> } ; SDValue Opr [ ] = { Chain , Aload , DescID } ; FieldAcc = DAG . getNode ( <STR_LIT> , DL , VTs , Opr ) ; Chain = FieldAcc . getValue ( <NUM_LIT> ) ; TransferNodeFlags ( Op , FieldAcc ) ; if ( Use . getOpcode ( ) == <STR_LIT> ) { EVT StoreVTs [ ] = { FieldAcc . getValueType ( ) , <STR_LIT> } ; SDValue StoreOps [ ] = { Chain , FieldAcc } ; FieldAcc = DAG . getNode ( <STR_LIT> , DL , StoreVTs , StoreOps ) ; Chain = FieldAcc . getValue ( <NUM_LIT> ) ; SDNodeFlags Flags ; Flags . setIsComposite ( Op . getNode ( ) -> getFlags ( ) . hasIsComposite ( ) ) ; FieldAcc . getNode ( ) -> setFlags ( Flags ) ; } } if ( Use . getOpcode ( ) == <STR_LIT> || Use . getOpcode ( ) == <STR_LIT> ) ReplaceAllUsesOfValueAndChain ( false , DAG ,


<s> NewChNum = GetChainOperandNumFromValue ( New ) ; if ( OldChNum >= <NUM_LIT> && NewChNum >= <NUM_LIT> ) DAG . ReplaceAllUsesOfValueWith ( Old . getValue ( OldChNum ) , New . getValue ( NewChNum ) ) ; else if ( OldChNum >= <NUM_LIT> ) { assert ( Old . getOperand ( <NUM_LIT> ) . getValueType ( ) . getSimpleVT ( ) == <STR_LIT> ) ; SDValue OldParentCh = Old .


<s> static void ReplaceAllUsesOfValueAndChain ( bool RepOnlyChain , SelectionDAG & DAG , SDValue Old , SDValue New ) { int OldChNum , NewChNum ; if ( false == RepOnlyChain ) DAG . ReplaceAllUsesOfValueWith ( Old , New ) ; OldChNum = GetChainOperandNumFromValue ( Old ) ; NewChNum = GetChainOperandNumFromValue ( New ) ; if ( OldChNum >= <NUM_LIT> && NewChNum >= <NUM_LIT> ) DAG . ReplaceAllUsesOfValueWith ( Old . getValue ( OldChNum ) , New . getValue ( NewChNum ) ) ; else if ( OldChNum >= <NUM_LIT> ) { assert ( Old . getOperand ( <NUM_LIT> ) . getValueType ( ) . getSimpleVT ( ) == <STR_LIT> ) ; SDValue OldParentCh = Old . getOperand


<s> bool skipArgumentTypeValidation ( bool


<s> Flags . setGlueOperands ( false ) ; New . getNode ( ) -> setFlags ( Flags


<s> SDNodeFlags Flags = Old . getNode ( )


<s> SDNodeFlags Flags = Old . getNode ( ) -> getFlags ( ) ; Flags . setGlueOperands (


<s> FunctionPass * create<ISA_LIT>LoadStoreEliminationOpt ( ) { return new <ISA_LIT>LoadStoreEliminationOpt (


<s> void <ISA_LIT>LoadStoreEliminationOpt :: EnterScope ( MachineBasicBlock * MBB ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MBB


<s> void <ISA_LIT>LoadStoreEliminationOpt :: ExitScope ( MachineBasicBlock * MBB ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MBB -> getName ( ) <<


<s> void <ISA_LIT>LoadStoreEliminationOpt :: ExitScope (


<s> unsigned Left = -- OpenChildren [ Parent ] ; if ( Left != <NUM_LIT> ) break ; ExitScope ( Parent -> getBlock ( )


<s> DenseMap < MachineDomTreeNode * , unsigned > OpenChildren ; <ISA_LIT>FunctionInfo * FuncInfo = MF -> getInfo < <ISA_LIT>FunctionInfo > ( ) ; FuncInfo -> setLocalsLimit ( <NUM_LIT> ) ; WorkList . push_back ( Node ) ; do { Node = WorkList . pop_back_val ( ) ; Scopes . push_back ( Node ) ; const std :: vector < MachineDomTreeNode * > & Children = Node -> getChildren ( ) ; OpenChildren [ Node ] = Children . size ( ) ; for ( MachineDomTreeNode * Child : Children ) WorkList


<s> Scopes . push_back ( Node ) ; const std :: vector < MachineDomTreeNode * > & Children = Node -> getChildren ( ) ; OpenChildren [ Node ] = Children . size ( ) ; for ( MachineDomTreeNode * Child : Children ) WorkList . push_back ( Child ) ; } while ( ! WorkList . empty ( ) ) ; for ( MachineDomTreeNode * Node : Scopes ) { MachineBasicBlock * MBB = Node -> getBlock


<s> if ( ! llvm :: isStoreCandidate ( * MI ) ) continue ; unsigned NumDefs = MI -> getDesc ( ) . getNumDefs ( ) ; if ( <NUM_LIT> != NumDefs ) continue ; MachineOperand & MO = MI -> getOperand ( <NUM_LIT> ) ; if ( ! MO . isReg ( ) || MO . isImplicit ( ) ) continue ; if ( ! MRI -> hasOneUse ( MO . getReg ( ) ) ) continue ; MachineInstr & UseMI = * MRI -> use_instr_begin ( MO . getReg ( ) ) ; if ( ! <STR_LIT> ( UseMI . getOpcode ( ) ) || & UseMI != MI


<s> bool <ISA_LIT>LoadStoreEliminationOpt :: runOnMachineFunction ( MachineFunction & MFN ) { MF = & MFN ; TII = static_cast < const <ISA_LIT>InstrInfo * > ( MF -> getSubtarget ( ) . getInstrInfo ( ) ) ; TRI = static_cast < const <ISA_LIT>RegisterInfo * > ( MF -> getSubtarget (


<s> if ( DeletionSet . find ( Elm ) == DeletionSet . end


<s> void <ISA_LIT>LowerMemoryIntrinsics :: AddToLazyDeletionSet ( User * Elm ) { if ( DeletionSet . find ( Elm ) == DeletionSet . end ( ) ) DeletionSet


<s> Offset = Offset % ElmSz ; return CheckForPartialElementAccess ( ElemTy , Offset ) ; } else return <NUM_LIT> != ( Offset % ElmSz ) ; } else if ( isa < StructType > ( Ty ) ) { const StructLayout * SL = DL . getStructLayout ( cast < StructType > ( Ty ) ) ; unsigned FldIdx = SL -> getElementContainingOffset ( Offset ) ; Type * FldTy = cast < StructType > ( Ty ) -> getTypeAtIndex ( FldIdx ) ; if ( isa < CompositeType > ( FldTy ) ) { Offset -= SL -> getElementOffset ( FldIdx ) ; return CheckForPartialElementAccess ( FldTy , Offset ) ; } else return SL -> getElementOffset (


<s> FunctionPass * create<ISA_LIT>LowerMemoryIntrinsics


<s> const DataLayout & DL = Func -> getParent ( ) -> getDataLayout ( ) ; Value * NextGep = llvm :: GetNextGEP ( DL , IRB , TargetIdxTy , V , Padding ) ; if ( IsSrcGep ) CurrDstOffset += Padding ; else CurrSrcOffset +=


<s> Value * <ISA_LIT>LowerMemoryIntrinsics :: GetNextGep ( IRBuilder < > & IRB , Value * V , bool IsSrcGep ) { unsigned Padding = <NUM_LIT> ; assert ( isa < GetElementPtrInst > ( V ) && <STR_LIT> ) ; const DataLayout & DL = Func -> getParent ( ) -> getDataLayout ( ) ; Value * NextGep = llvm :: GetNextGEP ( DL ,


<s> Value * <ISA_LIT>LowerMemoryIntrinsics :: GetNextSrcGep ( IRBuilder < > & IRB ) { const DataLayout & DL = Func -> getParent ( ) -> getDataLayout ( ) ; unsigned SrcSz = DL . getTypeSizeInBits ( GetRootType ( CurrSrc -> getType ( ) ) ) ; if ( CurrSrcOffset < SrcSz ) return CurrSrc ; CurrSrcOffset = <NUM_LIT> ; return GetNextGep ( IRB ,


<s> Type * <ISA_LIT>LowerMemoryIntrinsics :: GetTypeAtOffset ( Type * Ty , Value * * Offset ) { if ( ! isa < ConstantInt > ( * Offset ) ) return Ty ; Ty = GetRootType ( Ty ) ; const DataLayout & DL = Func -> getParent ( ) -> getDataLayout ( ) ; uint64_t OffsetVal = cast < ConstantInt > ( * Offset ) -> getZExtValue ( ) ; if ( isa < StructType > ( Ty ) ) { const StructLayout * SL = DL . getStructLayout ( cast < StructType > ( Ty ) ) ; unsigned Field = SL -> getElementContainingOffset ( OffsetVal ) ; uint64_t RemOffset = OffsetVal - SL


<s> while ( isa < CastInst > ( V ) ) V = cast < CastInst > ( V ) -> getOperand ( <NUM_LIT> ) ; return V


<s> while ( isa < CastInst > ( V ) ) V = cast

< CastInst > ( V ) -> getOperand ( <NUM_LIT> ) ;


<s> Dst = GetRootObject ( Dst , & InitOffsetDst , HasBitCastInChain ) ; Dst = CreateCompositeElemAccessGEP ( DL , IRB , Dst , TargetIdxTy , GetRootType ( Dst -> getType ( ) ) , & InitOffsetDst ) ; Type * PenultimateDstTy = GetPenultimateGepIndexType ( Dst ) ; if ( isa < ArrayType > ( PenultimateDstTy ) && ( isa < ArrayType > ( PenultimateSrcTy ) || isa < MemSetInst > ( Inst ) ) ) OptMemTransferArray ( IRB , Src , InitOffsetSrc , Dst , InitOffsetDst , Length , Inst ) ; else OptMemTransferSerial ( IRB , Src , InitOffsetSrc , Dst , InitOffsetDst


<s> unsigned <ISA_LIT>LowerMemoryIntrinsics :: OptMemTransferScalar ( IRBuilder < > & IRB , Value * Src , Value * Dst , MemIntrinsic * Inst ) { assert ( ! isa < CompositeType > ( Src -> getType ( ) ) && ! isa < CompositeType > ( Dst -> getType ( ) ) ) ; const DataLayout & DL = Func -> getParent ( ) -> getDataLayout ( ) ; Type * SrcTy = GetRootType ( Src -> getType ( ) ) ; Type * DstTy = GetRootType ( Dst -> getType ( ) ) ; uint64_t SrcSz = DL . getTypeSizeInBits ( SrcTy ) ; uint64_t DstSz = DL . getTypeSizeInBits ( DstTy ) ; unsigned MemTransferDst = DstSz - CurrDstOffset ; unsigned MemTransferSrc = isa < MemSetInst > ( Inst ) ? MemTransferDst : SrcSz - CurrSrcOffset ; unsigned MemTransferSz = MemTransferDst < MemTransferSrc ? MemTransferDst : MemTransferSrc ; Value * LoadSrc = nullptr ; if ( MemSetInst * MSI = dyn_cast < MemSetInst > ( Inst ) ) { LoadSrc = PrepareValueForMemSet ( IRB , MSI -> getValue ( ) , DstTy ) ; SrcSz =


<s> void <ISA_LIT>LowerMemoryIntrinsics :: PopulateEraseUsers ( User * I , SetVector <


<s> Type * Ty = STy -> getTypeAtIndex ( i ) ; Elems . push_back ( cast < Constant > ( PrepareValueForMemSet ( IRB , Val , Ty ) ) ) ; } return ConstantStruct :: get ( STy , Elems ) ; } else if ( ArrayType * ATy = dyn_cast < ArrayType > ( ToType ) ) { Type * Ty = ATy


<s> bool <ISA_LIT>LowerMemoryIntrinsics :: ProcessFunction ( ) { LLVMContext & Cxt = Func -> getContext ( ) ; SmallVector < MemIntrinsic * , <NUM_LIT> > WorkList ; const DataLayout & DL = Func -> getParent ( ) -> getDataLayout ( ) ; TargetIdxTy = GetTargetIndexType ( DL , Cxt ) ; for ( auto & BB : * Func ) for ( auto & I :

BB ) if ( isa < MemIntrinsic > ( & I ) ) {


<s> auto Item = WorkList . back ( ) ; WorkList . pop_back ( ) ; IRBuilder < > IRB ( Item ) ; if ( isa < ConstantInt > ( Item -> getLength ( ) ) ) OptimizeMemCopy ( IRB , Item ) ; else if ( MemCpyInst * Memcpy = dyn_cast < MemCpyInst > ( Item ) ) expandMemCpyAsLoop ( Memcpy , TTI ) ; else if ( MemSetInst * Memset = dyn_cast < MemSetInst > ( Item ) ) expandMemSetAsLoop ( Memset ) ; ResetOffsets (


<s> while ( ! WorkList . empty ( ) ) { auto Item = WorkList . back ( ) ; WorkList . pop_back ( ) ; IRBuilder < > IRB ( Item ) ; if ( isa < ConstantInt > ( Item -> getLength ( ) ) ) OptimizeMemCopy ( IRB , Item ) ; else if ( MemCpyInst * Memcpy = dyn_cast < MemCpyInst > ( Item ) ) expandMemCpyAsLoop


<s> } for ( auto * I : Users ) cast < Instruction > ( I ) -> eraseFromParent ( ) ; DeletionSet . clear


<s> void <ISA_LIT>LowerMemoryIntrinsics :: ResetOffsets ( ) { CurrDstOffset = <NUM_LIT> ; CurrSrcOffset = <NUM_LIT> ; CurrSrc =


<s> CurrSrcOffset = <NUM_LIT> ; CurrSrc = nullptr ; CurrDst = nullptr


<s> Func = & F ; return ProcessFunction (


<s> bool runOnFunction ( Function & F ) override { Func = & F ; return ProcessFunction (


<s> assert ( isa < ConstantInt > ( SrcOffset ) && <STR_LIT> ) ; assert ( isa < ConstantInt > ( DstOffset ) && <STR_LIT> ) ; CurrSrc = Src ; CurrSrcOffset = cast < ConstantInt > ( SrcOffset ) -> getZExtValue ( ) ; CurrDst = Dst ; CurrDstOffset = cast < ConstantInt > ( DstOffset ) -> getZExtValue (


<s> Value * NewI = IRB . CreateMemCpy ( MI -> getRawDest ( ) , MI -> getDestAlignment ( ) , MI -> getRawSource ( ) , MI -> getSourceAlignment ( ) , MI -> getLength ( ) ) ; I -> replaceAllUsesWith ( NewI ) ; cast < Instruction > ( I ) -> dropAllReferences ( ) ; AddToLazyDeletionSet ( cast < User


<s> Value * NewI = IRB . CreateMemCpy ( MI -> getRawDest ( ) , MI -> getDestAlignment ( ) , MI -> getRawSource ( ) , MI -> getSourceAlignment ( ) , MI -> getLength ( ) ) ; I -> replaceAllUsesWith ( NewI ) ; cast < Instruction > ( I ) -> dropAllReferences


<s> if ( NodeTypeMap . find ( N ) == NodeTypeMap . end ( ) )


<s> void <ISA_LIT>FunctionInfo :: addToNodeTypeMap ( SDNode * N , Type *


<s> void <ISA_LIT>FunctionInfo :: addToScratchAllocationSet ( unsigned Reg ) { if ( scratchAllocations . find ( Reg ) == scratchAllocations . end ( ) ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> <<


<s> assert ( isa < StructType > ( Ty ) ) ; if ( STyName . find ( Ty ) == STyName . end ( ) ) { std :: string * Name = GenClassName ( ) ; STyName [ Ty ]


<s> const DataLayout & DL ( F . getParent ( ) -> getDataLayout ( ) ) ; const <ISA_LIT>TargetLowering & TLI = * TM . getSubtarget < <ISA_LIT>Subtarget > ( F ) . getTargetLowering ( ) ; SmallVector < EVT , <NUM_LIT> > VTs ; ComputeValueVTs ( TLI , DL , Ty , VTs ) ; for ( EVT VT : VTs ) { unsigned NumRegs = TLI . getNumRegisters ( F . getContext


<s> void llvm :: ComputeSigVTs ( const Function & F , const TargetMachine & TM , SmallVectorImpl < MVT > & Params , SmallVectorImpl < MVT > & Results ) { ComputeLegalVTs ( F , TM , F . getReturnType ( ) , Results ) ; if ( Results . size ( ) >


<s> assert ( DescIDMap . find ( DescVec [ ID ] ) != DescIDMap . end


<s> assert ( DescIDMap . find ( DescVec [ ID ] ) != DescIDMap . end ( ) ) ; return DescVec [


<s> Type * <ISA_LIT>FunctionInfo :: getFromNodeTypeMap ( SDNode * N ) { if ( NodeTypeMap . find ( N ) != NodeTypeMap . end ( ) ) return NodeTypeMap [ N ] ; return nullptr


<s> std :: string <ISA_LIT>FunctionInfo :: getFromTypeNameMap ( Type *


<s> unsigned getNumArguments ( ) { return


<s> unsigned getStackLimit ( ) const { return StackLimit


<s> void <ISA_LIT>FunctionInfo :: getTypeDescriptor ( Type * Ty , std :: string & Desc ) const { <ISA_LIT>FunctionInfo * MFI = const_cast < <ISA_LIT>FunctionInfo * > ( this ) ; const DataLayout & DL = MF . getDataLayout ( ) ; const <ISA_LIT>TargetLowering & TLI = * MF . getTarget ( ) . getSubtarget < <ISA_LIT>Subtarget > ( MF . getFunction ( ) ) . getTargetLowering ( ) ; if ( isa < ArrayType > ( Ty ) ) { Desc += <STR_LIT> ; getTypeDescriptor ( cast < SequentialType > ( Ty ) -> getElementType ( ) , Desc ) ; } else if ( isa < PointerType > ( Ty ) ) { getTypeDescriptor ( cast < PointerType > ( Ty ) -> getElementType ( ) , Desc


<s> NumArguments = <NUM_LIT> ; StackLimit = <NUM_LIT>


<s> return MOOMap . size ( ) && MOOMap . find ( Reg ) != MOOMap


<s> explicit <ISA_LIT>FunctionInfo ( MachineFunction & MF ) : MF ( MF ) { Initialize (


<s> void setLocalsLimit ( unsigned limit ) { LocalsLimit =


<s> void setStackLimit ( unsigned limit ) { StackLimit =


<s> UseDataRegionDirectives = true ; HasSingleParameterDotFile = false ; HasDotTypeDotSizeDirective = false ; if ( Enable<ISA_LIT>Assembler ) { EnableInMemoryAsmEmit = true ; AsmMemoryBuffer = new std :: string ( <STR_LIT> ) ; } AlignmentIsInBytes = false ; COMMDirectiveAlignmentIsInBytes = false ; LCOMMDirectiveAlignmentType = LCOMM


<s> case MachineOperand :: MO_Register : { int LocalOffset ; <ISA_LIT>FunctionInfo * MFI = const_cast < <ISA_LIT>FunctionInfo * > ( MI -> getParent ( ) -> getParent ( ) -> getInfo < <ISA_LIT>FunctionInfo > ( ) ) ; if ( MRI -> hasOneDef ( MO . getReg ( ) ) && MRI -> getVRegDef ( MO . getReg ( ) ) -> skipAllocation ( ) ) LocalOffset = - <NUM_LIT> ; else LocalOffset = MFI -> getRegisterOffset ( MO . getReg ( ) ) ; MCOp = MCOperand :: createImm ( LocalOffset ) ; break ; } case MachineOperand :: MO_Immediate : MCOp = MCOperand :: createImm ( MO . getImm ( ) ) ; break ; case MachineOperand :: MO_FPImmediate : { const ConstantFP * Imm = MO . getFPImm ( ) ; if ( Imm -> getType ( ) -> isFloatTy ( ) ) MCOp = MCOperand :: createFPImm (

Imm -> getValueAPF ( ) . convertToFloat ( ) ) ;


<s> else if ( RC == & <STR_LIT> ) return <STR_LIT> ; else if ( RC == & <STR_LIT> ) return <STR_LIT> ; else llvm_unreachable ( <STR_LIT> ) ; return <STR_LIT>


<s> } else if ( RRC == & <STR_LIT> ) { if ( LRC == & <STR_LIT> ) return <STR_LIT> ; else if ( LRC == & <STR_LIT> ) return <STR_LIT> ; else if ( LRC == & <STR_LIT> ) return <STR_LIT> ; } else if ( RRC == & <STR_LIT> ) { if ( LRC == & <STR_LIT> ) return <STR_LIT> ; else if ( LRC == &


<s> static MCAsmBackend * createAsmBackend ( const Target & , const MCSubtargetInfo & STI , const MCRegisterInfo & , const MCTargetOptions


<s> static MCAsmBackend * createAsmBackend ( const Target & , const MCSubtargetInfo & STI , const MCRegisterInfo &


<s> return new <ISA_LIT>TargetAsmStreamer ( S


<s> static MCInstPrinter * createMCInstPrinter ( const Triple & , unsigned SyntaxVariant , const MCAsmInfo & MAI , const MCInstrInfo & MII , const MCRegisterInfo & MRI ) { assert ( SyntaxVariant == <NUM_LIT> && <STR_LIT>


<s> static MCInstPrinter * createMCInstPrinter ( const Triple & , unsigned SyntaxVariant , const MCAsmInfo & MAI , const MCInstrInfo & MII , const MCRegisterInfo & MRI ) { assert ( SyntaxVariant == <NUM_LIT> && <STR_LIT> ) ; return new <ISA_LIT>InstPrinter ( MAI , MII


<s> MCInstrInfo * X = new MCInstrInfo ( ) ; Init<ISA_LIT>MCInstrInfo (


<s> static MCRegisterInfo * createMCRegisterInfo ( const Triple & ) { MCRegisterInfo * X = new MCRegisterInfo ( ) ; Init<ISA_LIT>MCRegisterInfo ( X , <NUM_LIT> ) ; return X


<s> static MCSubtargetInfo * createMCSubtargetInfo ( const Triple & TT , StringRef CPU , StringRef FS ) { return create<ISA_LIT>MCSubtargetInfoImpl ( TT , CPU , FS


<s> TargetRegistry :: RegisterMCInstrInfo ( * T , createMCInstrInfo ) ; TargetRegistry :: RegisterMCRegInfo ( * T , createMCRegisterInfo ) ; TargetRegistry :: RegisterMCInstPrinter ( * T , createMCInstPrinter ) ; TargetRegistry :: RegisterMCAsmBackend ( * T , createAsmBackend ) ; TargetRegistry :: RegisterMCSubtargetInfo ( * T , createMCSubtargetInfo ) ; TargetRegistry :: RegisterAsmTargetStreamer ( * T , createAsmTargetStreamer


<s> void MemIntrinsicsHandler :: AddToLazyDeletionSet ( User * Elm ) { if ( DeletionSet . find ( Elm ) == DeletionSet . end ( ) ) DeletionSet


<s> Value * MemIntrinsicsHandler :: CreateCompositeElemAccessGEP ( IRBuilder < > & IRB , Value * Mem , Type * CompType , Value * * Offset ) { SmallVector < Value * , <NUM_LIT> > Indices ; Indices . push_back ( ConstantInt :: get ( TargetIdxTy , <NUM_LIT> ) ) ; GetIndicesForCompositeElemAccess ( IRB , Indices


<s> Value * MemIntrinsicsHandler :: GenMask ( IRBuilder < > & IRB , Type * SrcTy , Type * DestTy , Value * Offset , bool IsLoad ) { const DataLayout & DL = Func -> getParent ( ) -> getDataLayout ( ) ; unsigned SrcSz = DL . getTypeSizeInBits ( SrcTy ) ; unsigned DestSz = DL . getTypeSizeInBits ( DestTy ) ; return GenMask ( IRB , SrcSz , DestSz , Offset ,


<s> Value * MemIntrinsicsHandler :: GenMask ( IRBuilder < > & IRB , Type * SrcTy , Type * DestTy , Value * Offset , bool IsLoad ) { const DataLayout & DL = Func -> getParent ( ) -> getDataLayout ( ) ; unsigned SrcSz = DL .


<s> } unsigned ElmSz = DL . getTypeSizeInBits ( STy -> getTypeAtIndex ( ElmIdx ) ) / <NUM_LIT> ; if ( SL -> hasPadding ( ) && ( Offset - SL -> getElementOffset ( ElmIdx ) ) > ElmSz ) { unsigned Alignment = SL -> getAlignment ( ) ; PadOffset = Alignment - ( ( Offset - SL -> getElementOffset ( ElmIdx ) ) ) ; } return ElmIdx


<s> for ( auto * User : I -> users ( ) ) { if ( User -> getNumUses ( ) ) PopulateEraseUsers ( User ,


<s> if ( User -> getNumUses ( ) ) PopulateEraseUsers ( User , Users ) ; Users . push_back (


<s> void MemIntrinsicsHandler :: ProcessArrays ( Type * SrcTy , Type * DestTy , Value * Offset


<s> LLVMContext & Cxt = Func -> getContext ( ) ; const DataLayout & DL = Func -> getParent ( ) -> getDataLayout ( ) ; TargetIdxTy = GetTargetIndexType ( DL , Cxt


<s> AddToLazyDeletionSet ( & I ) ; for ( auto * User : I . users ( ) ) RetVal &= ProcessUser (

MemOpOffsetMap , * User , Offset , isStruct ) ;


<s> for ( auto * Val : DeletionSet ) { SmallVector < User * , <NUM_LIT> > Users ; PopulateEraseUsers ( Val , Users ) ; Users . push_back


<s> void MemIntrinsicsHandler :: ProcessMemOpWRTCompositeSource ( Value * SrcMem , SrcMemOpOffset & MemOpOffsetMap , Type * DestTy ) { Type * SrcTy = GetRootType ( SrcMem -> getType ( ) ) ; assert ( isa < ArrayType > ( SrcTy ) || isa < StructType > ( SrcTy ) ) ; for ( auto & MemOpOffsetPair : MemOpOffsetMap


<s> for ( auto & MemOpOffsetPair : MemOpOffsetMap ) { IRBuilder < > IRB ( cast < Instruction


<s> void MemIntrinsicsHandler :: ProcessPrimitive ( Type * SrcTy , Type * DestTy , Value * Offset , Value * SrcMem , BitCastInst & I ) { assert ( SrcTy -> isIntegerTy ( ) ) ; SrcMemOpOffset MemOpOffsetMap ; for ( auto * User : I . users ( ) ) ProcessUser ( MemOpOffsetMap ,


<s> SrcMemOpOffset MemOpOffsetMap ; for ( auto * User : I . users ( ) ) ProcessUser ( MemOpOffsetMap , * User , Offset , false ) ; ProcessMemOpWRTSourcePrimitive ( SrcMem , MemOpOffsetMap , DestTy


<s> void MemIntrinsicsHandler :: ProcessStructures ( Type * SrcTy , Type * DestTy , Value * Offset , Value * SrcMem


<s> else if ( isa < LoadInst > ( & I ) || isa < StoreInst > ( & I ) ) MemOpOffsetMap [ & I ] = Offset ; else if ( isa < BitCastInst > ( & I ) ) { AddToLazyDeletionSet ( &


<s> else if ( isa < BitCastInst > ( & I ) ) { AddToLazyDeletionSet ( & I ) ; for ( auto * BCUser : cast < BitCastInst > ( & I ) -> users

( ) ) RetVal &= ProcessUser ( MemOpOffsetMap , * BCUser , Offset , isStruct ) ;


<s> bool HasBitCastInChain = false ; Value * Offset = ConstantInt :: get ( TargetIdxTy , <NUM_LIT> ) ; Value * Root = GetRootObject ( & I , & Offset , HasBitCastInChain ) ; assert ( Root && isa < PointerType > ( Root -> getType ( ) ) && <STR_LIT> ) ; if ( HasBitCastInChain ) return ; Type * RootTy = GetRootType ( Root -> getType ( ) ) ; Type * DestTy = GetRootType ( I . getDestTy


<s> assert ( MO . isReg ( ) && TargetRegisterInfo :: isVirtualRegister ( MO . getReg ( ) ) && <STR_LIT> ) ; if ( ! MRI -> hasOneDef ( MO . getReg ( ) ) ) return false ; MachineInstr * Driver = MRI -> getVRegDef ( MO . getReg


<s> return false ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : { isInt = true ; return true ; } case <STR_LIT> : case <STR_LIT>


<s> FunctionPass * create<ISA_LIT>OffsetAllocator ( ) { return new <ISA_LIT>OffsetAllocator (


<s> FunctionPass * create<ISA_LIT>OffsetAllocator ( ) { return new <ISA_LIT>OffsetAllocator


<s> void <ISA_LIT>OffsetAllocator :: EnterScope ( MachineBasicBlock * MBB ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MBB -> getName ( ) << '\n'


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> <<


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MBB -> getName ( )


<s> void <ISA_LIT>OffsetAllocator :: ExitScope ( MachineBasicBlock *


<s> void <ISA_LIT>OffsetAllocator :: ExitScopeIfDone ( MachineDomTreeNode * Node , DenseMap < MachineDomTreeNode * , unsigned > & OpenChildren ) { if ( OpenChildren [ Node ] ) return ; ExitScope ( Node -> getBlock ( ) ) ; while ( MachineDomTreeNode * Parent = Node -> getIDom ( ) ) { unsigned Left = -- OpenChildren [ Parent ] ; if ( Left != <NUM_LIT> ) break ; ExitScope ( Parent -> getBlock ( ) ) ; Node =


<s> if ( MI -> isReturn ( ) ) return false ; if ( MI -> skipAllocation ( ) ) return false ; return true


<s> static bool isArgument ( MachineInstr * MI ) { unsigned Opcode = MI -> getOpcode ( ) ; switch ( Opcode ) { default : return false ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT>


<s> initialize<ISA_LIT>OffsetAllocatorPass ( * PassRegistry :: getPassRegistry ( )


<s> const std :: vector < MachineDomTreeNode * > & Children = Node -> getChildren ( ) ; OpenChildren [ Node ] = Children . size ( ) ; for ( MachineDomTreeNode * Child : Children ) WorkList . push_back ( Child ) ; } while ( ! WorkList . empty ( )


<s> const MachineOperand & Imm2 = I2 -> getOperand ( <NUM_LIT> ) ; return Imm1 . getImm ( ) < Imm2 . getImm ( ) ; } ; for ( MachineBasicBlock :: iterator I = MBB -> begin ( ) , E = MBB -> end ( ) ; I != E ; I ++ ) { MachineInstr * MI = & * I ; if ( isArgument ( MI ) ) Arguments . push_back ( MI ) ; } std :: sort ( Arguments . begin ( ) , Arguments . end ( ) , SortArguments ) ; for ( auto * Arg : Arguments ) { MachineOperand & MO = Arg ->


<s> if ( isEntryBlock ( MBB ) ) { PerformArgumentAllocation ( MBB ) ; PerformAllocationForScratchSet ( ) ; } for ( MachineBasicBlock :: iterator I = MBB -> begin ( ) , E = MBB -> end ( ) ; I != E ; ) { MachineInstr * MI = & * I ; ++ I ; if ( ! isAllocationCandidate ( TII , MI ) || isArgument ( MI ) ) continue ; unsigned NumDefs = MI -> getDesc ( ) . getNumDefs ( ) ; for ( unsigned i = <NUM_LIT> ; i < NumDefs ; ++ i ) { MachineOperand & MO = MI -> getOperand ( i ) ; if ( ! MO . isReg ( ) || MO . isImplicit ( ) ) continue ; assert ( TargetRegisterInfo :: isVirtualRegister ( MO . getReg ( ) ) && <STR_LIT> ) ; if ( MI -> isMoveImmediate ( ) ) { FuncInfo -> setRegisterOffset ( MO . getReg ( ) , - <NUM_LIT> ) ; } else if ( MI -> mayLoad ( ) || MI -> getDesc ( ) . isRegCConv ( ) ) { unsigned UseOffset ; MachineOperand LoadSrc = MI -> getOperand ( <NUM_LIT> ) ; if ( LoadSrc . isReg ( ) ) UseOffset = FuncInfo -> getRegisterOffset ( MI -> getOperand ( <NUM_LIT> ) .


<s> bool <ISA_LIT>OffsetAllocator :: runOnMachineFunction ( MachineFunction & MFN ) { MF = & MFN ; TII = static_cast < const <ISA_LIT>InstrInfo * > ( MF -> getSubtarget ( ) . getInstrInfo ( ) ) ; TRI = static_cast < const <ISA_LIT>RegisterInfo * > ( MF -> getSubtarget ( ) . getRegisterInfo ( ) ) ; MRI = & MF -> getRegInfo ( ) ; DT = & getAnalysis < MachineDominatorTree > ( ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; PerformAllocation ( DT -> getRootNode


<s> void <ISA_LIT>PostAllocationFixups :: ExitScope ( MachineBasicBlock * MBB ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MBB -> getName


<s> if ( OpenChildren [ Node ] ) return ; ExitScope ( Node -> getBlock ( ) ) ; while ( MachineDomTreeNode * Parent = Node


<s> if ( MI . isReturn ( ) && MI . getNumOperands ( ) ) { MachineInstr * RetOpDef = MRI . getVRegDef ( MI . getOperand (


<s> bool isStoreCandidate ( const MachineInstr & MI ) { if ( MI . skipAllocation ( ) ) return false ; if ( MI . mayStore ( ) || MI . mayLoad ( ) || MI . isReturn ( ) || MI . isCompare ( ) || MI . hasUnmodeledSideEffects ( ) || MI . isRematerializable ( ) ) return false ; else return


<s> <ISA_LIT>PostAllocationFixups ( ) : MachineFunctionPass ( ID )


<s> DenseMap < MachineDomTreeNode * , unsigned > OpenChildren ; WorkList . push_back ( Node ) ; do { Node = WorkList . pop_back_val ( ) ; Scopes . push_back ( Node ) ; const std :: vector < MachineDomTreeNode * > & Children = Node ->


<s> DT = & getAnalysis < MachineDominatorTree > ( ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; PerformStoreInsertion ( DT -> getRootNode ( ) ) ; LLVM_DEBUG ( dbgs ( )


<s> if ( EraseSet . find ( MI ) == EraseSet . end (


<s> FunctionPass * create<ISA_LIT>PreAllocationFixups ( ) { return new <ISA_LIT>PreAllocationFixups


<s> void <ISA_LIT>PreAllocationFixups :: EnterScope ( MachineBasicBlock * MBB ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MBB -> getName ( ) << '\n'


<s> void <ISA_LIT>PreAllocationFixups :: EnterScope ( MachineBasicBlock *


<s> void <ISA_LIT>PreAllocationFixups :: ExitScope ( MachineBasicBlock * MBB ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MBB ->


<s> ExitScope ( Node -> getBlock ( ) ) ; while ( MachineDomTreeNode * Parent = Node -> getIDom ( ) ) { unsigned Left = -- OpenChildren [ Parent ] ; if ( Left != <NUM_LIT> ) break ; ExitScope ( Parent -> getBlock ( )


<s> bool IsExtendFixupCandidate ( MachineRegisterInfo * MRI , MachineInstr * MI ) { unsigned Opcode = MI -> getOpcode ( ) ; switch ( Opcode ) { default : return false ; case <STR_LIT> : case <STR_LIT> : case


<s> unsigned Opcode = MI -> getOpcode ( ) ; switch ( Opcode ) { default : return false ; case <STR_LIT> : case <STR_LIT> : case


<s> for ( MachineDomTreeNode * Child : Children ) WorkList . push_back ( Child ) ; } while ( ! WorkList . empty ( ) ) ; for ( MachineDomTreeNode * Node : Scopes ) { MachineBasicBlock * MBB = Node -> getBlock ( ) ; EnterScope ( MBB ) ; ProcessExtendFixupsBlock ( MBB ) ; ExitScopeIfDone ( Node , OpenChildren ) ; } Cleanup (


<s> MRI = & MF -> getRegInfo ( ) ; DT = & getAnalysis < MachineDominatorTree > ( ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; PerformExtendFixups ( DT -> getRootNode ( ) ) ; return true


<s> TII = static_cast < const <ISA_LIT>InstrInfo * > ( MF -> getSubtarget ( ) . getInstrInfo ( ) ) ; TRI = static_cast < const <ISA_LIT>RegisterInfo * > ( MF -> getSubtarget ( ) . getRegisterInfo ( ) ) ; MRI = & MF -> getRegInfo ( ) ; DT = & getAnalysis < MachineDominatorTree > ( ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; PerformExtendFixups ( DT -> getRootNode ( )


<s> const MCPhysReg * <ISA_LIT>RegisterInfo :: getCalleeSavedRegs ( const MachineFunction * ) const { static const MCPhysReg CalleeSavedRegs [ ]


<s> const MCPhysReg * <ISA_LIT>RegisterInfo :: getCalleeSavedRegs ( const MachineFunction * ) const { static const MCPhysReg CalleeSavedRegs [ ] = { <NUM_LIT>


<s> const TargetRegisterClass * <ISA_LIT>RegisterInfo :: getPointerRegClass ( const MachineFunction & MF , unsigned Kind ) const { assert ( Kind == <NUM_LIT> && <STR_LIT> ) ; if ( MF . getSubtarget < <ISA_LIT>Subtarget > ( ) . hasAddr64 ( ) ) return & <STR_LIT> ; return & <STR_LIT>


<s> const <ISA_LIT>FrameLowering * getFrameLowering ( ) const override { return & FrameLowering


<s> const <ISA_LIT>TargetLowering * getTargetLowering ( ) const override { return &


<s> const <ISA_LIT>TargetLowering * getTargetLowering ( ) const


<s> bool hasAddr64 ( ) const { return TargetTriple . isArch64Bit


<s> bool <ISA_LIT>Subtarget :: useAA ( ) const { return true


<s> Target & llvm :: getThe<ISA_LIT>Target32 (


<s> Target & llvm :: getThe<ISA_LIT>Target64 (


<s> RegisterTarget < Triple :: jvm32 > X ( getThe<ISA_LIT>Target32 ( ) , <STR_LIT> , <STR_LIT> ,


<s> bool addGCPasses ( ) override { return false


<s> addPass ( create<ISA_LIT>ISelDag ( get<ISA_LIT>TargetMachine ( ) , getOptLevel ( ) ) ) ; return false


<s> if ( JvmAggOpt ) addPass ( createInstructionCombiningPass ( ) ) ; addPass ( create<ISA_LIT>IRDecorator ( ) ) ; addPass ( createAggressiveDCEPass ( ) ) ; if ( JvmAggOpt ) addPass (


<s> void <ISA_LIT>PassConfig :: addOptimizedRegAlloc ( FunctionPass * RegAllocPass ) { disablePass ( & RegisterCoalescerID ) ; TargetPassConfig :: addOptimizedRegAlloc ( RegAllocPass )


<s> return new <ISA_LIT>PassConfig ( * this , PM


<s> TargetPassConfig * <ISA_LIT>TargetMachine :: createPassConfig ( PassManagerBase


<s> FunctionPass * <ISA_LIT>PassConfig ::

createTargetRegisterAllocator ( bool ) {


<s> bool dumpclassfile ; cl :: GetCommandLineOption < bool > ( <STR_LIT> , dumpclassfile ) ; bool enablejvmassembler ; cl :: GetCommandLineOption < bool > ( <STR_LIT> , enablejvmassembler ) ; if ( dumpclassfile && ! enablejvmassembler ) llvm :: errs ( ) << <STR_LIT>


<s> static Reloc :: Model getEffectiveRelocModel ( Optional < Reloc :: Model >


<s> if ( ! RM . hasValue ( ) ) return Reloc :: PIC_ ; return *


<s> return getTM < <ISA_LIT>TargetMachine


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


<s> void <ISA_LIT>TargetAsmStreamer :: emitString ( const Twine & Str ) { OS << Str


<s> BlockRevPostOrderTraversal :: BlockRevPostOrderTraversal ( Function * F ) { visitBlocks ( & F -> getEntryBlock (


<s> BasicBlock * Block = * Itr ; if ( Block -> hasOneUse ( ) && IsRPOTPredecessor ( Itr , cast < BasicBlock > ( cast < Instruction > ( * ( Block -> user_begin ( ) )


<s> BasicBlock * Block = * Itr ; if ( Block -> hasOneUse ( ) && IsRPOTPredecessor ( Itr , cast < BasicBlock > ( cast < Instruction > ( * ( Block -> user_begin ( )

) ) -> getParent ( ) ) ) ) return true ;


<s> FunctionPass * createX2JavaPass ( ) { return new XToJavaPass


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << Blk -> getName ( ) ) ; for ( auto PV : PredCondMap [ Blk ] ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << i ++ << <STR_LIT> << PV . getPointer ( )

-> getName ( ) << ( PV . getInt ( ) ? <STR_LIT> : <STR_LIT> ) ) ;


<s> void XToJavaPass :: EmitBlock ( BasicBlock * Blk ,


<s> int PhiRemoved = PhiEliminator . ProcessFunction ( ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << PhiRemoved << <STR_LIT> ) ; Predicator . ProcessFunction ( ) ; for ( auto * Blk :


<s> void XToJavaPass :: EmitEpilogue ( raw_ostream & OS ) { LLVM_DEBUG ( dbgs ( )


<s> iterator end ( ) { return Blocks . rend


<s> EmitEpilogue ( OS ) ; XToJavaCounter ++ ; return true


<s> char ctrStr [ <NUM_LIT> ] = { '\0' } ; std :: string Name = <STR_LIT> ; Name += Prefix ; sprintf ( ctrStr , <STR_LIT> , ctr ++ ) ; Name += ctrStr


<s> Name += Prefix ; sprintf ( ctrStr , <STR_LIT> , ctr ++ ) ; Name += ctrStr


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


<s> void BlockPredication :: InsertPredicate ( BasicBlock * Blk , Value * Pred , int TrueCondF ) { if ( PredCondMap . find ( Blk ) == PredCondMap . end ( ) ) PredCondMap [ Blk ]

= { PredicateVar ( Pred , TrueCondF ) } ;


<s> if ( PredCondMap . find ( Blk ) == PredCondMap . end ( ) ) PredCondMap [ Blk ] = { PredicateVar ( Pred , TrueCondF ) } ; else PredCondMap [ Blk ] . push_back ( PredicateVar


<s> bool BlockPredication :: IsRPOTPredecessor ( BlockOrderListItr Block


<s> int PhiCnt = <NUM_LIT> ; BasicBlock & entry = F -> getEntryBlock ( ) ; for ( auto & Inst : B ) { if ( isa < PHINode > ( Inst ) ) { PHINode & I = cast < PHINode > ( Inst ) ; IRBuilder < > IRB ( & entry , entry . begin ( ) ) ; AllocaInst * NewVar = IRB . CreateAlloca ( I . getType ( ) , nullptr , genTempName ( ++ newInstrCtr , <STR_LIT> ) ) ; LoadInst * NewLI = IRB . CreateLoad ( I . getType ( ) , NewVar , genTempName ( ++ newInstrCtr , <STR_LIT>


<s> void BlockPredication :: ProcessSwitchInst ( SwitchInst *


<s> Func = & F ; return GenJavaClass ( OS )


<s> raw_string_ostream OS ( Code ) ; Func = & F ; return GenJavaClass ( OS


<s> void BlockRevPostOrderTraversal :: visitBlocks ( BasicBlock * Blk ) { if ( OrderedMap . find ( Blk ) != OrderedMap . end ( ) && ( OrderedMap [ Blk ] == GRAY || OrderedMap [ Blk ] == BLACK ) ) return ; OrderedMap [ Blk ] = GRAY ; Instruction * TI = Blk -> getTerminator ( ) ; if ( isa < BranchInst > ( TI ) && cast < BranchInst > ( TI ) -> isConditional ( ) ) { BasicBlock * FalseBlock = cast < BasicBlock > ( TI -> getSuccessor ( <NUM_LIT> ) ) ; visitBlocks ( FalseBlock ) ; BasicBlock * TrueBlock = cast < BasicBlock > ( TI -> getSuccessor ( <NUM_LIT> ) ) ; visitBlocks ( TrueBlock ) ; } else { for ( unsigned i = <NUM_LIT> ; i < TI -> getNumSuccessors ( ) ; i ++ ) { visitBlocks ( TI -> getSuccessor ( i ) ) ; } } OrderedMap [ Blk ] = BLACK ; Blocks . push_back (


<s> void BlockRevPostOrderTraversal :: visitBlocks ( BasicBlock * Blk ) { if ( OrderedMap . find ( Blk ) != OrderedMap . end ( ) && ( OrderedMap [ Blk ] == GRAY || OrderedMap [ Blk ] == BLACK ) ) return ; OrderedMap [ Blk ] = GRAY ; Instruction * TI = Blk -> getTerminator


<s> jclass cls ; jmethodID mid ; JavaVMInitArgs vm_args ; JavaVMOption options [ <NUM_LIT> ] ; options [ <NUM_LIT> ] . optionString = <STR_LIT> ; options [ <NUM_LIT> ] . optionString = <STR_LIT> ; options [ <NUM_LIT> ] . optionString = <STR_LIT> ; options [ <NUM_LIT> ] . optionString = <STR_LIT> ; vm_args . version = <NUM_LIT> ; vm_args . options = options ; vm_args . nOptions = <NUM_LIT> ; vm_args . ignoreUnrecognized = JNI_TRUE ; fprintf ( stdout , <STR_LIT> , className , methodName ) ; res = JNI_CreateJavaVM ( & jvm , ( void * * ) & env


<s> if ( mid == NULL ) { goto destroy ; } jbyteArray jBArr = ( * env ) -> NewByteArray ( env , <NUM_LIT> ) ; if ( jBArr != NULL ) { ( * env ) -> SetByteArrayRegion ( env , jBArr , <NUM_LIT> , <NUM_LIT> , ( jbyte * ) byteArray ) ; } ( * env ) -> CallStaticVoidMethod ( env , cls , mid , jBArr ) ; ( * env ) -> GetByteArrayRegion ( env , jBArr , <NUM_LIT> , <NUM_LIT> , ( jbyte * ) byteArray ) ; ( * env ) -> DeleteLocalRef ( env , jBArr ) ; destroy : if ( ( * env ) -> ExceptionOccurred ( env ) ) { ( * env ) -> ExceptionDescribe ( env ) ; } ( * jvm ) ->