<s> static inline Type * getKernenvArgType ( unsigned ID , LLVMContext & C , bool is64bit ) { if ( ID == <STR_LIT> ) return Type :: getInt8PtrTy ( C , <NUM_LIT> ) ; return ( is64bit ? Type :: getInt64Ty ( C ) : Type :: getInt32Ty ( C


<s> static inline Type * getKernenvArgType ( unsigned ID , LLVMContext & C , bool is64bit ) { if ( ID == <STR_LIT> ) return Type :: getInt8PtrTy (


<s> inline static bool classof ( const MCStreamer * streamer ) { return true


<s> inline static bool classof ( const MCStreamer


<s> MCStreamer * llvm :: createBRIGDwarfStreamer ( MCContext & Context , MCAsmBackend & MAB , RawVectorOstream & RVOS , MCCodeEmitter


<s> void BRIGDwarfStreamer :: Finish ( ) { MCELFStreamer :: Finish ( ) ; dwarfStream -> flush ( ) ; dwarfStream -> releaseStream


<s> assert ( & Strm == static_cast < raw_ostream


<s> RawVectorOstream * BRIGDwarfStreamer :: getDwarfStream ( ) { raw_ostream & Strm = getAssembler ( ) . getWriter ( ) . getStream ( ) ; assert ( & Strm == static_cast < raw_ostream * > ( dwarfStream ) && <STR_LIT> ) ; return dwarfStream


<s> MCSectionELF * codeSection = getContext ( ) . getELFSection ( <STR_LIT> , ELF :: SHT_NOBITS , <NUM_LIT> ) ; MCSectionELF * directivesSection = getContext ( ) . getELFSection ( <STR_LIT> , ELF :: SHT_NOBITS , <NUM_LIT> ) ; SwitchSection ( codeSection


<s> MCSectionELF * directivesSection = getContext ( ) . getELFSection ( <STR_LIT> , ELF :: SHT_NOBITS , <NUM_LIT> ) ; SwitchSection ( codeSection ) ; SwitchSection ( directivesSection ) ; SwitchSection ( codeSection )


<s> ModulePass * llvm :: create<ISA_LIT>AlwaysInlinePass ( ) { return new <ISA_LIT>AlwaysInline (


<s> ModulePass * llvm :: create<ISA_LIT>AlwaysInlinePass ( ) { return new <ISA_LIT>AlwaysInline


<s> const char * getPassName ( ) const override { return <STR_LIT>


<s> Function * NewFunc = CloneFunction ( F , VMap , false ) ; NewFunc -> setLinkage ( GlobalValue :: InternalLinkage ) ; F -> getParent ( ) -> getFunctionList ( ) . push_back ( NewFunc ) ; F -> replaceAllUsesWith ( NewFunc ) ; } for ( Module :: iterator I = M . begin ( ) , E = M . end ( ) ; I != E ; ++ I ) { Function & F = * I


<s> static bool canInitAddressSpace ( unsigned AS ) { return AS == <STR_LIT>


<s> IsFullProfile = true ; IsGCN = false ; HasImages = false ; for ( const Function & F : M ) { const <ISA_LIT>Subtarget & ST = TM . getSubtarget < <ISA_LIT>Subtarget > ( F ) ; if ( ST . isGCN ( ) ) IsGCN = true ; if ( ST . hasImages ( ) )


<s> void <ISA_LIT>AsmPrinter :: computeStackUsage ( const MachineFrameInfo * MFI , uint64_t & PrivateSize , unsigned & PrivateAlign , uint64_t & SpillSize , unsigned & SpillAlign ) const { SpillSize = <NUM_LIT> ; PrivateSize = <NUM_LIT> ; PrivateAlign = <NUM_LIT> ; SpillAlign = <NUM_LIT> ; for ( int I = MFI -> getObjectIndexBegin ( ) , E = MFI -> getObjectIndexEnd ( ) ; I != E ; ++ I ) { if ( MFI -> isDeadObjectIndex ( I ) ) continue ; if ( MFI -> isSpillSlotObjectIndex ( I ) ) { assert ( SpillSize == <NUM_LIT> && <STR_LIT> ) ; SpillSize = MFI -> getObjectSize ( I ) ; SpillAlign = MFI -> getObjectAlignment ( I ) ; } else { assert ( PrivateSize == <NUM_LIT> && <STR_LIT> ) ; PrivateSize = MFI -> getObjectSize


<s> bool <ISA_LIT>AsmPrinter :: doFinalization ( Module & M ) { EmitEndOfAsmFile ( M ) ; return false


<s>
}
O
<<
(
IsKernel
<STR_LIT>
:
<STR_LIT>
)
<<
'_'
<<
getArgTypeName
(
EltTy
,
IsSExt
)
<<
' '
<<
'%'
;
if
(
MF
)
{
const
<ISA_LIT>ParamManager
&
PM
=
MF
->
getInfo
<
<ISA_LIT>MachineFunctionInfo
>
(
)
->
getParamManager
(
)
;
O
<<
PM
.
getParamName
(
ParamIndex
)
;
}
else
{
StringRef
Name
=
A
.
getName
(
)
;
if
(
Name
.
empty
(
)
)
O
<<
<STR_LIT>
<<
ParamIndex
;
else
O
<<


<s> } } if ( ChangeName ) { ( const_cast < GlobalVariable * > ( & GV ) ) -> setName ( str ) ; } O << '\t' ; Type * InitTy = Ty -> getElementType ( ) ; unsigned NElts = ~ <NUM_LIT> ; Type * EmitTy = <STR_LIT> ( InitTy , NElts , DL ) ; printAlignTypeQualifier ( GV , DL , InitTy , EmitTy , NElts , true , O ) ; str = <STR_LIT> ; O << '_' << getArgTypeName ( EmitTy ) << <STR_LIT> << GV . getName ( ) ; if ( NElts != <NUM_LIT> ) O << '[' << NElts << ']' ; if ( GV . hasInitializer ( ) && canInitAddressSpace ( AS ) ) { O << <STR_LIT> ; printGVInitialValue ( GV , cast < Constant > ( GV . getInitializer ( ) ) , DL , O ) ; } } } } const MachineFrameInfo * MFI = MF -> getFrameInfo ( ) ; uint64_t SpillSize , PrivateSize ; unsigned PrivateAlign , SpillAlign ; computeStackUsage ( MFI , PrivateSize , PrivateAlign , SpillSize , SpillAlign ) ; if ( PrivateSize != <NUM_LIT> ) { O << <STR_LIT> << PrivateAlign << <STR_LIT> << PrivateSize << <STR_LIT> ; } if ( SpillSize != <NUM_LIT> ) { O << <STR_LIT> << SpillAlign << <STR_LIT> << SpillSize << <STR_LIT> ; } const <ISA_LIT>MachineFunctionInfo * Info = MF -> getInfo < <ISA_LIT>MachineFunctionInfo > ( ) ; if ( Info -> hasScavengerSpill ( ) ) O << <STR_LIT> ; if ( usesGCNAtomicCounter ( ) ) O << <STR_LIT> ; OutStreamer -> EmitRawText ( O . str


<s> const Function * F = MF -> getFunction ( ) ; if ( isProgramLinkage ( * F ) ) O << <STR_LIT> ; emitFunctionLabel ( * F , O , false ) ; O << <STR_LIT>


<s> void <ISA_LIT>AsmPrinter :: EmitFunctionHeader ( ) { const Function * F = MF


<s> OutStreamer -> SwitchSection ( getObjFileLowering ( ) . SectionForGlobal ( F , *


<s> const auto & RetAttrs = F . getAttributes ( ) . getRetAttributes ( ) ; bool IsSExt = RetAttrs . hasAttribute ( AttributeSet :: ReturnIndex , Attribute :: SExt ) ; bool IsZExt = RetAttrs . hasAttribute ( AttributeSet :: ReturnIndex , Attribute :: ZExt ) ; if ( IsSExt || IsZExt ) { emitFunctionReturn ( Type :: getInt32Ty ( RetTy -> getContext ( ) ) , RetName , IsKernel , IsSExt , O ) ; } else emitFunctionReturn ( RetTy , RetName , IsKernel , IsSExt , O ) ; } O << <STR_LIT> ; } const auto & Attrs = F . getAttributes ( ) ; unsigned NArgs = F . arg_size ( ) ; if ( NArgs == <NUM_LIT> ) { O << ')' ; } else if ( NArgs == <NUM_LIT> ) { bool IsSExt = Attrs . hasAttribute ( <NUM_LIT> , Attribute :: SExt ) ; emitFunctionArgument ( <NUM_LIT> , * F . arg_begin ( ) , IsKernel , IsSExt , O ) ; O << ')' ; } else { O << <STR_LIT> ; unsigned Index


<s>
if
(
NElts
>
<NUM_LIT>
)
{
unsigned
ABIAlign
=
DL
.
getABITypeAlignment
(
Ty
)
;
if
(
ABIAlign
!=
DL
.
getABITypeAlignment
(
EltTy
)
)
O
<<
<STR_LIT>
<<
ABIAlign
<<
<STR_LIT>
;
}
O
<<
(
IsKernel
<STR_LIT>
:
<STR_LIT>
)
<<
'_'
<<
getArgTypeName
(
EltTy
,
IsSExt
)
<<
' '
<<
'%'


<s> void <ISA_LIT>AsmPrinter :: emitFunctionReturn ( Type * Ty , StringRef Name , bool IsKernel , bool IsSExt , raw_ostream & O ) const { const DataLayout & DL = getDataLayout ( ) ; unsigned NElts = ~ <NUM_LIT> ; Type * EltTy = <STR_LIT> ( Ty , NElts , DL ) ; if ( NElts > <NUM_LIT> ) { unsigned ABIAlign = DL . getABITypeAlignment ( Ty ) ; if ( ABIAlign != DL . getABITypeAlignment ( EltTy ) ) O << <STR_LIT> <<


<s> for ( const GlobalVariable & GV : M . globals ( ) ) { unsigned AS = GV . getType ( ) -> getAddressSpace ( ) ; if ( AS != <STR_LIT> && AS != <STR_LIT> ) EmitGlobalVariable ( & GV ) ; } for ( const Function & F : M ) { if ( F . isIntrinsic ( ) ) continue ; if ( F . isDeclaration ( ) && isModuleLinkage ( F ) ) continue ; if ( ! <STR_LIT> ( & F ) && ! is<ISA_LIT>Instrinsic ( F . getName ( ) ) ) { Str . clear ( ) ; O << <STR_LIT> ; if ( isProgramLinkage ( F ) ) O <<


<s> case Type :: PointerTyID : { const PointerType * PT = cast < PointerType > ( Ty ) ; const StructType * ST = dyn_cast < StructType > ( PT -> getElementType ( ) ) ; if ( ST && ST -> isOpaque ( ) ) { StringRef Name = ST -> getName ( ) ; if ( Name . startswith ( <STR_LIT> ) || Name . startswith ( <STR_LIT> ) || Name . startswith ( <STR_LIT> ) || Name . startswith ( <STR_LIT> ) || Name . startswith ( <STR_LIT> ) || Name . startswith ( <STR_LIT> ) ) { return <STR_LIT> ; } else if ( Name . startswith ( <STR_LIT> ) ) { return <STR_LIT> ; } else if ( Name == <STR_LIT> || Name == <STR_LIT> ) { const DataLayout & DL = getDataLayout ( ) ; return DL . getPointerSize ( <STR_LIT> ) == <NUM_LIT> ? <STR_LIT> : <STR_LIT> ; } else { llvm_unreachable (


<s> unsigned AS = GV -> getType ( ) -> getAddressSpace ( ) ; NameStr += getSymbolPrefixForAddressSpace ( AS ) ; } SmallString < <NUM_LIT> > Mangled ; SmallString < <NUM_LIT> > Sanitized ; getNameWithPrefix ( Mangled , GV ) ; NameStr += Mangled ; if ( <STR_LIT> ( Mangled , Sanitized ) ) NameStr +=


<s> assert ( GV && <STR_LIT> ) ; unsigned AS = GV -> getType ( ) ->


<s> char <ISA_LIT>AsmPrinter :: getSymbolPrefixForAddressSpace ( unsigned AS ) { return ( AS == <STR_LIT> || AS == <STR_LIT>


<s> if ( ( <STR_LIT> ) <STR_LIT> != getIntrinsicForGCCBuiltin ( <STR_LIT> , str . data ( ) ) ) return true ; return str . startswith ( StringRef ( <STR_LIT>


<s> case GlobalValue :: WeakAnyLinkage : case GlobalValue :: WeakODRLinkage : case GlobalValue :: AvailableExternallyLinkage : case GlobalValue :: ExternalWeakLinkage : case GlobalValue :: AppendingLinkage : return true ; default : return


<s> if ( Alignment == <NUM_LIT> ) Alignment = DL . getPrefTypeAlignment ( InitTy ) ; else { unsigned NaturalAlign = IsLocal ? DL . getPrefTypeAlignment ( EmitTy ) : DL . getABITypeAlignment ( EmitTy ) ; Alignment = std :: max ( Alignment , NaturalAlign ) ; } if ( Alignment < <NUM_LIT> && NElts != <NUM_LIT> )


<s> void <ISA_LIT>AsmPrinter :: printConstantFP ( const ConstantFP * CFP , raw_ostream & O ) { uint64_t Val = CFP -> getValueAPF ( ) . bitcastToAPInt ( ) . getZExtValue ( ) ; if ( CFP -> getType ( ) -> isFloatTy ( ) ) printFloat ( static_cast < uint32_t > ( Val ) , O ) ; else if ( CFP -> getType ( ) -> isDoubleTy ( ) ) printDouble ( Val , O ) ; else llvm_unreachable (


<s> void <ISA_LIT>AsmPrinter :: printFloat ( uint32_t Val ,


<s> } unsigned NElts = <NUM_LIT> ; Type * EltTy = <STR_LIT> ( CV -> getType ( ) , NElts , DL ) ; unsigned EltSize = DL . getTypeAllocSize ( EltTy ) ; SmallVector < AddrInit , <NUM_LIT> > AddrInits ; StoreInitializer store ( EltTy , * this ) ; store . append ( CV , GV . getName ( ) ) ; if ( NElts != <NUM_LIT> ) O << getArgTypeName ( EltTy ) << <STR_LIT> ; store . print ( O ) ; if ( NElts != <NUM_LIT> ) O << ')' ; O << ';' ; if ( ! store . varInitAddresses ( ) . empty ( ) ) O << '\n' ; for ( const auto & VarInit : store . varInitAddresses (


<s> assert ( ! Val . getSymB ( ) && <STR_LIT> ) ; O << <STR_LIT> << VarName << ':' << BaseOffset << ':' << EltSize << ':' ; if ( const MCSymbolRefExpr * SymA = Val . getSymA ( ) ) { const MCSymbol & Sym = SymA -> getSymbol ( ) ; O << getSymbolPrefix ( Sym ) << Sym . getName


<s> MCValue Val ; bool Res = Expr -> evaluateAsRelocatable ( Val , nullptr , nullptr ) ; ( void ) Res ; assert ( Res && <STR_LIT> ) ; assert ( ! Val . getSymB ( ) && <STR_LIT> ) ; O << <STR_LIT> << VarName << ':' << BaseOffset << ':' << EltSize << ':' ; if ( const MCSymbolRefExpr * SymA = Val . getSymA ( ) ) { const MCSymbol & Sym = SymA -> getSymbol (


<s> static void printSimpleZeroInit ( raw_ostream & O , bool IsFloat , bool IsDouble ) { O <<


<s> SetupMachineFunction ( MF ) ; SmallString < <NUM_LIT> > Name ; get<ISA_LIT>MangledName ( Name , MF . getFunction ( ) ) ; CurrentFnSym = OutContext . getOrCreateSymbol ( Name ) ; OutStreamer -> SwitchSection ( getObjFileLowering ( ) . getTextSection ( ) ) ; EmitFunctionBody ( )


<s> bool hasFP ( const MachineFunction &


<s> bool hasFP ( const MachineFunction & MF ) const override { return


<s> unsigned SpillAlign = <NUM_LIT> ; unsigned PrivateAlign = <NUM_LIT> ; for ( int I = MFI -> getObjectIndexBegin ( ) , E = MFI -> getObjectIndexEnd ( ) ; I != E ; ++ I ) { if ( MFI -> isDeadObjectIndex ( I ) ) continue ; unsigned Size = MFI -> getObjectSize ( I ) ; unsigned Align = MFI -> getObjectAlignment ( I ) ; unsigned Offset = MFI -> getObjectOffset ( I ) ; assert ( Offset == <NUM_LIT> && <STR_LIT> ) ; if ( MFI -> isSpillSlotObjectIndex ( I ) ) { SpillSize = ( SpillSize + Align - <NUM_LIT> ) / Align * Align ; SpillMap [ I ] = SpillSize ; SpillSize += Size ; SpillAlign = std :: max ( SpillAlign , Align ) ; } else { PrivateSize = ( PrivateSize + Align - <NUM_LIT> ) / Align * Align ; PrivateMap [ I ] = PrivateSize ; PrivateSize += Size ; PrivateAlign = std :: max ( PrivateAlign , Align ) ; } MFI -> RemoveStackObject ( I ) ; } int PrivateIndex = - <NUM_LIT> ; int SpillIndex = - <NUM_LIT> ; if ( PrivateSize != <NUM_LIT> ) PrivateIndex = MFI -> CreateStackObject ( PrivateSize , PrivateAlign , false ) ; if ( SpillSize != <NUM_LIT> ) SpillIndex = MFI -> CreateSpillStackObject ( SpillSize , SpillAlign ) ; for ( MachineBasicBlock & MBB : MF ) { for ( MachineInstr & MI : MBB ) { unsigned Opc = MI . getOpcode (


<s> unsigned PrivateAlign = <NUM_LIT> ; for ( int I = MFI -> getObjectIndexBegin ( ) , E = MFI -> getObjectIndexEnd ( ) ; I != E ; ++ I ) { if ( MFI -> isDeadObjectIndex ( I ) ) continue ; unsigned Size = MFI -> getObjectSize ( I ) ; unsigned Align = MFI -> getObjectAlignment ( I ) ; unsigned Offset = MFI -> getObjectOffset ( I ) ; assert ( Offset == <NUM_LIT> && <STR_LIT> ) ; if ( MFI -> isSpillSlotObjectIndex ( I ) ) { SpillSize = ( SpillSize + Align - <NUM_LIT> ) / Align * Align ; SpillMap [ I ] = SpillSize ; SpillSize += Size ; SpillAlign = std :: max ( SpillAlign , Align ) ; } else { PrivateSize = ( PrivateSize + Align - <NUM_LIT> ) / Align * Align ; PrivateMap [ I ] = PrivateSize ; PrivateSize += Size ; PrivateAlign = std :: max ( PrivateAlign , Align ) ; } MFI -> RemoveStackObject ( I ) ; } int PrivateIndex = - <NUM_LIT> ; int SpillIndex = - <NUM_LIT> ; if ( PrivateSize != <NUM_LIT> ) PrivateIndex = MFI -> CreateStackObject ( PrivateSize , PrivateAlign , false ) ; if ( SpillSize != <NUM_LIT> ) SpillIndex = MFI -> CreateSpillStackObject ( SpillSize , SpillAlign ) ; for ( MachineBasicBlock & MBB : MF ) { for ( MachineInstr & MI : MBB ) { unsigned Opc = MI . getOpcode ( ) ; int AddrIdx = <STR_LIT> ( Opc , <STR_LIT> :: address ) ; if ( AddrIdx == - <NUM_LIT> ) { continue ; } MachineOperand & Base = MI . getOperand ( AddrIdx ) ; if ( ! Base . isFI ( ) ) continue ; int Index = Base . getIndex ( ) ; MachineOperand & Offset = MI . getOperand ( AddrIdx + <NUM_LIT> ) ; int64_t OrigOffset = Offset . getImm ( ) ; if ( MFI -> isSpillSlotObjectIndex ( Index ) ) { Base . setIndex ( SpillIndex ) ; Offset . setImm ( SpillMap [ Index ] + OrigOffset ) ; } else { Base . setIndex ( PrivateIndex ) ; Offset . setImm ( PrivateMap [


<s> int64_t Offset = OffsetOp . getImm ( ) ; if ( BaseOp . isReg ( ) ) { assert ( BaseOp . getReg ( ) == <STR_LIT> ) ; } else if ( BaseOp . isExpr ( ) ) { O << '[' ; BaseOp . getExpr ( ) -> print ( O , & MAI ) ; O << ']' ; } else if ( BaseOp . isImm ( ) ) O << BaseOp . getImm ( ) ; else llvm_unreachable ( <STR_LIT> ) ; if ( AddrReg != <STR_LIT> &&


<s> void <ISA_LIT>InstPrinter :: printArgDeclAlignment ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { unsigned Align = MI -> getOperand ( OpNo ) . getImm ( ) ; int TypeLengthIdx = <STR_LIT> ( MI -> getOpcode ( ) , <STR_LIT> :: TypeLength ) ; BrigType BT = static_cast < BrigType > ( MI -> getOperand ( TypeLengthIdx ) . getImm ( ) ) ; if ( ! isNaturalAlignment ( BT , Align ) ) O << <STR_LIT> << formatDec (


<s> int TypeLengthIdx = <STR_LIT> ( MI -> getOpcode ( ) , <STR_LIT> :: TypeLength ) ; BrigType BT = static_cast < BrigType > ( MI -> getOperand ( TypeLengthIdx ) . getImm ( ) ) ; if ( ! isNaturalAlignment ( BT , Align ) ) O

<< <STR_LIT> << formatDec ( Align ) << <STR_LIT> ;


<s> void <ISA_LIT>InstPrinter :: printB32 ( const MCInst * MI , unsigned OpNo , raw_ostream


<s> void <ISA_LIT>InstPrinter :: printB64 ( const MCInst * MI , unsigned OpNo


<s> unsigned Align = MI -> getOperand ( OpNo ) . getImm ( ) ; if ( Align != <NUM_LIT> ) O << <STR_LIT> << formatDec (


<s> switch ( MI -> getOperand ( OpNo ) . getImm ( ) ) { case BRIG_ALU_FTZ


<s> break ; case BRIG_COMPARE_LE : O << <STR_LIT> ; break ; case BRIG_COMPARE_GT : O << <STR_LIT> ; break ; case BRIG_COMPARE_GE : O << <STR_LIT> ; break ; case BRIG_COMPARE_EQU : O << <STR_LIT> ; break ; case BRIG_COMPARE_NEU : O << <STR_LIT> ; break ; case BRIG_COMPARE_LTU : O << <STR_LIT> ; break ; case BRIG_COMPARE_LEU : O << <STR_LIT> ; break ; case BRIG_COMPARE_GTU : O << <STR_LIT> ; break ; case BRIG_COMPARE_GEU : O << <STR_LIT> ; break ; case BRIG_COMPARE_NUM : O << <STR_LIT> ; break ; case BRIG_COMPARE_NAN : O << <STR_LIT> ; break ; case BRIG_COMPARE_SEQ : O << <STR_LIT> ; break ; case BRIG_COMPARE_SNE : O << <STR_LIT> ; break ; case BRIG_COMPARE_SLT : O << <STR_LIT> ; break ; case BRIG_COMPARE_SLE : O << <STR_LIT> ; break ; case BRIG_COMPARE_SGT : O << <STR_LIT> ; break ; case BRIG_COMPARE_SGE : O << <STR_LIT> ; break ; case BRIG_COMPARE_SGEU : O << <STR_LIT> ; break ; case BRIG_COMPARE_SEQU


<s> break ; case BRIG_CONTROL_MAXFLATWORKGROUPSIZE : O << <STR_LIT> ; break ; case BRIG_CONTROL_REQUIREDDIM : O << <STR_LIT> ; break ; case BRIG_CONTROL_REQUIREDGRIDSIZE : O << <STR_LIT> ; break ; case BRIG_CONTROL_REQUIREDWORKGROUPSIZE : O << <STR_LIT> ; break ; case BRIG_CONTROL_REQUIRENOPARTIALWORKGROUPS


<s> case BRIG_CHANNEL_TYPE_SNORM_INT16 : O << <STR_LIT> ; break ; case BRIG_CHANNEL_TYPE_UNORM_INT8 : O << <STR_LIT> ; break ; case BRIG_CHANNEL_TYPE_UNORM_INT16 : O << <STR_LIT> ; break ; case BRIG_CHANNEL_TYPE_UNORM_INT24 : O << <STR_LIT> ; break ; case BRIG_CHANNEL_TYPE_UNORM_SHORT_555 : O << <STR_LIT> ; break ; case BRIG_CHANNEL_TYPE_UNORM_SHORT_565 : O << <STR_LIT> ; break ; case BRIG_CHANNEL_TYPE_UNORM_INT_101010 : O << <STR_LIT> ; break ; case BRIG_CHANNEL_TYPE_SIGNED_INT8 : O << <STR_LIT>


<s> void <ISA_LIT>InstPrinter :: printBrigMachineModel ( const MCInst * MI , unsigned OpNo , raw_ostream


<s> case BRIG_MEMORY_SCOPE_WAVEFRONT : O << <STR_LIT> ; break ; case BRIG_MEMORY_SCOPE_WORKGROUP : O << <STR_LIT> ; break ; case BRIG_MEMORY_SCOPE_AGENT : O << <STR_LIT> ; break ; case BRIG_MEMORY_SCOPE_SYSTEM : O <<


<s> switch ( MI -> getOperand ( OpNo ) . getImm ( ) ) { case BRIG_COORD_UNNORMALIZED : O << <STR_LIT> ; break ; case BRIG_COORD_NORMALIZED


<s> void <ISA_LIT>InstPrinter :: printBrigSegCvtModifierMask ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { switch ( MI -> getOperand ( OpNo ) . getImm ( ) ) { case BRIG_SEG_CVT_NONULL


<s> O << <STR_LIT> ; break ; case <STR_LIT> : O << <STR_LIT> ; break ; case <STR_LIT> : O << <STR_LIT> ; break ; case <STR_LIT> : O << <STR_LIT> ; break ; case <STR_LIT> : O << <STR_LIT> ; break ; case <STR_LIT> : O << <STR_LIT> ; break ; case <STR_LIT> : O << <STR_LIT> ; break ; case <STR_LIT> : { const MCInstrDesc & Desc = MII . get ( MI -> getOpcode ( ) ) ; if ( Desc . TSFlags & <STR_LIT> ) break ; O << <STR_LIT> ; break ; } default : llvm_unreachable ( <STR_LIT> ) ; } switch ( MI -> getOperand ( OpNo ) . getImm ( ) ) { case BRIG_SEGMENT_GLOBAL : O << <STR_LIT> ; break ; case BRIG_SEGMENT_READONLY


<s> switch ( MI -> getOperand ( OpNo ) . getImm ( ) ) { case BRIG_VARIABLE_DEFINITION : O << <STR_LIT>


<s> void <ISA_LIT>InstPrinter :: printEquiv ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { unsigned Equiv = MI -> getOperand ( OpNo ) .


<s> void <ISA_LIT>InstPrinter :: printEquiv ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { unsigned Equiv = MI -> getOperand ( OpNo ) . getImm ( ) ; if ( Equiv != <NUM_LIT> ) O << <STR_LIT>


<s> void <ISA_LIT>InstPrinter :: printF16 ( const MCInst * MI ,


<s> void <ISA_LIT>InstPrinter :: printF32 ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { const MCOperand & Op = MI -> getOperand ( OpNo ) ; if ( Op . isFPImm ( ) ) { O << format ( <STR_LIT> PRIx32 , FloatToBits ( static_cast < float > ( Op . getFPImm ( ) )


<s> if ( Op . isFPImm ( ) ) { O << format ( <STR_LIT> PRIx64 , DoubleToBits ( Op . getFPImm (


<s> void <ISA_LIT>InstPrinter :: printNoNull ( const MCInst * MI


<s> const MCExpr * Exp = Op . getExpr ( ) ; Exp -> print ( O , & MAI ) ; } else if ( Op . isImm ( )


<s> void <ISA_LIT>InstPrinter :: printS16X2 ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { llvm_unreachable ( <STR_LIT> )


<s> void <ISA_LIT>InstPrinter :: printS16X4 ( const MCInst * MI , unsigned OpNo


<s> void <ISA_LIT>InstPrinter :: printS16X4 ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { llvm_unreachable ( <STR_LIT>


<s> void <ISA_LIT>InstPrinter :: printS32 ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { const MCOperand & Op = MI -> getOperand ( OpNo ) ; if ( Op . isImm ( ) ) { O << format ( <STR_LIT> PRId32 , Op .


<s> if ( Op . isImm ( ) ) { O << format ( <STR_LIT> PRId32 , Op . getImm (


<s> void <ISA_LIT>InstPrinter :: printS32X2 ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { llvm_unreachable ( <STR_LIT>


<s> void <ISA_LIT>InstPrinter :: printS8X4 ( const MCInst * MI , unsigned OpNo , raw_ostream


<s> void <ISA_LIT>InstPrinter :: printS8X8 ( const MCInst * MI , unsigned OpNo , raw_ostream &


<s> void <ISA_LIT>InstPrinter :: printS8X8 ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { llvm_unreachable (


<s> void <ISA_LIT>InstPrinter :: printSImmediate ( int64_t Imm , raw_ostream


<s> O << format ( <STR_LIT> PRIu32 , Op . getImm ( ) ) ; return ; } printOperand ( MI , OpNo ,


<s> const MCOperand & Op = MI -> getOperand ( OpNo ) ; if ( Op . isImm ( ) ) { union Bytes { uint64_t I ; uint32_t U32 [ <NUM_LIT> ] ; } U ; U . I = Op . getImm


<s> void <ISA_LIT>InstPrinter :: printU64 ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { const MCOperand & Op = MI -> getOperand ( OpNo ) ; if ( Op . isImm (


<s> void <ISA_LIT>InstPrinter :: printU8X8 ( const MCInst * MI , unsigned OpNo ,


<s> void <ISA_LIT>InstPrinter :: printV2F32 ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { O <<


<s> O << '(' ; printF32 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printF32 ( MI , OpNo + <NUM_LIT> , O ) ; O << ')'


<s> O << '(' ; printF64 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printF64 ( MI , OpNo + <NUM_LIT> ,


<s> O << '(' ; printU32 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printU32 ( MI , OpNo + <NUM_LIT> , O ) ; O << ')'


<s> O << '(' ; printU64 ( MI , OpNo + <NUM_LIT> , O ) ; O <<


<s> void <ISA_LIT>InstPrinter :: printV3F32 ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { O << '(' ; printF32 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printF32 ( MI , OpNo +


<s> O << '(' ; printF32 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printF32 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printF32 ( MI , OpNo + <NUM_LIT> , O ) ; O <<


<s> O << '(' ; printF64 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printF64 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT>


<s> void <ISA_LIT>InstPrinter :: printV3F64 ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { O << '(' ; printF64 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printF64 ( MI , OpNo + <NUM_LIT> , O ) ; O <<


<s> O << '(' ; printU32 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printU32 ( MI , OpNo + <NUM_LIT> , O ) ; O <<


<s> printU32 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printU32 ( MI , OpNo + <NUM_LIT> , O ) ; O <<


<s> void <ISA_LIT>InstPrinter :: printV3U64 ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { O << '(' ; printU64 ( MI , OpNo


<s> printF32 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printF32 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printF32 ( MI , OpNo + <NUM_LIT> , O ) ; O <<


<s> printU32 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printU32 ( MI , OpNo + <NUM_LIT>


<s> void <ISA_LIT>InstPrinter :: printV4U64 ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { O << '(' ; printU64 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printU64 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT>


<s> O << '(' ; printOperand ( MI , OpNo + <NUM_LIT> , O ) ; O <<


<s> O << '(' ; printOperand ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printOperand ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printOperand ( MI , OpNo + <NUM_LIT> , O ) ; O <<


<s> bool <ISA_LIT>InstrInfo :: expandPostRAPseudo ( MachineBasicBlock :: iterator MBBI ) const { MachineInstr & MI =


<s> break ; } } bool need_insert_not = false ; if ( cond_expr && cond_expr -> isCompare ( ) ) { MachineOperand * CmpOp = TII -> getNamedOperand ( * cond_expr , <STR_LIT> :: op ) ; BrigType CmpType = static_cast < BrigType > ( TII -> getNamedOperand ( * cond_expr , <STR_LIT> :: sourceType ) -> getImm ( ) ) ; BrigCompareOperation OrigOp = static_cast < BrigCompareOperation > ( CmpOp -> getImm ( ) ) ; BrigCompareOperation RevOp = isFPBrigType ( CmpType ) ? invFPCondOp ( OrigOp ) : invIntCondOp ( OrigOp ) ; if ( OrigOp != RevOp ) CmpOp -> setImm ( RevOp ) ; else need_insert_not = true ; } else if ( cond_expr && cond_expr -> getOpcode ( ) == <STR_LIT> ) { cond_reg = cond_expr -> getOperand ( <NUM_LIT> ) . getReg ( ) ; cond_expr -> eraseFromParent


<s> return getNamedOperand ( MI , OpName


<s> const MachineOperand * getNamedOperand ( const MachineInstr & MI , unsigned OpName ) const { return getNamedOperand ( const_cast < MachineInstr & >


<s> if ( TargetRegisterInfo :: isVirtualRegister ( Reg ) ) return MRI . getRegClass ( Reg ) ; return RI . getPhysRegClass


<s> const MachineOperand & MO = MI . getOperand ( OpNo ) ; if ( ! MO . isReg ( ) ) return nullptr ; unsigned Reg = MO . getReg ( ) ; if ( TargetRegisterInfo :: isVirtualRegister ( Reg ) ) return MRI . getRegClass ( Reg ) ; return RI . getPhysRegClass ( Reg


<s> const <ISA_LIT>RegisterInfo & getRegisterInfo (


<s> RegScavenger * getRS ( ) const { return RS


<s> int <STR_LIT> ( uint16_t Opcode , unsigned vsize


<s> return <STR_LIT> ( Opcode , <STR_LIT> (


<s> <ISA_LIT>InstrInfo :: <ISA_LIT>InstrInfo ( <ISA_LIT>Subtarget & st ) : <ISA_LIT>GenInstrInfo ( ) , RI ( st ) { RS = new RegScavenger


<s> <ISA_LIT>InstrInfo :: <ISA_LIT>InstrInfo ( <ISA_LIT>Subtarget & st ) : <ISA_LIT>GenInstrInfo (


<s> assert ( Cond [ <NUM_LIT> ] . isReg ( ) ) ; unsigned cond_reg = Cond [ <NUM_LIT> ] . getReg ( ) ; switch ( static_cast < CondReverseFlag > ( Cond [ <NUM_LIT> ] . getImm ( ) ) ) { case COND_REVERSE_DEPENDANT : assert ( Cond . size ( ) == <NUM_LIT> && Cond [ <NUM_LIT> ] . isImm ( ) ) ; if ( Cond [ <NUM_LIT> ] . getImm ( ) == COND_REVERSE_NEGATIVE ) { MachineRegisterInfo & MRI = MBB . getParent ( ) -> getRegInfo ( ) ; if ( TargetRegisterInfo :: isVirtualRegister ( Cond [ <NUM_LIT> ] . getReg ( ) ) ) cond_reg = MRI . createVirtualRegister ( MRI . getRegClass ( Cond [ <NUM_LIT> ] . getReg ( ) ) ) ; else cond_reg = Cond [ <NUM_LIT> ] . getImm ( ) ; BuildMI ( & MBB , DL , get ( <STR_LIT> ) ) . addReg ( cond_reg , RegState :: Define ) . addReg ( Cond [ <NUM_LIT> ] . getReg ( )


<s> assert ( Cond . size ( ) == <NUM_LIT> && Cond [ <NUM_LIT> ] . isImm ( ) ) ; if ( Cond [ <NUM_LIT> ] . getImm ( ) == COND_REVERSE_NEGATIVE ) { MachineRegisterInfo & MRI = MBB . getParent ( ) -> getRegInfo ( ) ; if ( TargetRegisterInfo :: isVirtualRegister ( Cond [ <NUM_LIT> ] . getReg ( ) ) ) cond_reg = MRI . createVirtualRegister ( MRI . getRegClass ( Cond [ <NUM_LIT> ] . getReg ( ) ) ) ; else cond_reg = Cond [ <NUM_LIT> ] . getImm ( ) ; BuildMI ( & MBB , DL , get ( <STR_LIT> ) ) . addReg ( cond_reg , RegState :: Define ) . addReg ( Cond [ <NUM_LIT> ] . getReg ( ) ) . addImm ( BRIG_TYPE_B1 ) ; } break ; case COND_REVERSE_NEGATIVE : cond_reg = GenerateBranchCondReversion ( MBB , Cond [ <NUM_LIT> ] , this , DL ) ; break ; case COND_REVERSE_POSITIVE : case COND_IRREVERSIBLE : break ; } unsigned Count = <NUM_LIT> ; BuildMI ( & MBB , DL , get ( <STR_LIT> ) ) . addImm ( BRIG_WIDTH_1 ) . addReg ( cond_reg ) . addMBB ( TBB ) . addImm ( BRIG_TYPE_B1 ) ; ++


<s> case BRIG_COMPARE_LE : return BRIG_COMPARE_GT ; case BRIG_COMPARE_LT : return BRIG_COMPARE_GE ; case BRIG_COMPARE_NE : return BRIG_COMPARE_EQ ; default : return Op


<s> bool <ISA_LIT>InstrInfo :: isCoalescableExtInstr ( const MachineInstr & MI , unsigned &

SrcReg , unsigned & DstReg , unsigned & SubIdx ) const {


<s> bool <ISA_LIT>InstrInfo :: isCoalescableExtInstr ( const MachineInstr & MI , unsigned & SrcReg , unsigned & DstReg , unsigned & SubIdx


<s> Q . pop ( ) ; for ( MachineBasicBlock :: succ_iterator succ = cur_mbb -> succ_begin ( ) , succ_end = cur_mbb -> succ_end ( ) ; succ != succ_end ; ++ succ ) if ( ! Visited . count ( * succ ) ) { Visited . insert ( * succ ) ; bool need_process_futher = true ; for ( MachineBasicBlock :: iterator instr = ( * succ ) -> begin ( ) , instr_end = ( * succ ) -> end ( ) ; instr != instr_end ; ++ instr ) { if ( instr -> readsRegister ( Reg ) ) { if ( instr -> getParent ( ) == & MBB && ( instr -> isBranch ( ) || ( instr -> getOpcode ( ) == <STR_LIT> ) ) ) { CanReverse = false ; } return false


<s> case BRIG_TYPE_F16 : return true ; default : return false


<s> static bool isFPBrigType ( BrigType BT ) { switch ( BT ) { case BRIG_TYPE_F32 : case BRIG_TYPE_F64 : case


<s> bool isInstAddr ( uint16_t Opcode ) const { return get ( Opcode ) .


<s> bool isInstAtomic ( uint16_t Opcode ) const { return get ( Opcode )


<s> bool isInstBr ( uint16_t Opcode ) const { return get ( Opcode ) . TSFlags &


<s> bool isInstMem ( uint16_t Opcode ) const { return get ( Opcode ) . TSFlags


<s> bool isInstMod ( uint16_t Opcode ) const { return get ( Opcode ) . TSFlags


<s> if ( ! MCID . mayLoad ( ) || ! MI -> hasOneMemOperand ( ) ) return <STR_LIT> ; const MachineOperand * Segment = getNamedOperand ( * MI , <STR_LIT> :: segment ) ; if ( ! Segment || Segment -> getImm ( ) != <STR_LIT> ) return <STR_LIT> ; int AddressIdx = <STR_LIT> ( MI -> getOpcode ( ) , <STR_LIT> ::


<s> unsigned <ISA_LIT>InstrInfo :: isLoadFromStackSlotPostFE ( const MachineInstr * MI , int


<s> static bool IsSpilledAfterDef ( MachineInstr * start , unsigned reg ) { bool canBeSpilled = false ; if ( ! CheckSpillAfterDef ( start , reg , canBeSpilled ) ) { std :: queue < MachineBasicBlock * > Q ; SmallPtrSet < MachineBasicBlock * , <NUM_LIT> > Visited ; MachineBasicBlock * MBB = start -> getParent ( ) ; Q . push ( MBB ) ; while ( ! Q . empty (


<s> unsigned <ISA_LIT>InstrInfo :: isStoreToStackSlot ( const MachineInstr * MI , int & FrameIndex ) const { const MCInstrDesc & MCID = get ( MI -> getOpcode ( ) ) ; if ( ! MCID . mayStore ( ) || ! MI -> hasOneMemOperand ( ) ) return <NUM_LIT> ; const MachineOperand * Segment = getNamedOperand ( * MI , <STR_LIT> :: segment ) ; if ( ! Segment || Segment -> getImm ( ) != <STR_LIT> ) return <STR_LIT> ; int AddressIdx = <STR_LIT> ( MI -> getOpcode ( ) , <STR_LIT> :: address ) ; const MachineOperand & Base = MI -> getOperand ( AddressIdx + <STR_LIT> ) ; if ( Base .


<s> unsigned Count = <NUM_LIT> ; while ( I != MBB . begin ( ) ) { -- I ; if ( I -> isDebugValue ( ) ) continue ; if ( I -> getOpcode ( ) != <STR_LIT> && I -> getOpcode ( ) != <STR_LIT> ) break ; I -> eraseFromParent ( ) ; I = MBB . end ( ) ; ++ Count ; } return


<s> for ( SmallVectorImpl < MachineOperand > :: iterator I = Cond . begin ( ) , E = Cond . end ( ) ; I != E ; ++ I ) { ++ I ; if ( static_cast < CondReverseFlag > ( I -> getImm ( ) ) == COND_IRREVERSIBLE ) return true ; } for ( SmallVectorImpl < MachineOperand > :: iterator I = Cond . begin ( ) , E = Cond . end ( ) ; I != E ; ++ I ) { ++ I ; assert ( I -> isImm ( ) ) ; CondReverseFlag cond_rev_flag = static_cast < CondReverseFlag > ( I -> getImm ( ) ) ; switch ( cond_rev_flag ) { case COND_REVERSE_POSITIVE


<s> if ( ! Node1 -> isMachineOpcode ( ) ) return false ; MachineSDNode * mnode1 = cast < MachineSDNode >


<s> case <STR_LIT> : Opc = <STR_LIT> ; BT = BRIG_TYPE_U32 ; break ; case <STR_LIT> : Opc = <STR_LIT> ; BT = BRIG_TYPE_U64 ; break ; case <STR_LIT> : { <ISA_LIT>MachineFunctionInfo * MFI = MF . getInfo < <ISA_LIT>MachineFunctionInfo > ( ) ; MFI -> setHasSpilledCRs ( ) ; Opc = <STR_LIT> ; BT = BRIG_TYPE_B1 ; break ; } } if ( MI != MBB . end ( ) ) { DL = MI -> getDebugLoc ( ) ; } switch ( RC -> getID ( ) ) { default : llvm_unreachable ( <STR_LIT> ) ; break ; case <STR_LIT> : case


<s> bool <ISA_LIT>InstrInfo :: verifyInstruction ( const MachineInstr * MI , StringRef & ErrInfo ) const { return true


<s> <ISA_LIT>InstrInfo :: ~ <ISA_LIT>InstrInfo ( ) { delete


<s> Function * <ISA_LIT>IntrinsicInfo :: getDeclaration ( Module * M , unsigned IntrID , Type * * Tys , unsigned int numTys ) const { llvm_unreachable ( <STR_LIT> ) ; return nullptr


<s> std :: string <ISA_LIT>IntrinsicInfo :: getName ( unsigned int IntrID , Type * * Tys , unsigned int numTys ) const { static const char * const names [ ]


<s> static const char * const names [ ] = { } ; if ( IntrID < <STR_LIT> ) { return <NUM_LIT> ; } assert ( IntrID < <STR_LIT> && <STR_LIT> ) ; std :: string Result ( names [ IntrID - <STR_LIT> ] ) ; return Result


<s> switch ( AS ) { default : return false ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT>


<s> FunctionPass * llvm :: create<ISA_LIT>ISelDag (


<s> case <STR_LIT> : case <STR_LIT> : return BRIG_COMPARE_GE ; case <STR_LIT> : case <STR_LIT> : return BRIG_COMPARE_LT ; case <STR_LIT> : case <STR_LIT> : return BRIG_COMPARE_LE ; case <STR_LIT> : case <STR_LIT> : return BRIG_COMPARE_NE ; case <STR_LIT> : return BRIG_COMPARE_NUM ; case <STR_LIT> : return BRIG_COMPARE_NAN ; case <STR_LIT> : return BRIG_COMPARE_EQU ; case <STR_LIT> : return BRIG_COMPARE_GTU ; case <STR_LIT> : return BRIG_COMPARE_GEU ; case <STR_LIT> : return BRIG_COMPARE_LTU ; case <STR_LIT> : return


<s> return BRIG_COMPARE_EQ ; case <STR_LIT> : return BRIG_COMPARE_GT ; case <STR_LIT> : return BRIG_COMPARE_GE ; case <STR_LIT> : return BRIG_COMPARE_LT ; case <STR_LIT> : return BRIG_COMPARE_LE ; case <STR_LIT> : Signed = true ; return BRIG_COMPARE_NE ; case <STR_LIT> : Signed = true ; return BRIG_COMPARE_EQ ; case <STR_LIT> : Signed = true ; return BRIG_COMPARE_GT ; case <STR_LIT> : Signed = true ; return BRIG_COMPARE_GE


<s> case Monotonic : return BRIG_MEMORY_ORDER_RELAXED ; case Acquire : return BRIG_MEMORY_ORDER_SC_ACQUIRE ; case Release : return BRIG_MEMORY_ORDER_SC_RELEASE ; case AcquireRelease : case SequentiallyConsistent : return BRIG_MEMORY_ORDER_SC_ACQUIRE_RELEASE ; default : llvm_unreachable (


<s> 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 <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 <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 <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 <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 <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 <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 <STR_LIT> : return <STR_LIT>


<s> 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 <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 <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 <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 <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 <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT>


<s> case BRIG_TYPE_S32 : return <STR_LIT> ; case BRIG_TYPE_F32 : return <STR_LIT> ; case BRIG_TYPE_U64 : return <STR_LIT> ; case BRIG_TYPE_S64 : return <STR_LIT> ; case BRIG_TYPE_F64 : return <STR_LIT> ; case BRIG_TYPE_U8 : return <STR_LIT> ; case BRIG_TYPE_S8 : return <STR_LIT> ; case BRIG_TYPE_U16 : return <STR_LIT> ; case BRIG_TYPE_S16 : return <STR_LIT> ; default : llvm_unreachable ( <STR_LIT> )


<s> const char * getPassName ( ) const override { return <STR_LIT>


<s> return <STR_LIT> ; case BRIG_TYPE_F64 : return <STR_LIT> ; case BRIG_TYPE_U8 : return <STR_LIT> ; case BRIG_TYPE_S8 : return <STR_LIT> ; case BRIG_TYPE_U16 : return <STR_LIT> ; case BRIG_TYPE_S16 : return <STR_LIT> ; default : llvm_unreachable (


<s> case BRIG_TYPE_U32 : return <STR_LIT> ; case BRIG_TYPE_F32 : return <STR_LIT> ; case BRIG_TYPE_U64 : return <STR_LIT> ; case BRIG_TYPE_F64 : return <STR_LIT> ; case


<s> bool <ISA_LIT>DAGToDAGISel :: isKernelFunc ( ) const { const MachineFunction & MF = CurDAG -> getMachineFunction ( ) ; return <STR_LIT> ( MF . getFunction


<s> EVT VT = N0 . getValueType ( ) ; if ( VT . isInteger ( ) && ! VT . isVector ( ) ) { APInt LHSZero , LHSOne ; APInt RHSZero , RHSOne ; CurDAG -> computeKnownBits ( N0 , LHSZero , LHSOne ) ; if ( LHSZero . getBoolValue ( ) ) { CurDAG -> computeKnownBits ( N1 ,


<s> bool <ISA_LIT>DAGToDAGISel :: IsOREquivalentToADD ( SDValue Op ) const { assert ( Op . getOpcode ( ) == <STR_LIT> ) ; SDValue N0 = Op -> getOperand ( <NUM_LIT> ) ; SDValue N1 = Op -> getOperand ( <NUM_LIT> ) ; EVT VT = N0 . getValueType ( ) ; if ( VT . isInteger ( ) && ! VT . isVector ( ) ) { APInt LHSZero , LHSOne ; APInt RHSZero , RHSOne ; CurDAG -> computeKnownBits ( N0 , LHSZero , LHSOne ) ; if ( LHSZero . getBoolValue (


<s> bool <ISA_LIT>DAGToDAGISel :: IsProfitableToFold ( SDValue N , SDNode * U , SDNode * Root ) const { return


<s> if ( Base . getNode ( ) == <NUM_LIT> ) Base = CurDAG -> getRegister ( <NUM_LIT> , VT ) ; if ( Reg . getNode ( ) == <NUM_LIT> ) Reg = CurDAG -> getRegister ( <NUM_LIT> , VT ) ; return


<s> SDNode * <ISA_LIT>DAGToDAGISel :: SelectAddrSpaceCast ( AddrSpaceCastSDNode * ASC ) const { SDValue Cast ( ASC , <NUM_LIT> ) ; unsigned DstAS = ASC -> getDestAddressSpace ( ) ; unsigned SrcAS = ASC -> getSrcAddressSpace ( ) ; EVT DestVT = ASC -> getValueType ( <NUM_LIT> ) ; EVT SrcVT = ASC -> getOperand ( <NUM_LIT> ) . getValueType ( ) ; bool Src32 = ( SrcVT == <STR_LIT> ) ; bool Dst32 = ( DestVT == <STR_LIT> ) ; unsigned Opcode ; SDValue Segment , NoNull , Ptr , DestType , SrcType ; SDLoc SL ( ASC ) ; if ( SrcAS == <STR_LIT> ) { if ( Src32 && Dst32 ) Opcode = <STR_LIT> ; else if ( Src32 && ! Dst32 ) llvm_unreachable ( <STR_LIT> ) ; else if ( ! Src32 && Dst32 ) Opcode = <STR_LIT> ; else Opcode = <STR_LIT> ; Segment = CurDAG -> getTargetConstant ( DstAS , SL , <STR_LIT> ) ; SelectAddrSpaceCastCommon ( * ASC , NoNull , Ptr , DestType , SrcType ) ; } else if ( DstAS == <STR_LIT> ) { if ( Src32 && Dst32 ) Opcode = <STR_LIT> ; else if ( Src32 && ! Dst32 ) Opcode = <STR_LIT> ; else if ( ! Src32 && Dst32 ) llvm_unreachable ( <STR_LIT> ) ; else Opcode = <STR_LIT> ; Segment = CurDAG -> getTargetConstant ( SrcAS , SL , <STR_LIT> ) ; SelectAddrSpaceCastCommon ( * ASC , NoNull ,


<s> SDNode * <ISA_LIT>DAGToDAGISel :: SelectArgLd ( MemSDNode * Node ) const { bool IsRetLd = Node -> getConstantOperandVal ( <NUM_LIT> ) ; bool IsSext = Node -> getConstantOperandVal ( <NUM_LIT> ) ; SDValue Base , Reg , Offset ; if ( ! SelectAddr ( Node -> getOperand ( <NUM_LIT> ) , Base , Reg , Offset ) ) return nullptr ; MVT MemVT = Node -> getMemoryVT ( ) . getSimpleVT ( ) ; BrigType BT = getBrigType ( MemVT . SimpleTy , IsSext ) ; SDLoc SL ( Node ) ; SDValue Ops [ <NUM_LIT> ] =


<s> bool <ISA_LIT>DAGToDAGISel :: SelectAtomicAddr ( SDNode * ParentAtomic , SDValue Addr , SDValue & Segment , SDValue & Order , SDValue & Scope , SDValue & Equiv , SDValue & Base , SDValue & Reg , SDValue & Offset ) const { if ( ! SelectAddr ( Addr , Base , Reg , Offset ) ) return false ; const AtomicSDNode * Atomic = cast < AtomicSDNode > ( ParentAtomic ) ; AtomicOrdering SuccOrder = Atomic -> getSuccessOrdering ( ) ; SynchronizationScope SyncScope = Atomic -> getSynchScope ( ) ; unsigned AS = Atomic -> getAddressSpace ( ) ; SDLoc SL ( ParentAtomic ) ; Segment = CurDAG -> getTargetConstant ( AS , SL , <STR_LIT> ) ; Order = CurDAG -> getTargetConstant ( getBrigMemoryOrder ( SuccOrder ) , SL , <STR_LIT> ) ; Scope = CurDAG -> getTargetConstant ( getBrigMemoryScope ( SyncScope , AS ) , SL , <STR_LIT> ) ; Equiv = CurDAG -> getTargetConstant ( <NUM_LIT> , SL ,


<s> Segment = CurDAG -> getTargetConstant ( AS , SL , <STR_LIT> ) ; Order = CurDAG -> getTargetConstant ( getBrigMemoryOrder ( SuccOrder ) , SL , <STR_LIT> ) ; Scope = CurDAG -> getTargetConstant ( getBrigMemoryScope ( SyncScope , AS ) , SL , <STR_LIT> ) ; Equiv = CurDAG -> getTargetConstant ( <NUM_LIT> ,


<s> SDLoc SL ( In ) ; Src = CurDAG -> getTargetConstant ( C -> getAPIntValue ( ) , SL , C -> getValueType ( <NUM_LIT> ) ) ; } else if ( ConstantFPSDNode * C = dyn_cast < ConstantFPSDNode > ( In ) ) { SDLoc SL (


<s> SDLoc SL ( In ) ; Src = CurDAG -> getTargetConstantFP ( C -> getValueAPF ( ) , SL , C -> getValueType ( <NUM_LIT> ) ) ; } else Src = In ; return


<s> SDNode * ResNode ; unsigned IntNo = cast < ConstantSDNode > ( Node -> getOperand ( <NUM_LIT> ) ) -> getZExtValue ( ) ; bool hasSampler = false ; if ( IntNo == <STR_LIT> ) { SDLoc SL ; const SDValue Ops [ ] = { CurDAG -> getTargetConstant ( <NUM_LIT> , SL , <STR_LIT> ) , CurDAG -> getTargetConstant ( BRIG_TYPE_ROIMG , SL , <STR_LIT> ) , CurDAG -> getTargetConstant ( BRIG_TYPE_S32 , SL , <STR_LIT> ) , CurDAG -> getTargetConstant ( BRIG_GEOMETRY_1D , SL , <STR_LIT> ) , CurDAG -> getTargetConstant ( <NUM_LIT> , SL , <STR_LIT> ) , Node -> getOperand ( <NUM_LIT> ) , Node -> getOperand ( <NUM_LIT> ) , Node -> getOperand ( <NUM_LIT> ) , CurDAG -> getTargetConstant ( BRIG_TYPE_F32 , SL , <STR_LIT> ) , Chain } ; return CurDAG -> SelectNodeTo ( Node , <STR_LIT> , Node -> getVTList ( ) , Ops ) ; } if ( <ISA_LIT>IntrinsicInfo :: isReadImage ( ( <STR_LIT> ) IntNo ) ) { hasSampler = true ; } else if ( ! <ISA_LIT>IntrinsicInfo :: isLoadImage ( (


<s> unsigned IntNo = cast < ConstantSDNode > ( Node -> getOperand ( <NUM_LIT> ) ) -> getZExtValue ( ) ; if ( <ISA_LIT>IntrinsicInfo :: isReadImage ( ( <STR_LIT> ) IntNo ) || <ISA_LIT>IntrinsicInfo :: isLoadImage ( ( <STR_LIT> )

IntNo ) ) return SelectImageIntrinsic ( Node ) ;


<s> unsigned AS = Load -> getAddressSpace ( ) ; SDLoc SL ( ParentLoad ) ; MVT MemVT = Load -> getMemoryVT ( ) . getSimpleVT ( ) ; <STR_LIT> ExtTy = Load -> getExtensionType ( ) ; unsigned BrigType = getBrigType ( MemVT . SimpleTy , ExtTy == <STR_LIT> ) ; Segment = CurDAG -> getTargetConstant ( AS , SL , <STR_LIT> ) ; Align = CurDAG -> getTargetConstant ( Load -> getAlignment


<s> SDLoc SL ( SetCC ) ; SDValue CmpOp = CurDAG -> getTargetConstant ( BrigCmp , SL , <STR_LIT> ) ; SDValue FTZ = CurDAG -> getTargetConstant ( VT == <STR_LIT> , SL , <STR_LIT> ) ; SDValue DestType = CurDAG -> getTargetConstant ( BRIG_TYPE_B1 , SL , <STR_LIT> ) ; BrigType SrcBT = getBrigType ( VT . SimpleTy , Signed ) ; SDValue SrcType = CurDAG -> getTargetConstant ( SrcBT , SL , <STR_LIT> ) ; const SDValue Ops [ ] = { CmpOp , FTZ , LHS , RHS ,


<s> assert ( ! Store -> isIndexed ( ) ) ; if ( ! SelectAddr ( Addr , Base , Reg , Offset ) ) return false ; unsigned AS = Store -> getAddressSpace ( ) ; MVT MemVT = Store -> getMemoryVT ( ) . getSimpleVT ( ) ; unsigned BrigType = getBrigTypeFromStoreType ( MemVT . SimpleTy ) ; SDLoc SL ( ParentStore ) ; Segment = CurDAG -> getTargetConstant ( AS , SL , <STR_LIT> ) ; Align = CurDAG -> getTargetConstant ( Store -> getAlignment ( ) , SL , <STR_LIT> ) ; Type = CurDAG -> getTargetConstant ( BrigType , SL , <STR_LIT> ) ; return


<s> if ( Fast ) * Fast = true ; return true


<s> unsigned <ISA_LIT>TargetLowering :: ComputeNumSignBitsForTargetNode ( SDValue Op , const

SelectionDAG & DAG , unsigned Depth ) const {


<s> const SDValue Ops [ ] = { Chain , PtrOffs , DAG . getTargetConstant ( Width , SL , <STR_LIT> ) , DAG . getTargetConstant ( IsRetArgLoad , SL , <STR_LIT> ) , DAG . getTargetConstant ( isSExt , SL , <STR_LIT> ) , InFlag } ; ArrayRef < SDValue > OpsArr = makeArrayRef ( Ops ) ; if ( ! InFlag ) OpsArr = OpsArr . drop_back ( <NUM_LIT> ) ; EVT VT = ( MemVT . getStoreSize ( ) < <NUM_LIT> ) ? <STR_LIT> : ArgVT ; SDVTList VTs = DAG . getVTList ( VT , <STR_LIT> , <STR_LIT> ) ; MachinePointerInfo PtrInfo ( UndefValue :: get ( ArgPT ) , Offset ) ; SDValue Arg = DAG . getMemIntrinsicNode ( <STR_LIT> , SL , VTs , OpsArr , MemVT , PtrInfo , Align , false , true , false , MemVT . getStoreSize ( ) ) ; if ( ArgVT == <STR_LIT> ) { const SDValue Ops [ ] = { DAG . getNode ( <STR_LIT> , SL , <STR_LIT> , Arg ) , Arg . getValue ( <NUM_LIT> ) , Arg . getValue ( <NUM_LIT> ) } ; return DAG . getMergeValues ( Ops , SL


<s> const MachineFunction & MF = DAG . getMachineFunction ( ) ; const DataLayout & DL = MF . getFunction ( ) -> getParent ( ) -> getDataLayout ( ) ; Type * EltTy = Ty ; if ( Ty -> isArrayTy ( ) ) EltTy = Ty -> getArrayElementType ( ) ; EltTy = EltTy -> getScalarType ( ) ; MVT PtrVT = getPointerTy ( DL , AddressSpace ) ; PointerType * ArgPT = PointerType :: get ( EltTy , AddressSpace ) ; Offset += DL . getTypeStoreSize ( EltTy ) * Index ; EVT MemVT = ArgVT ; if ( ArgVT == <STR_LIT> ) { MemVT = <STR_LIT> ; Value = DAG . getNode ( <STR_LIT> , SL , <STR_LIT> , Value ) ; } SDValue PtrOffs = DAG . getNode ( <STR_LIT> , SL , PtrVT , Ptr , DAG . getConstant ( Offset , SL , PtrVT ) ) ; unsigned Align = getElementAlignment ( DL , Ty , Index ) ; if ( AddressSpace == <STR_LIT> ) Align = DL . getABITypeAlignment ( EltTy ) ; SDValue Ops [ ] = { Chain , Value , PtrOffs , InFlag } ; ArrayRef < SDValue > OpsArr = makeArrayRef ( Ops


<s> Type * EltTy = Ty -> getScalarType ( ) ; unsigned ffs = <NUM_LIT> ; while ( ( ( n >> ffs ) & <NUM_LIT> ) == <NUM_LIT> ) ffs ++ ; Alignment = ( DL . getABITypeAlignment ( EltTy ) * ( <NUM_LIT> << ffs ) ) & ( Alignment - <NUM_LIT> ) ; } else { if ( OpaqueType OT = GetOpaqueType ( Ty ) ) { if ( IsImage ( OT ) || OT


<s> if ( Ty -> isArrayTy ( ) ) return getElementAlignment ( DL , Ty -> getArrayElementType ( ) , <NUM_LIT> ) ; unsigned Alignment = DL . getABITypeAlignment ( Ty ) ; if ( n && ( Alignment > <NUM_LIT> ) ) { Type * EltTy = Ty -> getScalarType ( ) ; unsigned ffs = <NUM_LIT> ; while ( ( ( n >> ffs ) & <NUM_LIT> ) == <NUM_LIT> ) ffs ++ ; Alignment = ( DL . getABITypeAlignment ( EltTy ) * ( <NUM_LIT> << ffs ) ) & ( Alignment - <NUM_LIT> ) ; } else { if ( OpaqueType OT = GetOpaqueType ( Ty ) ) { if ( IsImage ( OT ) || OT ==


<s> static BrigType getParamBrigType ( Type * Ty , const DataLayout & DL , bool IsSExt ) { BrigType BT = <STR_LIT> ( Ty , DL , IsSExt ) ; if ( BT == BRIG_TYPE_B1 ) { assert ( ! IsSExt && <STR_LIT> ) ; return IsSExt ? BRIG_TYPE_S8 :


<s> uint8_t <ISA_LIT>TargetLowering :: getRepRegClassCostFor ( MVT VT ) const { return


<s> EVT <ISA_LIT>TargetLowering :: getSetCCResultType ( const DataLayout & DL , LLVMContext & Context , EVT VT ) const { return <STR_LIT>


<s> bool <ISA_LIT>TargetLowering :: isDesirableToTransformToIntegerOp ( unsigned Opc , EVT VT ) const { return ( Opc == <STR_LIT> || Opc == <STR_LIT> ) && ( VT . getSimpleVT ( ) == <STR_LIT> || VT . getSimpleVT ( )


<s> bool <ISA_LIT>TargetLowering :: isDesirableToTransformToIntegerOp ( unsigned Opc , EVT VT ) const { return ( Opc == <STR_LIT> || Opc == <STR_LIT> ) && ( VT . getSimpleVT ( ) == <STR_LIT> || VT . getSimpleVT


<s> bool <ISA_LIT>TargetLowering :: isFPImmLegal ( const APFloat & Imm , EVT VT ) const { return ( VT == EVT ( <STR_LIT> ) || VT == EVT ( <STR_LIT>


<s> bool <ISA_LIT>TargetLowering :: isFPImmLegal ( const APFloat & Imm , EVT VT ) const { return ( VT == EVT ( <STR_LIT> ) || VT


<s> bool <ISA_LIT>TargetLowering :: isOffsetFoldingLegal ( const GlobalAddressSDNode *


<s> bool <ISA_LIT>TargetLowering :: isOffsetFoldingLegal ( const GlobalAddressSDNode * GA ) const { return


<s> else if ( sType -> isIntegerTy ( <NUM_LIT> ) ) argVT = <STR_LIT> ; bool isLoad = Ins != nullptr ; bool hasFlag = InFlag . getNode ( ) != nullptr ; SDValue ArgValue ; const VectorType * VecTy = dyn_cast < VectorType > ( type ) ; const ArrayType * ArrTy = dyn_cast < ArrayType > ( type ) ; if ( VecTy || ArrTy ) { unsigned num_elem = VecTy ? VecTy -> getNumElements ( ) : ArrTy -> getNumElements ( ) ; for ( unsigned i = <NUM_LIT> ; i < num_elem ; ++ i ) { if ( isLoad ) { bool IsSExt = ( * Ins ) [ ArgNo ] . Flags . isSExt ( ) ; ArgValue = getArgLoad ( DAG , dl , argVT , type , IsSExt , AS , Chain , ParamPtr , InFlag , i , isRetArgLoad , offset ) ; } else { ArgValue = getArgStore ( DAG , dl , argVT , type , AS , Chain , ParamPtr , ( * OutVals ) [ ArgNo ] , i , InFlag , AAInfo , offset ) ; } if ( ChainLink ) Chain = ArgValue . getValue ( isLoad ? <NUM_LIT> : <NUM_LIT> ) ; InFlag = ArgValue . getValue ( isLoad ? <NUM_LIT> : <NUM_LIT> ) ; if ( InVals ) InVals -> push_back ( ArgValue ) ; ArgNo ++ ; } return ArgValue ; } if ( StructType * STy = dyn_cast < StructType > ( type ) ) { const StructLayout * SL = DL . getStructLayout ( STy ) ; unsigned num_elem = STy -> getNumElements ( ) ; for ( unsigned i = <NUM_LIT> ; i < num_elem ; ++ i ) { ArgValue = LowerArgument ( Chain , InFlag , ChainLink , Ins , Outs , dl , DAG , InVals , ArgNo , STy -> getElementType ( i ) , AS , ParamName , ParamPtr , OutVals , isRetArgLoad , AAInfo , offset + SL -> getElementOffset ( i ) ) ; if ( ChainLink ) Chain = ArgValue . getValue ( isLoad ? <NUM_LIT> : <NUM_LIT> ) ; if ( hasFlag ) InFlag = ArgValue . getValue ( isLoad ? <NUM_LIT> : <NUM_LIT> ) ; } return ArgValue ; } if ( isLoad ) { bool IsSExt = ( * Ins ) [ ArgNo ] . Flags . isSExt ( ) ; ArgValue = getArgLoad ( DAG , dl , argVT , type , IsSExt , AS , Chain , ParamPtr , InFlag , <NUM_LIT> , isRetArgLoad , offset ) ; } else { ArgValue = getArgStore ( DAG , dl , argVT , type , AS , Chain , ParamPtr , ( * OutVals ) [ ArgNo ] , <NUM_LIT> , InFlag , AAInfo , offset ) ; } if ( InVals ) InVals -> push_back ( ArgValue ) ; ArgNo ++


<s> for ( unsigned i = <NUM_LIT> ; i < num_elem ; ++ i ) { if ( isLoad ) { bool IsSExt = ( * Ins ) [ ArgNo ] . Flags . isSExt ( ) ; ArgValue = getArgLoad ( DAG , dl , argVT , type , IsSExt , AS , Chain , ParamPtr , InFlag , i , isRetArgLoad , offset ) ; } else { ArgValue = getArgStore ( DAG , dl , argVT , type , AS , Chain , ParamPtr , ( * OutVals ) [ ArgNo ] , i , InFlag , AAInfo , offset ) ; } if ( ChainLink ) Chain = ArgValue . getValue ( isLoad ? <NUM_LIT> : <NUM_LIT> ) ; InFlag = ArgValue . getValue ( isLoad ? <NUM_LIT> : <NUM_LIT> ) ; if ( InVals ) InVals -> push_back ( ArgValue ) ; ArgNo ++ ; } return ArgValue ; } if ( StructType * STy = dyn_cast < StructType > ( type ) ) { const StructLayout * SL = DL . getStructLayout ( STy ) ; unsigned num_elem = STy -> getNumElements ( ) ; for ( unsigned i = <NUM_LIT> ; i < num_elem ; ++ i ) { ArgValue = LowerArgument ( Chain , InFlag , ChainLink , Ins , Outs , dl , DAG , InVals , ArgNo , STy -> getElementType ( i ) , AS , ParamName , ParamPtr , OutVals , isRetArgLoad , AAInfo , offset + SL -> getElementOffset ( i ) ) ; if ( ChainLink ) Chain = ArgValue . getValue ( isLoad ? <NUM_LIT> : <NUM_LIT> ) ; if ( hasFlag ) InFlag = ArgValue . getValue ( isLoad ? <NUM_LIT> : <NUM_LIT> ) ; } return


<s> FuncName = GV -> getName ( ) . data ( ) ; } else llvm_unreachable ( <STR_LIT> ) ; assert ( funcType != nullptr ) ; SmallVector < SDValue , <NUM_LIT> > Ops ; SmallVector < SDValue , <NUM_LIT> > VarOps ; SDVTList VTs = DAG . getVTList ( <STR_LIT> , <STR_LIT> ) ; Type * retType = funcType -> getReturnType ( ) ; SDValue RetValue ; if ( ! retType -> isVoidTy ( ) ) { MVT PtrVT = getPointerTy ( DL , <STR_LIT> ) ; RetValue = DAG . getTargetExternalSymbol ( PM . getParamName ( PM . addCallRetParam ( retType , PM . mangleArg ( & Mang , FuncName , DL ) ) ) , PtrVT ) ; unsigned NElts ; Type * EmitTy = <STR_LIT> ( retType , NElts , DL ) ; BrigType BT = getParamBrigType ( EmitTy , DL , CLI . RetSExt ) ; unsigned Align = <STR_LIT> ( retType , DL , false ) ; const SDValue ArgDeclOps [ ] = { RetValue , DAG . getTargetConstant ( BT , dl , <STR_LIT> ) , DAG . getTargetConstant ( NElts , dl , PtrVT ) , DAG . getTargetConstant ( Align , dl , <STR_LIT> ) , Chain , InFlag } ; SDNode * ArgDeclNode = DAG . getMachineNode ( <STR_LIT> , dl , VTs , ArgDeclOps ) ; SDValue ArgDecl ( ArgDeclNode , <NUM_LIT> ) ; Chain = SDValue ( ArgDeclNode , <NUM_LIT> ) ; InFlag = Chain . getValue ( <NUM_LIT> ) ; VarOps . push_back ( RetValue ) ; } VarOps . push_back ( DAG . getTargetConstant ( <NUM_LIT> , dl , <STR_LIT> ) ) ; unsigned FirstArg = VarOps . size ( ) ; unsigned int j = <NUM_LIT> , k = <NUM_LIT> ; Function :: const_arg_iterator ai ; Function :: const_arg_iterator ae ; if ( calleeFunc ) { ai = calleeFunc -> arg_begin ( ) ; ae = calleeFunc -> arg_end ( ) ; } MVT ArgPtrVT = getPointerTy ( DL , <STR_LIT> ) ; MDBuilder MDB ( * DAG . getContext ( ) ) ; for ( FunctionType :: param_iterator pb = funcType -> param_begin ( ) , pe = funcType -> param_end ( ) ; pb != pe ; ++ pb , ++ ai , ++ k ) { Type * type = * pb ; std :: string ParamName ; if ( calleeFunc && ai != ae ) { ParamName = PM . mangleArg ( & Mang , ai -> getName ( ) , DL ) ; } if ( ParamName . empty ( ) ) { ParamName =


<s> <ISA_LIT>MachineFunctionInfo * FuncInfo = MF . getInfo < <ISA_LIT>MachineFunctionInfo > ( ) ; <ISA_LIT>ParamManager & PM = FuncInfo -> getParamManager ( ) ; unsigned AS = <STR_LIT> ( MF . getFunction ( ) ) ? <STR_LIT> : <STR_LIT> ; const DataLayout & DL = MF . getFunction ( ) -> getParent ( ) -> getDataLayout ( ) ; MVT PtrTy = getPointerTy ( DL , AS ) ; Mangler Mang ; Function :: const_arg_iterator AI = MF . getFunction ( ) -> arg_begin ( ) ; Function :: const_arg_iterator AE = MF . getFunction ( ) -> arg_end ( ) ; for ( unsigned ArgNo = <NUM_LIT> ; AI != AE ; ++ AI ) { unsigned Param = PM . addArgumentParam ( AS , * AI , <ISA_LIT>ParamManager :: mangleArg ( & Mang , AI -> getName ( ) , DL ) ) ; const char * ParamName = PM . getParamName ( Param ) ; std :: string md = ( AI -> getName ( ) + <STR_LIT> + ParamName + <STR_LIT> ) . str ( ) ; FuncInfo -> addMetadata ( <STR_LIT> + md , true ) ; SDValue ParamPtr = DAG . getTargetExternalSymbol ( ParamName , PtrTy ) ; LowerArgument ( Chain , SDValue ( ) , false , & Ins , nullptr , dl , DAG , & InVals , ArgNo , AI -> getType ( ) , AS , ParamName , ParamPtr , nullptr ) ; } return


<s> <ISA_LIT>ParamManager & PM = FuncInfo -> getParamManager ( ) ; const Function * F = MF . getFunction ( ) ; const FunctionType * funcType = F -> getFunctionType ( ) ; SmallVector < SDValue , <NUM_LIT> > RetOps ; RetOps . push_back ( Chain ) ; const DataLayout & DL = F -> getParent ( ) -> getDataLayout ( ) ; Type * type = funcType -> getReturnType ( ) ; if ( ! type -> isVoidTy ( ) ) { Mangler Mang ; const char * SymName = PM . getParamName ( PM . addReturnParam ( type , PM . mangleArg ( & Mang , F -> getName ( ) , DL ) ) ) ; MVT ArgPtrVT = getPointerTy ( DL , <STR_LIT> ) ; SDValue RetVariable = DAG . getTargetExternalSymbol ( SymName , ArgPtrVT ) ; AAMDNodes MD ; unsigned ArgNo = <NUM_LIT> ; LowerArgument ( Chain , SDValue ( ) , false , nullptr , & Outs , dl , DAG , & RetOps , ArgNo , type , <STR_LIT> , nullptr , RetVariable , & OutVals , false , MD ) ; Chain = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , RetOps ) ; } return DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , Chain


<s> SelectionDAG & DAG = DCI . DAG ; SDLoc dl = SDLoc ( N ) ; EVT VT = N -> getValueType ( <NUM_LIT> ) ; if ( SHR && ( Opr0 == Opr1 ) && ( Opr0 . getOpcode ( ) == <STR_LIT> ) ) { if ( ConstantSDNode * AndMask = dyn_cast < ConstantSDNode > ( Opr0 . getOperand ( <NUM_LIT> ) ) ) { uint64_t and_mask = AndMask -> getZExtValue ( ) ; uint64_t shr_val = SHR -> getZExtValue ( ) & <NUM_LIT> ; if ( IID == <STR_LIT> ) shr_val = ( shr_val & <NUM_LIT> ) << <NUM_LIT> ; and_mask = ( ( and_mask >> shr_val ) | ( and_mask << ( <NUM_LIT> - shr_val ) ) ) & <NUM_LIT> ; Opr0 = Opr0 -> getOperand ( <NUM_LIT> ) ; return DAG . getNode ( <STR_LIT> , SDLoc ( Opr1 ) , Opr1 . getValueType ( ) , DAG . getNode ( <STR_LIT> , dl , VT , DAG . getConstant ( IID , dl , <STR_LIT> ) , Opr0 , Opr0 , Opr2 ) , DAG . getConstant ( and_mask , dl , <STR_LIT> ) ) ; } } if ( SHR && ( IID == <STR_LIT>


<s> unsigned IID = cast < ConstantSDNode > ( N -> getOperand ( <NUM_LIT> ) ) -> getZExtValue ( ) ; switch ( IID


<s> <ISA_LIT>Kernel ( ) { curSize = <NUM_LIT> ; curRSize = <NUM_LIT> ; curHWSize =


<s> void addArgReg ( unsigned arg ) { mArgRegs . push_back (


<s> if ( kernelOnly ) { mMetadataKernel . push_back (


<s> mOperands . resize ( ( unsigned ) ( idx + <NUM_LIT> ) ) ; mOperands [ ( unsigned ) idx


<s> void add_read_ptr ( const Value * ptr ) { mReadPtr . insert


<s> error_iterator errors_begin ( ) { return mErrors . begin (


<s> bool errors_empty ( ) { return mErrors .


<s> return iterator_range < func_iterator > ( func_begin (


<s> bool func_empty ( ) { return mFuncs . empty


<s> func_iterator func_end ( ) { return mFuncs . end (


<s> func_md_iterator func_md_begin ( ) { return mMetadataFunc . begin (


<s> size_t func_size ( ) { return mFuncs . size (


<s> ++ begin ) { if ( ! strcmp ( begin -> name . data ( ) , arg . c_str ( ) ) ) { return & ( * begin ) ; } } return


<s> if ( mGroupMemSize == - <NUM_LIT> ) { const DataLayout & DL = mMF -> getDataLayout ( ) ; mGroupMemSize = <NUM_LIT> ; SmallPtrSet < const GlobalVariable * , <NUM_LIT> > thisFuncGrpVarsSet ; for ( MachineFunction :: const_iterator I = mMF -> begin ( ) , E = mMF -> end ( ) ; I != E ; ++ I ) { for ( MachineBasicBlock :: const_iterator II = I -> begin ( ) , IE = I -> end ( ) ; II != IE ; ++ II ) { const MachineInstr * LastMI = II ; for ( unsigned int opNum = <NUM_LIT> ; opNum < LastMI -> getNumOperands ( ) ; opNum ++ ) { const MachineOperand & MO = LastMI -> getOperand ( opNum ) ; if ( MO . getType ( ) == MachineOperand :: MO_GlobalAddress ) { if ( const GlobalVariable * GV = dyn_cast < GlobalVariable > ( MO . getGlobal ( ) ) ) { if ( GV -> getType ( ) -> getAddressSpace (


<s> <ISA_LIT>Kernel * <ISA_LIT>MachineFunctionInfo :: getKernel ( ) { return


<s> size_t <ISA_LIT>PrintfInfo :: getNumOperands ( ) { return mOperands . size (


<s> uint32_t <ISA_LIT>PrintfInfo :: getOperandID (


<s> const MachineOperand & MO = LastMI -> getOperand ( opNum ) ; if ( MO . getType ( ) == MachineOperand :: MO_GlobalAddress ) { if ( const GlobalVariable * GV = dyn_cast < GlobalVariable > ( MO . getGlobal ( ) ) ) { if ( GV -> getType ( ) -> getAddressSpace ( ) == <STR_LIT> ) { if ( thisFuncPvtVarsSet . insert ( GV ) . second ) { mPrivateMemSize += DL . getTypeAllocSize ( GV -> getType ( ) -> getElementType ( ) ) ; } } } } } } } mPrivateMemSize = ( ( mPrivateMemSize + <NUM_LIT> ) & ~ <NUM_LIT> ) ; } return ( uint32_t


<s> unsigned getRegisterPartitioning ( ) const


<s> if ( mScratchSize == - <NUM_LIT> ) { mScratchSize = <NUM_LIT> ; Function :: const_arg_iterator I = mMF -> getFunction ( ) -> arg_begin ( ) ; Function :: const_arg_iterator Ie = mMF -> getFunction ( ) -> arg_end ( ) ; while ( I != Ie


<s> const <ISA_LIT>TargetMachine * TM = reinterpret_cast < const <ISA_LIT>TargetMachine * > ( & mMF -> getTarget ( ) ) ; bool addStackSize = TM -> getOptLevel ( ) == CodeGenOpt :: None ; Function :: const_arg_iterator I = mMF -> getFunction ( ) -> arg_begin ( ) ; Function :: const_arg_iterator Ie = mMF -> getFunction ( ) -> arg_end ( ) ; while ( I


<s> bool hasSpilledCRs ( ) const { return HasSpilledCRs


<s> const ConstantExpr * nameField = dyn_cast < ConstantExpr > ( CA -> getOperand ( start ) ) ; if ( ! nameField ) continue ; const GlobalVariable * nameGV = dyn_cast < GlobalVariable > ( nameField -> getOperand ( <NUM_LIT> ) ) ; if ( ! nameGV || ! nameGV -> hasInitializer ( ) ) continue ; const ConstantDataSequential * nameArray = dyn_cast < ConstantDataSequential > ( nameGV -> getInitializer ( ) ) ; if ( ! nameArray ) continue ; std :: string nameStr = nameArray -> getAsString ( ) ; if ( ! nameStr . compare ( <NUM_LIT> , nameStr . length ( ) - <NUM_LIT> , argName ) )


<s> return mKernel != nullptr && mKernel -> mKernel


<s> bool <ISA_LIT>MachineFunctionInfo :: isRestrictPointer ( const Value * ptr ) { if ( ! mSTM -> supportMetadata30 ( ) ) return false ; std :: string signedNames = <STR_LIT> ; std :: string argName = ptr -> getName ( ) ; if ( ! mMF ) return false ; signedNames += mMF -> getFunction ( ) -> getName ( ) ; const GlobalVariable * GV = mMF -> getFunction ( ) -> getParent ( ) -> getGlobalVariable ( signedNames ) ; if ( ! GV || ! GV -> hasInitializer ( ) )


<s> const GlobalVariable * nameGV = dyn_cast < GlobalVariable > ( nameField -> getOperand ( <NUM_LIT> ) ) ; if ( ! nameGV || ! nameGV -> hasInitializer ( ) ) continue ; const ConstantDataSequential * nameArray = dyn_cast < ConstantDataSequential > ( nameGV -> getInitializer ( ) ) ; if ( ! nameArray ) continue ; std :: string nameStr = nameArray -> getAsString ( ) ; if ( ! nameStr . compare ( <NUM_LIT> , nameStr . length ( ) - <NUM_LIT>


<s> kernel_md_iterator kernel_md_end ( ) { return mMetadataKernel .


<s> sema_iterator sema_begin ( ) { return mSemaphore .


<s> sema_iterator sema_end ( ) { return mSemaphore . end ( )


<s> void setHasScavengerSpill ( bool Spill = true ) { HasScavengerSpill =


<s> void <ISA_LIT>PrintfInfo :: setPrintfID (


<s> if ( curConst ) { return curConst -> usesHardware ; }


<s> MCSection * <ISA_LIT>MCAsmInfo :: getNonexecutableStackSection ( MCContext & Ctx ) const { return


<s> MCSection * <ISA_LIT>MCAsmInfo :: getNonexecutableStackSection ( MCContext & Ctx


<s> SupportsQuotedNames = false ; HasDotTypeDotSizeDirective = false ; HasSingleParameterDotFile = false ; SupportsDebugInformation = false ; PointerSize = TT . getArch ( ) == Triple :: hsail64 ? <NUM_LIT> : <NUM_LIT> ; ExceptionsType = ExceptionHandling :: None ; CommentString = <STR_LIT>


<s> void <ISA_LIT>MCCodeEmitter :: EmitByte ( unsigned char C , unsigned & CurByte ,


<s> void <ISA_LIT>MCCodeEmitter :: EmitConstant ( uint64_t Val , unsigned Size , unsigned & CurByte , raw_ostream & OS ) const { llvm_unreachable ( <STR_LIT>


<s> void <ISA_LIT>MCCodeEmitter :: EmitImmediate ( const MCOperand & DispOp , unsigned Size , MCFixupKind FixupKind , unsigned & CurByte , raw_ostream & OS , SmallVectorImpl

< MCFixup > & Fixups , int ImmOffset ) const {


<s> void <ISA_LIT>MCCodeEmitter :: EmitRegModRMByte ( const MCOperand & ModRMReg , unsigned RegOpcodeFld , unsigned & CurByte , raw_ostream & OS ) const { llvm_unreachable ( <STR_LIT>


<s> void <ISA_LIT>MCCodeEmitter :: EmitSegmentOverridePrefix ( uint64_t TSFlags , unsigned & CurByte , int MemOperand , const MCInst & MI , raw_ostream & OS ) const { llvm_unreachable (


<s> void <ISA_LIT>MCCodeEmitter :: EmitSIBByte ( unsigned SS , unsigned Index , unsigned Base , unsigned & CurByte , raw_ostream & OS ) const { llvm_unreachable (


<s> void <ISA_LIT>MCCodeEmitter :: encodeInstruction ( const MCInst & MI , raw_ostream & OS , SmallVectorImpl < MCFixup > & Fixups , const MCSubtargetInfo & STI ) const { llvm_unreachable (


<s> static MCTargetStreamer * create<ISA_LIT>AsmTargetStreamer ( MCStreamer & S , formatted_raw_ostream &

OS , MCInstPrinter * InstPrint , bool isVerboseAsm ) {


<s> MCCodeGenInfo * X = new MCCodeGenInfo ( ) ; X -> initMCCodeGenInfo ( RM


<s> Init<ISA_LIT>MCInstrInfo ( X ) ; return


<s> MCRegisterInfo * X = new MCRegisterInfo ( ) ; Init<ISA_LIT>MCRegisterInfo ( X , <NUM_LIT>


<s> static MCRegisterInfo * create<ISA_LIT>MCRegisterInfo ( const Triple & TT ) { MCRegisterInfo * X = new MCRegisterInfo ( )


<s> return create<ISA_LIT>MCSubtargetInfoImpl ( TT , CPU , FS


<s> return new <ISA_LIT>TargetStreamer (


<s> void LLVMInitialize<ISA_LIT>TargetMC ( ) { for ( Target * T : { & The<ISA_LIT>_32Target , & The<ISA_LIT>_64Target } ) { RegisterMCAsmInfo < <ISA_LIT>MCAsmInfo > X ( * T ) ; TargetRegistry :: RegisterMCCodeGenInfo ( * T , create<ISA_LIT>MCCodeGenInfo ) ; TargetRegistry :: RegisterMCInstrInfo ( * T , create<ISA_LIT>MCInstrInfo ) ; TargetRegistry :: RegisterMCRegInfo ( * T , create<ISA_LIT>MCRegisterInfo ) ; TargetRegistry :: RegisterMCSubtargetInfo ( * T , create<ISA_LIT>MCSubtargetInfo ) ; TargetRegistry :: RegisterMCInstPrinter ( *


<s> void add_printf_offset ( uint32_t offset


<s> const <ISA_LIT>ConstPtr * curConst = getConstPtr ( krnl , Arg ) ; if ( ! curConst ) { return <NUM_LIT> ; } return curConst ->


<s> StringMap < <ISA_LIT>Kernel * > :: iterator iter


<s> if ( mFuncNames . find ( func ) == mFuncNames . end ( ) ) { id = mFuncNames . size ( ) + RESERVED_FUNCS + mFuncPtrNames . size ( ) ; mFuncNames [ func ] = id ; } else { id = mFuncNames [ func


<s> <ISA_LIT>ModuleInfo :: <ISA_LIT>ModuleInfo ( const MachineModuleInfo & MMI ) { mMMI = & MMI ; mOffset = <NUM_LIT>


<s> bool <ISA_LIT>ModuleInfo :: isReadOnlyImage ( StringRef name , uint32_t iID ) const { const StringMap < <ISA_LIT>Kernel * > :: const_iterator kiter = mKernels . find ( name ) ; if ( kiter == mKernels . end ( ) ) { return false ; } return kiter -> second -> readOnly . count (


<s> mSTM = mTM -> getSubtargetImpl ( ) ; if (


<s> void <ISA_LIT>ModuleInfo :: processModule ( const Module * M , const <ISA_LIT>TargetMachine * mTM ) { mSTM = mTM ->


<s> bool <ISA_LIT>ModuleInfo :: usesHWConstant ( const <ISA_LIT>Kernel * krnl , StringRef arg ) { const <ISA_LIT>ConstPtr * curConst = getConstPtr (


<s> kb != ke ; ++ kb ) { <ISA_LIT>Kernel * ptr = kb -> getValue ( ) ; delete ptr


<s> kb != ke ; ++ kb ) { <ISA_LIT>Kernel * ptr = kb -> getValue ( ) ; delete


<s> const StructType * ST = dyn_cast < StructType > ( T ) ; if ( ! ST ) { const PointerType * PT = dyn_cast < PointerType > ( T ) ; if ( ! PT ) return NotOpaque ; const Type * CT = PT -> getElementType ( ) ; ST = dyn_cast < StructType > ( CT ) ; } if ( ! ST || ! ST -> isOpaque ( ) ) return NotOpaque ; return StringSwitch < OpaqueType > ( ST -> getName ( ) ) . Cases ( <STR_LIT> , <STR_LIT> , I1D ) . Cases ( <STR_LIT> , <STR_LIT> , I1DA ) . Cases ( <STR_LIT> , <STR_LIT> , I1DB ) . Cases ( <STR_LIT> , <STR_LIT> , I2D ) . Cases ( <STR_LIT> , <STR_LIT> , I2DA ) . Cases ( <STR_LIT> , <STR_LIT> , I3D ) . Cases ( <STR_LIT> , <STR_LIT> , I2DDepth ) . Cases ( <STR_LIT> , <STR_LIT> , I2DADepth ) . Case ( <STR_LIT> , Sampler ) . Cases ( <STR_LIT> , <STR_LIT> , Event ) . Case ( <STR_LIT> ,

C32 ) . Case ( <STR_LIT> , C64 ) . Case ( <STR_LIT> , Sema ) . Case ( <STR_LIT> , ReserveId ) . Case ( <STR_LIT> , CLKEventT ) . Case ( <STR_LIT> , QueueT ) . Default ( UnknownOpaque ) ;


<s> unsigned <ISA_LIT>ParamManager :: addArgumentParam ( unsigned AS , const Argument & Arg , const StringRef ParamName ) { unsigned Param = addParam ( ( AS == <STR_LIT> ) ? <ISA_LIT>_PARAM_TYPE_ARGUMENT : <ISA_LIT>_PARAM_TYPE_KERNARG , Arg . getType ( ) , ParamName ) ; AllParams . find ( Param ) -> second . Arg


<s> unsigned <ISA_LIT>ParamManager :: addCallArgParam ( Type *


<s> unsigned <ISA_LIT>ParamManager :: addCallArgParam ( Type * Ty , const StringRef ParamName ) { return addParam ( <ISA_LIT>_PARAM_TYPE_CALL_PARAM ,


<s> return addParam ( <ISA_LIT>_PARAM_TYPE_CALL_RET , Ty ,


<s> case <ISA_LIT>_PARAM_TYPE_CALL_PARAM : ParamList = & CallArgParams ; DefName = <STR_LIT> ; break ; case <ISA_LIT>_PARAM_TYPE_CALL_RET : ParamList = & CallRetParams ; DefName = <STR_LIT> ; break ; } if ( ParamName . empty ( ) ) { Name = DefName ; Name += utostr ( ParamList -> size ( ) ) ; } else { Name = ParamName ; } unsigned prev_offset = <NUM_LIT> ; unsigned prev_size = <NUM_LIT> ; if ( ParamList -> size ( ) > <NUM_LIT> ) { unsigned prev_param = ( * ParamList ) [ ParamList -> size ( ) - <NUM_LIT> ] ; prev_offset = getParamOffset ( prev_param ) ; prev_size = getParamSize ( prev_param ) ; } if ( prev_offset == UINT_MAX || GetOpaqueType ( Ty ) ) { Param . Offset = UINT_MAX ; } else { unsigned alignment = DL -> getABITypeAlignment ( Ty ) ; if ( ParamType == <ISA_LIT>_PARAM_TYPE_KERNARG && Ty -> isVectorTy ( ) ) alignment = DL -> getABITypeAlignment ( Ty -> getVectorElementType ( ) ) ; assert ( alignment != <NUM_LIT> ) ; Param . Offset = ( prev_offset + prev_size + alignment - <NUM_LIT> ) & ~ ( alignment - <NUM_LIT> ) ; } unsigned Index = AllParams . size ( ) ; AllParams [ Index ]


<s> void <ISA_LIT>ParamManager :: addParamName ( std :: string Name , unsigned Index ) { char * name = ( char * ) malloc ( Name .


<s> void <ISA_LIT>ParamManager :: addParamType ( Type * pTy , unsigned


<s> unsigned <ISA_LIT>ParamManager :: addReturnParam ( Type *


<s> param_iterator arg_begin ( ) const { return ArgumentParams . begin


<s> param_iterator arg_end ( ) const { return ArgumentParams . end (


<s> param_iterator call_ret_end ( ) const { return CallRetParams . end (


<s> const Argument * getParamArg ( unsigned Param ) const { assert ( AllParams . count ( Param ) == <NUM_LIT> && <STR_LIT> ) ; return AllParams . find ( Param ) ->


<s> unsigned getParamByOffset ( int64_t & Offset ) const { if ( Offset >= UINT_MAX || Offset < <NUM_LIT> ) return UINT_MAX ; unsigned o = ( unsigned ) Offset ; unsigned r = getParamByOffset ( o ) ; Offset = o ; return r


<s> const char * getParamName ( unsigned Param ) const { assert ( AllParams . count ( Param ) ==


<s> return AllParams . find ( Param ) -> second .


<s> assert ( AllParams . count ( Param ) == <NUM_LIT> &&


<s> unsigned getParamSize ( unsigned Param ) const { return DL -> getTypeStoreSize ( getParamType (


<s> unsigned getParamSize ( unsigned Param


<s> Type * getParamType ( unsigned Param ) const { assert ( AllParams . count ( Param ) == <NUM_LIT>


<s> <ISA_LIT>ParamManager ( const DataLayout * _DL )


<s> <ISA_LIT>ParamManager ( const DataLayout * _DL ) : DL


<s> unsigned Opcode = MI . getOpcode ( ) ; MachineFunction * MF = MI . getParent ( ) -> getParent ( ) ; const MachineFrameInfo * MFI = MF -> getFrameInfo ( ) ; MCContext & Ctx = MF -> getContext ( ) ; assert ( <STR_LIT> ( Opcode , <STR_LIT> :: address ) == static_cast < int > ( FIOperandNum ) && <STR_LIT> ) ; MachineOperand & Base = MI . getOperand ( FIOperandNum ) ; int FrameIndex = Base . getIndex ( ) ; if ( Opcode == <STR_LIT> ) lowerSpillB1 ( II , FrameIndex ) ; else if ( Opcode == <STR_LIT> ) lowerRestoreB1 ( II , FrameIndex ) ; StringRef SymName = MFI -> isSpillSlotObjectIndex ( FrameIndex ) ? <STR_LIT> : <STR_LIT> ; MCSymbol * Sym = Ctx . getOrCreateSymbol ( SymName


<s> unsigned Opcode = MI . getOpcode ( ) ; MachineFunction * MF = MI . getParent ( ) -> getParent ( ) ; const MachineFrameInfo * MFI = MF -> getFrameInfo ( ) ; MCContext & Ctx = MF -> getContext ( ) ; assert ( <STR_LIT> ( Opcode , <STR_LIT> :: address ) == static_cast < int > ( FIOperandNum ) && <STR_LIT> ) ; MachineOperand & Base = MI . getOperand ( FIOperandNum


<s> static const uint16_t CalleeSavedRegs [ ] = { <NUM_LIT> } ; return CalleeSavedRegs


<s> unsigned <ISA_LIT>RegisterInfo :: getFrameRegister ( const MachineFunction & MF )


<s> unsigned <ISA_LIT>RegisterInfo :: getFrameRegister ( const MachineFunction


<s> for ( const TargetRegisterClass * BaseClass : BaseClasses ) { if ( BaseClass -> contains ( Reg ) ) return BaseClass ; } return nullptr


<s> for ( TargetRegisterClass :: iterator I = RC -> begin ( ) , E = RC


<s> <ISA_LIT>MachineFunctionInfo * MFI = const_cast < <ISA_LIT>MachineFunctionInfo * > ( MF . getInfo < <ISA_LIT>MachineFunctionInfo > ( ) ) ; unsigned NumSlotsTotal = <STR_LIT> . getNumRegs ( ) ; unsigned RegSlots = NumSlotsTotal / <NUM_LIT> ; if ( MFI -> getRegisterPartitioning ( ) == <NUM_LIT> ) { const MachineRegisterInfo & RI = MF . getRegInfo ( ) ; unsigned rc32 = <NUM_LIT> , rc64 = <NUM_LIT> ; for ( unsigned i = <NUM_LIT> , e = RI . getNumVirtRegs ( ) ; i != e ; ++ i ) { switch ( RI . getRegClass ( index2VirtReg ( i ) ) -> getSize ( ) ) { case <NUM_LIT> : rc32 ++ ; break ; case <NUM_LIT> : rc64 ++ ; break ; } } if ( <ISA_LIT>RegSlots > <NUM_LIT> ) { RegSlots = <ISA_LIT>RegSlots ; } else { if ( rc64 < ( NumSlotsTotal - RegSlots ) && rc32 > ( RegSlots * <NUM_LIT> ) ) { RegSlots = NumSlotsTotal - rc64 ; } else if ( rc32 < ( RegSlots * <NUM_LIT> ) && rc64 > ( NumSlotsTotal - RegSlots ) ) { RegSlots = ( rc32 + <NUM_LIT> ) / <NUM_LIT> ; } } if ( RegSlots < <NUM_LIT> ) RegSlots = <NUM_LIT> ; else if ( RegSlots > ( NumSlotsTotal - <NUM_LIT> ) ) RegSlots =


<s> unsigned DestReg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; const <ISA_LIT>InstrInfo * TII = ST . getInstrInfo ( ) ; MachineRegisterInfo & MRI = MBB -> getParent ( ) -> getRegInfo ( ) ; unsigned TempGPR32 = MRI . createVirtualRegister ( & <STR_LIT> ) ; BuildMI ( * MBB , ++ II , DL , TII -> get ( <STR_LIT> ) , DestReg ) . addImm ( <NUM_LIT> ) . addImm ( <NUM_LIT> ) . addImm ( BRIG_TYPE_B1 ) . addImm ( BRIG_TYPE_U32 ) . addReg ( TempGPR32 , RegState :: Kill ) ; MI . setDesc ( TII -> get ( <STR_LIT> ) ) ; MI . getOperand ( <NUM_LIT> ) . setReg ( TempGPR32 ) ; MI . getOperand ( <NUM_LIT> ) . setIsDef ( ) ; MachineOperand * TypeOp = TII -> getNamedOperand (


<s> unsigned TempGPR32 = MRI . createVirtualRegister ( & <STR_LIT> ) ; DebugLoc DL = MI . getDebugLoc ( ) ; BuildMI ( * MBB , II , DL , TII -> get ( <STR_LIT> ) , TempGPR32 ) . addImm ( <NUM_LIT> ) . addImm ( <NUM_LIT> ) . addImm ( BRIG_TYPE_U32 ) . addImm ( BRIG_TYPE_B1 ) . addOperand ( MI . getOperand ( <NUM_LIT> ) ) ; MI . setDesc ( TII -> get ( <STR_LIT> ) ) ; MI . getOperand ( <NUM_LIT> ) . setReg ( TempGPR32 ) ; MI . getOperand ( <NUM_LIT> ) . setIsKill ( ) ; MachineOperand * TypeOp = TII -> getNamedOperand ( MI , <STR_LIT> :: TypeLength ) ; TypeOp -> setImm ( BRIG_TYPE_U32


<s> const <ISA_LIT>MachineFunctionInfo * Info = MF . getInfo < <ISA_LIT>MachineFunctionInfo > ( ) ; return Info -> hasSpilledCRs (


<s> bool <ISA_LIT>RegisterInfo :: requiresRegisterScavenging ( const MachineFunction & MF ) const { return


<s> bool <ISA_LIT>RegisterInfo :: saveScavengerRegister ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator I , MachineBasicBlock :: iterator & UseMI , const TargetRegisterClass * RC , unsigned Reg ) const { MachineFunction * MF = MBB . getParent ( ) ; <ISA_LIT>MachineFunctionInfo * Info = MF -> getInfo < <ISA_LIT>MachineFunctionInfo > ( ) ; MCContext & Ctx = MF -> getContext ( ) ; const <ISA_LIT>InstrInfo * TII = ST . getInstrInfo ( ) ; assert ( RC == & <STR_LIT> &&


<s> bool <ISA_LIT>RegisterInfo :: trackLivenessAfterRegAlloc ( const MachineFunction & MF


<s> bool <ISA_LIT>RegisterInfo :: trackLivenessAfterRegAlloc ( const MachineFunction & MF ) const { return


<s> size_t dataSizeInBytes ( ) { return OS . str ( )


<s> size_t elementCount ( ) { return dataSizeInBytes ( )


<s> switch ( InitEltSize ) { case <NUM_LIT> : { uint32_t Tmp ; std :: memcpy ( & Tmp , Ptr , <NUM_LIT> ) ; if ( IsFPElt ) printFloat ( Tmp , O ) ; else O << Tmp ; break ; } case <NUM_LIT> : { uint64_t Tmp ; std :: memcpy ( & Tmp , Ptr , <NUM_LIT> ) ; if ( IsFPElt ) printDouble ( Tmp , O ) ; else O << Tmp ; break ; } case <NUM_LIT> : { uint16_t Tmp ; std :: memcpy ( & Tmp , Ptr


<s> O << format ( <STR_LIT> PRIx64 , Val


<s> void StoreInitializer :: printFloat ( uint32_t Val , raw_ostream & O ) { O << format ( <STR_LIT> PRIx32 , Val


<s> void StoreInitializer :: printFloat ( uint32_t Val , raw_ostream


<s> StringRef str ( ) { return OS . str ( )


<s> void <ISA_LIT>ImageHandles :: clearImageArgs (


<s> StringRef getDeviceName ( ) const { return DevName


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


<s> assert ( index < <ISA_LIT>ImageArgs . size ( ) && <STR_LIT> ) ; return <ISA_LIT>ImageArgs [


<s> assert ( index < <ISA_LIT>ImageArgs . size ( ) && <STR_LIT> ) ; return <ISA_LIT>ImageArgs [ index


<s> const <ISA_LIT>InstrInfo * getInstrInfo ( ) const override { return InstrInfo . get


<s> assert ( index < <ISA_LIT>Samplers . size (


<s> std :: string <ISA_LIT>ImageHandles :: getSamplerSymbol


<s> assert ( index < <ISA_LIT>Samplers . size ( ) && <STR_LIT> ) ; return <ISA_LIT>Samplers [ index ] ->


<s> assert ( index < <ISA_LIT>Samplers . size ( ) && <STR_LIT> ) ; return <ISA_LIT>Samplers [ index ]


<s> <ISA_LIT>SamplerHandle ( unsigned int u ) { mVal = u ; mIsRO = false ; mEmitted = false


<s> <ISA_LIT>SamplerHandle ( unsigned int u ) { mVal =


<s> <ISA_LIT>Subtarget & <ISA_LIT>Subtarget :: initializeSubtargetDependencies ( StringRef GPU , StringRef


<s> bool isSmallModel ( ) const { return ! IsLargeModel


<s> inline void setSym ( std :: string str ) { mSym = str


<s> bool supportMetadata30 ( ) const { return


<s> RegisterTarget < Triple :: hsail64 , false > Target64 ( The<ISA_LIT>_64Target , <STR_LIT> ,


<s> void LLVMInitialize<ISA_LIT>TargetInfo ( ) { RegisterTarget < Triple :: hsail , false > Target32 ( The<ISA_LIT>_32Target , <STR_LIT> , <STR_LIT> ) ; RegisterTarget < Triple :: hsail64 , false > Target64


<s> void <ISA_LIT>PassConfig :: addIRPasses ( ) { addPass ( create<ISA_LIT>AlwaysInlinePass ( ) ) ; addPass ( createAlwaysInlinerPass ( )


<s> addPass ( create<ISA_LIT>AlwaysInlinePass ( ) ) ; addPass ( createAlwaysInlinerPass ( ) ) ; TargetPassConfig :: addIRPasses (


<s> return LLVMTargetMachine :: addPassesToEmitFile ( PM , Out , FT

, DisableVerify , StartAfter , StopAfter , MFInitializer ) ;


<s> bool <ISA_LIT>PassConfig :: addPreISel ( ) { addPass ( createLCSSAPass ( )


<s> static StringRef computeDataLayout ( const Triple & T ) { if ( T . getArch ( ) == Triple :: hsail64 ) { return <STR_LIT> <STR_LIT> <STR_LIT> <STR_LIT> <STR_LIT> ; } return <STR_LIT> <STR_LIT>


<s> return new <ISA_LIT>TargetObjectFile ( )


<s> static TargetLoweringObjectFile * createTLOF ( const Triple &


<s> TargetLoweringObjectFile * getObjFileLowering ( )


<s> const <ISA_LIT>Subtarget * getSubtargetImpl ( const Function & ) const override { return & Subtarget


<s> <ISA_LIT>TargetMachine :: <ISA_LIT>TargetMachine ( const Target & T , const Triple & TT , StringRef CPU , StringRef FS , const TargetOptions & Options , Reloc :: Model RM , CodeModel :: Model CM , CodeGenOpt :: Level OL ) : LLVMTargetMachine ( T , computeDataLayout ( getTripleNoOS ( TT ) ) , getTripleNoOS ( TT ) , CPU ,

FS , Options , RM , CM , OL ) , Subtarget ( getTripleNoOS ( TT ) , CPU , FS , * this ) , IntrinsicInfo ( this ) , TLOF ( createTLOF ( getTripleNoOS ( TT ) ) ) {


<s> <ISA_LIT>_32TargetMachine :: <ISA_LIT>_32TargetMachine ( const Target & T , const Triple & TT , StringRef CPU , StringRef FS , const TargetOptions & Options , Reloc :: Model RM , CodeModel :: Model CM , CodeGenOpt :: Level OL ) : <ISA_LIT>TargetMachine ( T , TT , CPU , FS , Options , RM , CM , OL ) { if ( TT . getArch ( ) == Triple :: hsail64


<s> RegisterTargetMachine < <ISA_LIT>_64TargetMachine > Y


<s> MCSection * getSectionForConstant ( const DataLayout & DL , SectionKind Kind , const Constant * C ) const override { return ReadOnlySection


<s> <ISA_LIT>TargetObjectFile :: <ISA_LIT>TargetObjectFile ( ) { TextSection = nullptr ; DataSection = nullptr ; BSSSection = nullptr ; ReadOnlySection = nullptr ; StaticCtorSection = nullptr ; StaticDtorSection = nullptr ; LSDASection = nullptr ; EHFrameSection = nullptr ; DwarfAbbrevSection = nullptr ; DwarfInfoSection = nullptr ; DwarfLineSection = nullptr ; DwarfFrameSection = nullptr ; DwarfPubTypesSection = nullptr ; DwarfDebugInlineSection = nullptr ; DwarfStrSection = nullptr ; DwarfLocSection = nullptr ; DwarfARangesSection = nullptr ; DwarfRangesSection = nullptr


<s> MCSection * SelectSectionForGlobal ( const GlobalValue * GV , SectionKind Kind , Mangler & Mang , const TargetMachine


<s> MCSection * SelectSectionForGlobal ( const GlobalValue * GV , SectionKind Kind ,

Mangler & Mang , const TargetMachine & TM ) const override {


<s> EltTy = AT -> getElementType ( ) ; AT = dyn_cast < ArrayType > ( EltTy ) ; } unsigned EltElts = ~ <NUM_LIT> ; Type * Tmp = analyzeType ( EltTy , EltElts , DL ) ; if ( EltElts != <NUM_LIT> ) NElts *= EltElts ; return Tmp ; } if ( VectorType * VT = dyn_cast < VectorType > ( Ty ) ) { Type * EltTy = VT -> getElementType ( ) ; NElts = DL . getTypeAllocSize ( Ty ) / DL . getTypeAllocSize ( EltTy ) ; assert ( NElts >= VT -> getNumElements ( ) ) ; if ( EltTy -> isIntegerTy ( <NUM_LIT> ) ) report_fatal_error ( <STR_LIT> ) ; return EltTy ; } if ( isa < StructType > ( Ty ) ) { NElts = DL . getTypeAllocSize ( Ty ) ; return Type :: getInt8Ty ( Ty -> getContext ( ) ) ; } assert ( ! Ty -> isAggregateType ( ) ) ; NElts = <NUM_LIT> ; if ( Ty -> isIntegerTy ( <NUM_LIT> ) ) return Type :: getInt8Ty ( Ty -> getContext ( ) ) ; return Ty


<s> Type * Tmp = analyzeType ( EltTy , EltElts , DL ) ; if ( EltElts != <NUM_LIT> ) NElts *= EltElts ; return Tmp ; } if ( VectorType * VT = dyn_cast < VectorType > ( Ty ) ) { Type * EltTy = VT -> getElementType ( ) ; NElts = DL . getTypeAllocSize ( Ty ) / DL . getTypeAllocSize ( EltTy ) ; assert ( NElts >= VT -> getNumElements ( ) ) ; if ( EltTy -> isIntegerTy ( <NUM_LIT> ) ) report_fatal_error ( <STR_LIT> ) ; return EltTy


<s> if ( ArrayType * ATy = dyn_cast < ArrayType > ( ty ) ) ty = ATy -> getElementType ( ) ; if ( IsImage ( ty ) || IsSampler ( ty )


<s> static inline bool isConv ( const MachineInstr * MI ) { return MI -> getDesc ( ) . TSFlags


<s> StringRef GVname = GV -> getName ( ) ; return GVname . startswith ( <STR_LIT> ) || GVname . startswith ( <STR_LIT> ) || GVname . startswith ( <STR_LIT> ) || GVname . startswith ( <STR_LIT> ) || GVname . startswith ( <STR_LIT> ) || GVname . startswith ( <STR_LIT> ) || GVname . startswith ( <STR_LIT> ) || GVname . startswith ( <STR_LIT> ) || GVname . startswith (

<STR_LIT> ) || GVname . startswith ( <STR_LIT> ) || GVname . startswith ( <STR_LIT> ) || GVname . startswith ( <STR_LIT> ) || GVname . startswith ( <STR_LIT> ) || GVname . startswith ( <STR_LIT> ) ;


<s> static inline bool isImageInst ( const MachineInstr *


<s> static inline bool isImageInst ( const MachineInstr * MI ) { return MI -> getDesc ( ) . TSFlags &


<s> if ( CallingConv :: SPIR_KERNEL == F -> getCallingConv ( ) ) return true ; return isKernelFunc ( F -> getName (


<s> if ( CallingConv :: SPIR_KERNEL == F -> getCallingConv ( ) ) return true ; return isKernelFunc ( F ->


<s> bool isSPIRModule ( const Module & M ) { return M . getNamedMetadata (


<s> return M . getNamedMetadata ( <STR_LIT>


<s> bool notUsedInKernel ( const GlobalVariable * GV ) { SmallVector < const User * , <NUM_LIT> > worklist ; worklist . append ( GV -> user_begin ( ) , GV -> user_end ( ) ) ; while ( ! worklist . empty ( ) ) { const User * user = worklist . pop_back_val ( ) ; if ( const GlobalValue * GUser = dyn_cast < GlobalValue > ( user )


<s> SmallVector < const User * , <NUM_LIT> > worklist ; worklist . append ( GV -> user_begin ( ) , GV -> user_end ( ) ) ; while ( ! worklist . empty ( ) ) { const User * user = worklist . pop_back_val ( ) ; if ( const GlobalValue * GUser = dyn_cast < GlobalValue


<s> Name = Name . drop_front ( <NUM_LIT> ) ; } size_t p = <NUM_LIT> ; size_t q = <NUM_LIT> ; while ( q != StringRef :: npos ) { q = Name . find_first_not_of ( Syntax , p ) ; if ( q != p ) { NewName += Name . slice ( p , q ) ; } if ( q == StringRef :: npos ) break ; NewName += '_'


<s> NewName += '_' ; Name = Name . drop_front ( <NUM_LIT> ) ; } size_t p = <NUM_LIT> ; size_t q = <NUM_LIT> ; while ( q != StringRef :: npos ) { q = Name . find_first_not_of ( Syntax , p ) ; if ( q != p ) { NewName += Name . slice ( p , q ) ; } if ( q == StringRef :: npos ) break ; NewName += '_' ; p = q + <NUM_LIT> ; } if ( Name . empty ( ) || Digits . find ( Name [ <NUM_LIT> ] ) != StringRef :: npos || ! Name . equals ( NewName ) ) { Out . append ( NewName . begin ( ) , NewName . end ( ) ) ; return


<s> uint64_t RawVectorOstream :: current_pos (


<s> uint64_t RawVectorOstream :: current_pos ( ) const { return static_cast < uint64_t


<s> return StringRef ( Data . data ( ) , Data .


<s> void RawVectorOstream :: releaseStream ( ) { if ( Other ) { Other -> flush


<s> void RawVectorOstream :: setOtherStream (


<s> } std :: copy ( Ptr , Ptr + Size , Data . begin ( ) + Position ) ; Position += Size ; if ( Other ) { Other -> write ( Ptr ,