<s> return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; default : llvm_unreachable ( <STR_LIT> ) ;


<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 ( C , <NUM_LIT> ) ;


<s> BRIGDwarfStreamer :: BRIGDwarfStreamer ( MCContext & Context , MCAsmBackend & TAB , RawVectorOstream & RVOS , MCCodeEmitter * Emitter ) : MCELFStreamer ( Context , TAB , RVOS , Emitter ) , dwarfStream ( & RVOS ) {


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


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


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


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


<s> return MCStreamer :: BRIGDwarfStreamer ;


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


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


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


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


<s> <ISA_LIT>AlwaysInline ( ) : ModulePass ( ID ) {


<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 ) {


<s> static bool canInitAddressSpace ( unsigned AS ) {

return AS == <STR_LIT> || AS == <STR_LIT> ;


<s> static bool canInitAddressSpace ( unsigned AS ) { return AS == <STR_LIT> || 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 ( ) ) HasImages = true ;


<s> 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 ( ) ) HasImages = true ; if ( IsGCN && HasImages ) break ;


<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 ( I ) ;


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


<s> 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
;


<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 ) ;


<s> if ( isProgramLinkage ( * F ) ) O << <STR_LIT> ; emitFunctionLabel ( * F , O , false ) ; O << <STR_LIT> ; OutStreamer -> EmitRawText ( O . str ( ) ) ;


<s> void <ISA_LIT>AsmPrinter :: EmitFunctionHeader ( ) {

const Function * F = MF -> getFunction ( ) ;


<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> ;


<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
)
<<
' '
<<
'%'
<<
Name
;


<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> << ABIAlign << <STR_LIT> ;


<s> MCInstLowering . lower ( MI , TmpInst ) ; EmitToStreamer ( * OutStreamer , TmpInst ) ;


<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 << <STR_LIT> ;


<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 {


<s> } else if ( const GlobalAlias * GA = dyn_cast < GlobalAlias > ( GV ) ) { if ( isa < Function > ( GA -> getAliasee ( ) ) ) NameStr += '&' ; else llvm_unreachable ( <STR_LIT> ) ; } else { 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 += Sanitized ; else NameStr += Mangled ;


<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 += Sanitized ;


<s> case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; default : llvm_unreachable ( <STR_LIT> ) ;


unsigned AS = GV -> getType ( ) -> getAddressSpace ( ) ;


<s> char <ISA_LIT>AsmPrinter :: getSymbolPrefixForAddressSpace ( unsigned AS ) {


<s> char <ISA_LIT>AsmPrinter :: getSymbolPrefixForAddressSpace ( unsigned AS ) { return ( AS == <STR_LIT> || AS == <STR_LIT> ) ? '%' : '&' ;


<s> <ISA_LIT>AsmPrinter :: <ISA_LIT>AsmPrinter ( TargetMachine & TM , std :: unique_ptr < MCStreamer > Streamer ) : AsmPrinter ( TM , std :: move ( Streamer ) ) {


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

return str . startswith ( StringRef ( <STR_LIT> ) ) ;


<s> static bool isModuleLinkage ( const GlobalValue & GV ) { return ! isProgramLinkage ( GV ) ;


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


<s> void LLVMInitialize<ISA_LIT>AsmPrinter ( ) { RegisterAsmPrinter < <ISA_LIT>AsmPrinter > Target32 ( The<ISA_LIT>_32Target ) ; RegisterAsmPrinter < <ISA_LIT>AsmPrinter > Target64 ( The<ISA_LIT>_64Target ) ;


<s> RegisterAsmPrinter < <ISA_LIT>AsmPrinter > Target64 ( The<ISA_LIT>_64Target ) ;


<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> ) Alignment = <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 ) ;


<s> O << format ( <STR_LIT> PRIx64 , 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 ) {


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


<s> void emitEpilogue ( MachineFunction & MF , MachineBasicBlock & MBB ) const override {


<s> return MF . getFrameInfo ( ) -> getObjectOffset ( FI ) ;


<s> int <ISA_LIT>FrameLowering :: getFrameIndexReference ( const MachineFunction & MF , int FI , unsigned & FrameReg ) const { return MF . getFrameInfo ( ) -> getObjectOffset ( FI ) ;


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


<s> explicit <ISA_LIT>FrameLowering ( StackDirection D , unsigned StackAl , int LAO , unsigned TransAl = <NUM_LIT> ) : TargetFrameLowering ( D , StackAl , LAO , TransAl ) {


<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 ) {


<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 [ Index ] + OrigOffset ) ;


<s> <ISA_LIT>InstPrinter :: <ISA_LIT>InstPrinter ( const MCAsmInfo & MAI , const MCInstrInfo & MII , const MCRegisterInfo & MRI ) : MCInstPrinter ( MAI , MII , MRI ) , InArgScope ( false ) {


<s> case BRIG_TYPE_U8X4 : case BRIG_TYPE_S8X4 : case BRIG_TYPE_F16X2 : case BRIG_TYPE_S16X2 : case BRIG_TYPE_U16X2 : return true ; default : return false ; } } case <NUM_LIT> : { switch ( BT ) { case BRIG_TYPE_U64 : case BRIG_TYPE_B64 : case BRIG_TYPE_F64 : case BRIG_TYPE_S64 : case BRIG_TYPE_F16X4 : case BRIG_TYPE_F32X2 : case BRIG_TYPE_ROIMG : case BRIG_TYPE_RWIMG : case BRIG_TYPE_S16X4 : case BRIG_TYPE_S32X2 : case BRIG_TYPE_S8X8 : case BRIG_TYPE_SAMP : case BRIG_TYPE_SIG32 : case BRIG_TYPE_SIG64 : case BRIG_TYPE_U16X4 : case BRIG_TYPE_U32X2 : case BRIG_TYPE_U8X8 : case BRIG_TYPE_WOIMG : return true ; default : return false ; } } case <NUM_LIT> : { switch ( BT ) { case BRIG_TYPE_B1 : case BRIG_TYPE_B8 : case BRIG_TYPE_S8 : case BRIG_TYPE_U8 : return true ; default : return false ; } } case <NUM_LIT> : { switch ( BT ) { case BRIG_TYPE_U16 : case BRIG_TYPE_B16 : case BRIG_TYPE_S16 : case BRIG_TYPE_F16 : return true ;


<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> && Offset != <NUM_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 ( Align ) << <STR_LIT> ;


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


<s> void <ISA_LIT>InstPrinter :: printArraySize ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { int64_t Size = MI -> getOperand ( OpNo ) . getImm ( ) ; if ( Size != <NUM_LIT> ) O << '[' << Size << ']' ;


<s> int64_t Size = MI -> getOperand ( OpNo ) . getImm ( ) ; if ( Size != <NUM_LIT> ) O << '[' << Size << ']' ;


<s> const MCOperand & Op = MI -> getOperand ( OpNo ) ; if ( Op . isImm ( ) ) { O << ( Op . getImm ( ) ? '1' : '0' ) ; return ; } printOperand ( MI , OpNo , O ) ;


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


<s> unsigned Align = MI -> getOperand ( OpNo ) . getImm ( ) ;

if ( Align != <NUM_LIT> ) O << <STR_LIT> << formatDec ( Align ) << ')' ;


<s> case BRIG_ALLOCATION_PROGRAM : O << <STR_LIT> ; break ; case BRIG_ALLOCATION_AGENT : O << <STR_LIT> ; break ; case BRIG_ALLOCATION_AUTOMATIC : O << <STR_LIT> ; break ;


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


<s> case BRIG_ATOMIC_MAX : O << <STR_LIT> ; break ; case BRIG_ATOMIC_MIN : O << <STR_LIT> ; break ; case BRIG_ATOMIC_OR : O << <STR_LIT> ; break ; case BRIG_ATOMIC_ST : O << <STR_LIT> ; break ; case BRIG_ATOMIC_SUB : O << <STR_LIT> ; break ; case BRIG_ATOMIC_WRAPDEC : O << <STR_LIT> ; break ; case BRIG_ATOMIC_WRAPINC : O << <STR_LIT> ; break ; case BRIG_ATOMIC_XOR : O << <STR_LIT> ; break ; case BRIG_ATOMIC_WAIT_EQ : O << <STR_LIT> ; break ; case BRIG_ATOMIC_WAIT_NE : O << <STR_LIT> ; break ; case BRIG_ATOMIC_WAIT_LT : O << <STR_LIT> ; break ; case BRIG_ATOMIC_WAIT_GTE : O << <STR_LIT> ; break ; case BRIG_ATOMIC_WAITTIMEOUT_EQ : O << <STR_LIT> ;


<s> O << <STR_LIT> ; break ; case BRIG_ATOMIC_ST : O << <STR_LIT> ; break ; case BRIG_ATOMIC_SUB : O << <STR_LIT> ; break ; case BRIG_ATOMIC_WRAPDEC : O << <STR_LIT> ; break ; case BRIG_ATOMIC_WRAPINC : O << <STR_LIT> ; break ; case BRIG_ATOMIC_XOR : O << <STR_LIT> ; break ; case BRIG_ATOMIC_WAIT_EQ : O << <STR_LIT> ; break ; case BRIG_ATOMIC_WAIT_NE : O << <STR_LIT> ; break ; case BRIG_ATOMIC_WAIT_LT : O << <STR_LIT> ; break ; case BRIG_ATOMIC_WAIT_GTE : O << <STR_LIT> ; break ; case BRIG_ATOMIC_WAITTIMEOUT_EQ : O << <STR_LIT> ;


<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 ;


<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 ;


<s> void <ISA_LIT>InstPrinter :: printBrigExecutableModifierMask ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { switch ( MI -> getOperand ( OpNo ) . getImm ( ) ) { case BRIG_EXECUTABLE_DEFINITION : O << <STR_LIT> ; break ;


<s> break ; case BRIG_CHANNEL_ORDER_SRGB : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_SRGBX : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_SRGBA : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_SBGRA : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_INTENSITY : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_LUMINANCE : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_DEPTH : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_DEPTH_STENCIL : O << <STR_LIT> ; break ;


<s> case BRIG_CHANNEL_ORDER_R : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_RX : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_RG : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_RGX : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_RA : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_RGB : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_RGBX : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_RGBA : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_BGRA : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_ARGB : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_ABGR : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_SRGB : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_SRGBX : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_SRGBA : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_SBGRA : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_INTENSITY : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_LUMINANCE : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_DEPTH : O << <STR_LIT> ; break ; case BRIG_CHANNEL_ORDER_DEPTH_STENCIL : O << <STR_LIT> ;


<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 :


<s> case BRIG_GEOMETRY_2D : O << <STR_LIT> ; break ; case BRIG_GEOMETRY_3D : O << <STR_LIT> ; break ; case BRIG_GEOMETRY_1DA : O << <STR_LIT> ; break ; case BRIG_GEOMETRY_2DA : O << <STR_LIT> ; break ; case BRIG_GEOMETRY_1DB : O << <STR_LIT> ; break ; case BRIG_GEOMETRY_2DDEPTH : O << <STR_LIT> ; break ; case BRIG_GEOMETRY_2DADEPTH : O << <STR_LIT> ; break ; case BRIG_GEOMETRY_UNKNOWN : O << <STR_LIT> ;


<s> break ; case BRIG_IMAGE_QUERY_ARRAY : O << <STR_LIT> ; break ; case BRIG_IMAGE_QUERY_CHANNELORDER : O << <STR_LIT> ; break ; case BRIG_IMAGE_QUERY_CHANNELTYPE : O << <STR_LIT> ; break ; }


<s> void <ISA_LIT>InstPrinter :: printBrigLinkage ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { switch ( MI -> getOperand ( OpNo ) . getImm ( ) ) { case BRIG_LINKAGE_NONE : O << <STR_LIT> ; break ; case BRIG_LINKAGE_PROGRAM : O << <STR_LIT> ; break ; case BRIG_LINKAGE_MODULE : O << <STR_LIT> ; break ; case BRIG_LINKAGE_FUNCTION : O << <STR_LIT> ; break ; case BRIG_LINKAGE_ARG : O << <STR_LIT> ; break ;


<s> void <ISA_LIT>InstPrinter :: printBrigMemoryModifierMask ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { switch ( MI -> getOperand ( OpNo ) . getImm ( ) ) { case BRIG_MEMORY_CONST : O << <STR_LIT> ; break ; }


<s> break ; case BRIG_MEMORY_ORDER_SC_ACQUIRE : O << <STR_LIT> ; break ; case BRIG_MEMORY_ORDER_SC_RELEASE : O << <STR_LIT> ; break ; case BRIG_MEMORY_ORDER_SC_ACQUIRE_RELEASE : O << <STR_LIT> ; break ; }


<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 :


<s> O << <STR_LIT> ; break ; case BRIG_PACK_PS : O << <STR_LIT> ; break ; case BRIG_PACK_SP : O << <STR_LIT> ; break ; case BRIG_PACK_SS : O << <STR_LIT> ; break ; case BRIG_PACK_S : O << <STR_LIT> ; break ; case BRIG_PACK_P : O << <STR_LIT> ; break ; case BRIG_PACK_PPSAT : O << <STR_LIT> ; break ; case BRIG_PACK_PSSAT : O << <STR_LIT> ; break ; case BRIG_PACK_SPSAT : O << <STR_LIT> ; break ; case BRIG_PACK_SSSAT : O << <STR_LIT> ; break ; case BRIG_PACK_SSAT : O << <STR_LIT> ;


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


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


<s> break ; case BRIG_SAMPLER_QUERY_COORD : O << <STR_LIT> ; break ; case BRIG_SAMPLER_QUERY_FILTER : O << <STR_LIT> ; break ;


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


<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 ;


<s> break ; case BRIG_TYPE_U8X8 : O << <STR_LIT> ; break ; case BRIG_TYPE_U8X16 : O << <STR_LIT> ; break ; case BRIG_TYPE_U16X2 : O << <STR_LIT> ; break ; case BRIG_TYPE_U16X4 : O << <STR_LIT> ; break ; case BRIG_TYPE_U16X8 : O << <STR_LIT> ; break ; case BRIG_TYPE_U32X2 : O << <STR_LIT> ; break ; case BRIG_TYPE_U32X4 : O << <STR_LIT> ; break ; case BRIG_TYPE_U64X2 : O << <STR_LIT> ; break ; case BRIG_TYPE_S8X4 : O << <STR_LIT> ; break ; case BRIG_TYPE_S8X8 : O << <STR_LIT> ; break ; case BRIG_TYPE_S8X16 : O << <STR_LIT> ; break ; case BRIG_TYPE_S16X2 : O << <STR_LIT> ; break ; case BRIG_TYPE_S16X4 : O << <STR_LIT> ; break ; case BRIG_TYPE_S16X8 : O << <STR_LIT> ; break ; case BRIG_TYPE_S32X2 : O << <STR_LIT> ; break ; case BRIG_TYPE_S32X4 : O << <STR_LIT> ; break ; case BRIG_TYPE_S64X2 : O << <STR_LIT> ;


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


<s> O << <STR_LIT> ; break ; case BRIG_WIDTH_262144 : O << <STR_LIT> ; break ; case BRIG_WIDTH_524288 : O << <STR_LIT> ; break ; case BRIG_WIDTH_1048576 : O << <STR_LIT> ; break ; case BRIG_WIDTH_2097152 : O << <STR_LIT> ; break ; case BRIG_WIDTH_4194304 : O << <STR_LIT> ; break ; case BRIG_WIDTH_8388608 : O << <STR_LIT> ; break ; case BRIG_WIDTH_16777216 : O << <STR_LIT> ; break ; case BRIG_WIDTH_33554432 : O << <STR_LIT> ; break ; case BRIG_WIDTH_67108864 : O << <STR_LIT> ; break ; case BRIG_WIDTH_134217728 : O << <STR_LIT> ; break ; case BRIG_WIDTH_268435456 : O << <STR_LIT> ; break ; case BRIG_WIDTH_536870912 : O << <STR_LIT> ; break ; case BRIG_WIDTH_1073741824 : O << <STR_LIT> ; break ; case BRIG_WIDTH_2147483648 : O << <STR_LIT> ; break ; case BRIG_WIDTH_WAVESIZE : O << <STR_LIT> ;


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

unsigned Equiv = MI -> getOperand ( OpNo ) . getImm ( ) ;


<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> << formatDec ( Equiv ) << ')' ;


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


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


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


<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 ( ) ) ) ) ;


O << format ( <STR_LIT> PRIx64 , DoubleToBits ( Op . getFPImm ( ) ) ) ;


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


<s> if ( MI -> getOperand ( OpNo ) . getImm ( ) ) O << <STR_LIT> ;


<s> InArgScope = true ; printInstruction ( MI , OS ) ; printAnnotation ( OS , Annot ) ; return ; } if ( MI -> getOpcode ( ) == <STR_LIT> ) { InArgScope = false ; printInstruction ( MI , OS ) ; printAnnotation ( OS , Annot ) ; return ; } if ( InArgScope ) OS << '\t' ; printInstruction ( MI , OS ) ; if ( MI -> getOpcode ( ) == <STR_LIT> ) { unsigned I = <NUM_LIT> ; OS << '(' ; const MCOperand * Op = & MI -> getOperand ( <NUM_LIT> ) ; while ( ! Op -> isImm ( ) ) { printOperand ( MI , I ++ , OS ) ; Op = & MI -> getOperand ( I ) ; } assert ( ( Op -> isImm ( ) && Op -> getImm ( ) == <NUM_LIT> ) && <STR_LIT> ) ; ++ I ; OS << <STR_LIT> ; unsigned N = MI -> getNumOperands ( ) ; while ( I < N ) { printOperand ( MI , I ++ , OS ) ; if ( I < N ) OS << <STR_LIT> ;


<s> printOperand ( MI , I ++ , OS ) ; Op = & MI -> getOperand ( I ) ; } assert ( ( Op -> isImm ( ) && Op -> getImm ( ) == <NUM_LIT> ) && <STR_LIT> ) ; ++ I ; OS << <STR_LIT> ; unsigned N = MI -> getNumOperands ( ) ; while ( I < N ) { printOperand ( MI , I ++ , OS ) ; if ( I < N ) OS << <STR_LIT> ;


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


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

} else if ( Op . isImm ( ) || Op . isFPImm ( ) ) {


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


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


<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 . getImm ( ) ) ;


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


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


<s> void <ISA_LIT>InstPrinter :: printS64 ( const MCInst * MI , unsigned OpNo , raw_ostream & O ) { const MCOperand & Op = MI -> getOperand ( OpNo ) ; if ( Op . isImm ( ) ) { O << format ( <STR_LIT> PRId64 , Op . getImm ( ) ) ; return ; } printOperand ( MI , OpNo , O ) ;


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


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


<s> if ( Op . isImm ( ) ) { union Bytes { uint32_t I ; uint16_t U16 [ <NUM_LIT> ] ; } U ; U . I = Op . getImm ( ) ; O << format ( <STR_LIT> PRIu16 <STR_LIT> PRIu16 <STR_LIT> , U . U16 [ <NUM_LIT> ] , U . U16 [ <NUM_LIT> ] ) ; return ;


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


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


<s> } U ; U . I = Op . getImm ( ) ; O << format ( <STR_LIT> PRIu32 <STR_LIT> PRIu32 <STR_LIT> , U . U32 [ <NUM_LIT> ] , U . U32 [ <NUM_LIT> ] ) ; return ;


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


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


<s> O << format ( <STR_LIT> PRIu8 <STR_LIT> PRIu8 <STR_LIT> PRIu8 <STR_LIT> PRIu8 <STR_LIT> , U . Byte [ <NUM_LIT> ] , U . Byte [ <NUM_LIT> ] , U . Byte [ <NUM_LIT> ] , U . Byte [ <NUM_LIT> ] ) ; return ; } printOperand ( MI , OpNo , O ) ;


<s> void <ISA_LIT>InstPrinter :: printUImmediate ( uint64_t Imm , raw_ostream & O ) { O << format ( <STR_LIT> PRIu64 , Imm ) ;


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


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


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


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


<s> O << '(' ; printU64 ( MI , OpNo + <NUM_LIT> , 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> ;


<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 ) ;


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


<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 ) ;


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


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


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

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


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


<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 ) ;


<s> void <ISA_LIT>InstPrinter :: printV4F64 ( 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 << <STR_LIT> ; printF64 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; printF64 ( MI , OpNo + <NUM_LIT> , O ) ; O << ')' ;


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


<s> printU32 ( MI , OpNo + <NUM_LIT> , O ) ; O << <STR_LIT> ; 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> ;


<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 ) ;


<s> O << '(' ; printOperand ( MI , OpNo + <NUM_LIT> , 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 ) ;


<s> 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> FBB = <NUM_LIT> ; if ( ! AllowModify ) { TBB = I -> getOperand ( Src0Idx ) . getMBB ( ) ; continue ; } while ( std :: next ( I ) != MBB . end ( ) ) std :: next ( I ) -> eraseFromParent ( ) ; if ( MBB . isLayoutSuccessor ( I -> getOperand ( Src0Idx ) . getMBB ( ) ) ) { TBB = <NUM_LIT> ; I -> eraseFromParent ( ) ; I = MBB . end ( ) ; UnCondBrIter = MBB . end ( ) ; continue ; } TBB = I -> getOperand ( Src0Idx ) . getMBB ( ) ; continue ; } if ( Cond . empty ( ) ) { int Src0Idx = <STR_LIT> ( <STR_LIT> , <STR_LIT> :: src0 ) ; int Src1Idx = <STR_LIT> ( <STR_LIT> , <STR_LIT> :: src1 ) ; FBB = TBB ; TBB = I -> getOperand ( Src1Idx ) . getMBB ( ) ; Cond . push_back ( I -> getOperand ( Src0Idx ) ) ; if ( DisableCondReversion ) { Cond . push_back ( MachineOperand :: CreateImm ( COND_IRREVERSIBLE ) ) ; continue ; } unsigned reg = I -> getOperand ( Src0Idx ) . getReg ( ) ; bool can_reverse = false ; bool is_def_before_use = IsDefBeforeUse ( MBB , reg , MRI , can_reverse ) ; if ( can_reverse ) { can_reverse = ! IsSpilledAfterDef ( I , reg ) ; } if ( ! can_reverse ) { Cond . push_back ( MachineOperand :: CreateImm ( COND_IRREVERSIBLE ) ) ; continue ; } if ( is_def_before_use ) { Cond . push_back ( MachineOperand :: CreateImm ( COND_REVERSE_POSITIVE ) ) ; continue ; } if ( ! MRI . tracksLiveness ( ) ) { Cond . push_back ( MachineOperand :: CreateImm ( COND_IRREVERSIBLE ) ) ; continue ; } unsigned free_reg = <NUM_LIT> ; if ( ! TargetRegisterInfo :: isVirtualRegister ( Cond [ <NUM_LIT> ] . getReg ( ) ) ) { RS -> enterBasicBlock ( & MBB ) ; RS -> forward ( std :: prev ( MBB . end ( ) ) ) ; free_reg = RS -> FindUnusedReg ( & <STR_LIT> ) ; if ( free_reg == <NUM_LIT> ) { Cond . push_back ( MachineOperand :: CreateImm ( COND_IRREVERSIBLE ) ) ;


<s> int Src0Idx = <STR_LIT> ( <STR_LIT> , <STR_LIT> :: src0 ) ; UnCondBrIter = I ; Cond . clear ( ) ; FBB = <NUM_LIT> ; if ( ! AllowModify ) { TBB = I -> getOperand ( Src0Idx ) . getMBB ( ) ; continue ; } while ( std :: next ( I ) != MBB . end ( ) ) std :: next ( I ) -> eraseFromParent ( ) ; if ( MBB . isLayoutSuccessor ( I -> getOperand ( Src0Idx ) . getMBB ( ) ) ) { TBB = <NUM_LIT> ; I -> eraseFromParent ( ) ; I = MBB . end ( ) ; UnCondBrIter = MBB . end ( ) ; continue ; } TBB = I -> getOperand ( Src0Idx ) . getMBB ( ) ; continue ; } if ( Cond . empty ( ) ) { int Src0Idx = <STR_LIT> ( <STR_LIT> , <STR_LIT> :: src0 ) ; int Src1Idx = <STR_LIT> ( <STR_LIT> , <STR_LIT> :: src1 ) ; FBB = TBB ; TBB = I -> getOperand ( Src1Idx ) . getMBB ( ) ; Cond . push_back ( I -> getOperand ( Src0Idx ) ) ; if ( DisableCondReversion ) { Cond . push_back ( MachineOperand :: CreateImm ( COND_IRREVERSIBLE ) ) ; continue ; } unsigned reg = I -> getOperand ( Src0Idx ) . getReg ( ) ; bool can_reverse = false ; bool is_def_before_use = IsDefBeforeUse ( MBB , reg , MRI , can_reverse ) ; if ( can_reverse ) { can_reverse = ! IsSpilledAfterDef ( I , reg ) ; } if ( ! can_reverse ) { Cond . push_back ( MachineOperand :: CreateImm ( COND_IRREVERSIBLE ) ) ; continue ; } if ( is_def_before_use ) { Cond . push_back ( MachineOperand :: CreateImm ( COND_REVERSE_POSITIVE ) ) ; continue ; } if ( ! MRI . tracksLiveness ( ) ) { Cond . push_back ( MachineOperand :: CreateImm ( COND_IRREVERSIBLE ) ) ; continue ; } unsigned free_reg = <NUM_LIT> ; if ( ! TargetRegisterInfo :: isVirtualRegister ( Cond [ <NUM_LIT> ] . getReg ( ) ) ) { RS -> enterBasicBlock ( & MBB ) ; RS -> forward ( std :: prev ( MBB . end ( ) ) ) ; free_reg = RS -> FindUnusedReg ( & <STR_LIT> ) ; if ( free_reg == <NUM_LIT> ) { Cond . push_back ( MachineOperand :: CreateImm ( COND_IRREVERSIBLE ) ) ; continue ;


<s> MachineBasicBlock :: reverse_iterator E = MBB -> rend ( ) ; if ( E == B ) return false ; ++ B ; for ( MachineBasicBlock :: reverse_iterator I = B ; I != E ; ++ I ) { if ( I -> definesRegister ( reg ) ) { return true ; } if ( I -> readsRegister ( reg ) && ( <STR_LIT> ( & * I ) || I -> mayStore ( ) ) ) { canBeSpilled = true ; return true ;


<s> MachineBasicBlock :: reverse_iterator E = MBB -> rend ( ) ; if ( E == B ) return false ; ++ B ; for ( MachineBasicBlock :: reverse_iterator I = B ; I != E ; ++ I ) { if ( I -> definesRegister ( reg ) ) { return true ; } if ( I -> readsRegister ( reg ) && ( <STR_LIT> ( & * I ) || I -> mayStore ( ) ) ) { canBeSpilled = true ; return true ; } } return false ;


<s> return <ISA_LIT>GenInstrInfo :: expandPostRAPseudo ( MI ) ;


<s> bool <ISA_LIT>InstrInfo :: expandPostRAPseudo ( MachineBasicBlock :: iterator MBBI ) const {


<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 ( ) ;


<s> return ( get ( Opcode ) . TSFlags & <STR_LIT> ) >> Log2_64 ( <STR_LIT> ) ;


<s> int64_t getNamedModifierOperand ( MachineInstr & MI , unsigned OpName ) const { return getNamedOperand ( MI , OpName ) -> getImm ( ) ;


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

return getNamedOperand ( const_cast < MachineInstr & > ( MI ) , OpName ) ;


<s> return getNamedOperand ( const_cast < MachineInstr & > ( MI ) , OpName ) ;


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


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


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


<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 ( ) ) . addImm ( BRIG_TYPE_B1 ) ;


<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 :


<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 ; }


<s> case BRIG_TYPE_F16 : return true ; default :


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


<s> bool isInstAddr ( uint16_t Opcode ) const { return get ( Opcode ) . TSFlags & <STR_LIT> ;


<s> bool isInstAddr ( uint16_t Opcode ) const {

return get ( Opcode ) . TSFlags & <STR_LIT> ;


<s> bool isInstAtomic ( uint16_t Opcode ) const { return get ( Opcode ) . TSFlags & <STR_LIT> ;


<s> bool isInstAtomic ( uint16_t Opcode ) const {


<s> bool isInstBasic ( uint16_t Opcode ) const { return get ( Opcode ) . TSFlags & <STR_LIT> ;


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


<s> bool isInstBr ( uint16_t Opcode ) const {


<s> bool isInstCmp ( uint16_t Opcode ) const { return get ( Opcode ) . TSFlags & <STR_LIT> ;


<s> bool isInstCvt ( uint16_t Opcode ) const { return get ( Opcode ) . TSFlags & <STR_LIT> ;


<s> bool isInstImage ( uint16_t Opcode ) const { return get ( Opcode ) . TSFlags & <STR_LIT> ;


<s> return get ( Opcode ) . TSFlags & <STR_LIT> ;


<s> bool isInstMem ( uint16_t Opcode ) const {


<s> bool isInstMod ( uint16_t Opcode ) const {


<s> bool isInstSeg ( uint16_t Opcode ) const { return get ( Opcode ) . TSFlags & <STR_LIT> ;


<s> bool isInstSegCvt ( uint16_t Opcode ) const { return get ( Opcode ) . TSFlags & <STR_LIT> ;


<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> :: address ) ;


<s> unsigned <ISA_LIT>InstrInfo :: isLoadFromStackSlotPostFE ( const MachineInstr * MI , int & FrameIndex ) const { return isLoadFromStackSlot ( MI , FrameIndex ) ;


<s> bool <ISA_LIT>InstrInfo :: isSafeToMoveRegClassDefs ( const TargetRegisterClass * RC ) const { return true ;


<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 ( ) && ! canBeSpilled ) {


<s> int AddressIdx = <STR_LIT> ( MI -> getOpcode ( ) , <STR_LIT> :: address ) ; const MachineOperand & Base = MI -> getOperand ( AddressIdx + <STR_LIT> ) ; if ( Base . isFI ( ) ) { FrameIndex = Base . getIndex ( ) ; return MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ; } return <STR_LIT> ;


<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> ) ;


<s> return isStoreToStackSlot ( MI , FrameIndex ) ;


<s> unsigned <ISA_LIT>InstrInfo :: isStoreToStackSlotPostFE ( const MachineInstr * MI , int & FrameIndex ) const { return isStoreToStackSlot ( MI , FrameIndex ) ;


<s> default : llvm_unreachable ( <STR_LIT> ) ; break ; 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> : 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 <STR_LIT> : case <STR_LIT> : { MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( MF , FrameIndex ) , MachineMemOperand :: MOLoad , MFI . getObjectSize ( FrameIndex ) , MFI . getObjectAlignment ( FrameIndex ) ) ; BuildMI ( MBB , MI , DL , get ( Opc ) ) . addReg ( DestReg , RegState :: Define ) . addFrameIndex ( FrameIndex ) . addReg ( <STR_LIT> ) . addImm ( <NUM_LIT> ) . addImm ( BT ) . addImm ( <STR_LIT> ) . addImm ( MMO -> getAlignment ( ) ) . addImm ( BRIG_WIDTH_1 ) . addImm ( <NUM_LIT> ) . addMemOperand ( MMO ) ; break ;


<s> unsigned int <ISA_LIT>InstrInfo :: RemoveBranch ( MachineBasicBlock & MBB ) const { MachineBasicBlock :: iterator I = MBB . end ( ) ; 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 Count ;


<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 ; }


<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 ) {


<s> 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 : cond_rev_flag = COND_REVERSE_NEGATIVE ; break ; case COND_REVERSE_NEGATIVE : cond_rev_flag = COND_REVERSE_POSITIVE ;


<s> if ( ! Node1 -> isMachineOpcode ( ) ) return false ;

MachineSDNode * mnode1 = cast < MachineSDNode > ( Node1 ) ;


<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> :


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


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


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


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


<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> ] ) ;


<s> <ISA_LIT>IntrinsicInfo :: <ISA_LIT>IntrinsicInfo ( <ISA_LIT>TargetMachine * tm ) : TargetIntrinsicInfo ( ) {


<s> if ( ! IntrID ) return false ; unsigned id = IntrID - <STR_LIT> + <NUM_LIT> ;


<s> return getIntrinsicForGCCBuiltin ( <STR_LIT> , Name ) ;


<s> unsigned <ISA_LIT>IntrinsicInfo :: lookupName ( const char * Name , unsigned Len ) const { return getIntrinsicForGCCBuiltin ( <STR_LIT> , Name ) ;


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


<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> :


<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 ;


<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 :


<s> static BrigType getBrigTypeFromStoreType ( <STR_LIT> VT ) { switch ( VT ) { case <STR_LIT> : return BRIG_TYPE_U32 ; case <STR_LIT> : return BRIG_TYPE_F32 ; case <STR_LIT> : return BRIG_TYPE_U8 ; case <STR_LIT> : return BRIG_TYPE_U16 ; case <STR_LIT> : return BRIG_TYPE_U64 ; case <STR_LIT> : return BRIG_TYPE_F64 ; default : llvm_unreachable ( <STR_LIT> ) ; }


<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> :


<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> ;


<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 :


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


<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 :


<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> ;


<s> explicit <ISA_LIT>DAGToDAGISel ( TargetMachine & TM ) : SelectionDAGISel ( TM ) , Subtarget ( nullptr ) {


<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 , RHSZero , RHSOne ) ;


<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 ) ;


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


<s> bool <ISA_LIT>DAGToDAGISel :: MemOpHasPtr32 ( SDNode * N ) const { return addrSpaceHasPtr32 ( cast < MemSDNode > ( N ) -> getAddressSpace ( ) ) ;


<s> Subtarget = & MF . getSubtarget < <ISA_LIT>Subtarget > ( ) ; return SelectionDAGISel :: runOnMachineFunction ( MF ) ;


<s> const GlobalAddressSDNode * GSDN = cast < GlobalAddressSDNode > ( Node ) ; const GlobalValue * GV = GSDN -> getGlobal ( ) ; EVT PtrVT = Node -> getValueType ( <NUM_LIT> ) ; unsigned AS = GSDN -> getAddressSpace ( ) ; SDLoc SL ( Node ) ; BrigType BT = ( PtrVT == <STR_LIT> ) ? BRIG_TYPE_U32 : BRIG_TYPE_U64 ; unsigned Opcode = ( PtrVT == <STR_LIT> ) ? <STR_LIT> : <STR_LIT> ; const SDValue Ops [ ] = { CurDAG -> getTargetConstant ( AS , SL , <STR_LIT> ) , CurDAG -> getTargetGlobalAddress ( GV , SL , PtrVT , <NUM_LIT> ) , CurDAG -> getRegister ( <STR_LIT> , NVT ) , CurDAG -> getTargetConstant ( GSDN -> getOffset ( ) , SL , PtrVT ) , CurDAG -> getTargetConstant ( BT , SL , <STR_LIT> ) } ; ResNode = CurDAG -> SelectNodeTo ( Node , Opcode , PtrVT , Ops ) ; break ; } case <STR_LIT> : ResNode = SelectINTRINSIC_WO_CHAIN ( Node ) ; break ; case <STR_LIT> : ResNode = SelectINTRINSIC_W_CHAIN ( Node ) ; break ; case <STR_LIT> : { ResNode = CurDAG -> SelectNodeTo ( Node , <STR_LIT> , <STR_LIT> , <STR_LIT> , Node -> getOperand ( <NUM_LIT> ) , Node -> getOperand ( <NUM_LIT> ) ) ; break ; } case <STR_LIT> : { const SDValue Ops [ ] = { Node -> getOperand ( <NUM_LIT> ) , Node -> getOperand ( <NUM_LIT> ) , Node -> getOperand ( <NUM_LIT> ) , Node -> getOperand ( <NUM_LIT> ) } ; ResNode = CurDAG -> SelectNodeTo ( Node , <STR_LIT> , <STR_LIT> , <STR_LIT> , Ops ) ; break ; } case <STR_LIT> : { ResNode = SelectArgLd ( cast < MemSDNode > ( Node ) ) ; break ; } case <STR_LIT> : { ResNode = SelectArgSt ( cast < MemSDNode > ( Node ) ) ; break ;


<s> SDValue Ops [ ] = { Node -> getOperand ( <NUM_LIT> ) , Node -> getOperand ( <NUM_LIT> ) , CurDAG -> getTargetConstant ( BRIG_TYPE_B64 , SL , <STR_LIT> ) , CurDAG -> getTargetConstant ( BRIG_TYPE_B1 , SL , <STR_LIT> ) , Node -> getOperand ( <NUM_LIT> ) } ; SelectGPROrImm ( Ops [ <NUM_LIT> ] , Ops [ <NUM_LIT> ] ) ; return CurDAG -> SelectNodeTo ( Node , <STR_LIT> , Node -> getVTList ( ) , Ops ) ;


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


<s> switch ( Addr . getOpcode ( ) ) { case <STR_LIT> : { int64_t new_offset = cast < ConstantSDNode > ( Addr ) -> getSExtValue ( ) ; if ( Subtarget -> isSmallModel ( ) && ! isInt < <NUM_LIT> > ( new_offset ) ) return false ; Offset += new_offset ; return true ; } case <STR_LIT> : { if ( Base . getNode ( ) == <NUM_LIT> ) { Base = CurDAG -> getTargetFrameIndex ( cast < FrameIndexSDNode > ( Addr ) -> getIndex ( ) , ValueType ) ; return true ; } break ; } case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : { if ( Base . getNode ( ) == <NUM_LIT> ) { Base = CurDAG -> getTargetGlobalAddress ( cast < GlobalAddressSDNode > ( Addr ) -> getGlobal ( ) , SDLoc ( Addr ) , ValueType ) ; int64_t new_offset = Offset + cast < GlobalAddressSDNode > ( Addr ) -> getOffset ( ) ; if ( Subtarget -> isSmallModel ( ) && ! isInt < <NUM_LIT> > ( new_offset ) ) return false ; Offset += new_offset ; return true ; } break ; } case <STR_LIT> : { if ( Base . getNode ( ) == <NUM_LIT> ) { Base = Addr ; return true ; } break ; } case <STR_LIT> : if ( IsOREquivalentToADD ( Addr ) ) { bool can_selec_first_op = SelectAddrCommon ( Addr . getOperand ( <NUM_LIT> ) , Base , Reg , Offset , ValueType , Depth + <NUM_LIT> ) ; if ( can_selec_first_op && SelectAddrCommon ( Addr . getOperand ( <NUM_LIT> ) , Base , Reg , Offset , ValueType , Depth + <NUM_LIT> ) ) return true ; Base = backup_base ; Reg = backup_reg ; Offset = backup_offset ; } break ; case <STR_LIT> : { bool can_selec_first_op = SelectAddrCommon ( Addr . getOperand ( <NUM_LIT> ) , Base , Reg , Offset , ValueType , Depth + <NUM_LIT> ) ; if ( can_selec_first_op && SelectAddrCommon ( Addr . getOperand ( <NUM_LIT> ) , Base , Reg , Offset , ValueType , Depth + <NUM_LIT> ) ) return true ; Base = backup_base ; Reg = backup_reg ; Offset = backup_offset ; break ; } case <STR_LIT> : { if ( SelectAddrCommon ( Addr . getOperand ( <NUM_LIT> ) , Base , Reg , Offset , ValueType , Depth + <NUM_LIT> ) ) { return true ; } Base = backup_base ; Reg = backup_reg ; Offset = backup_offset ; break ;


<s> 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 , Ptr , DestType , SrcType ) ; } else return nullptr ; const SDValue Ops [ ] = { Segment , NoNull , Ptr , DestType , SrcType } ; return CurDAG -> SelectNodeTo ( ASC , Opcode , DestVT , Ops ) ;


<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> ) ;


<s> void <ISA_LIT>DAGToDAGISel :: SelectAddrSpaceCastCommon ( const AddrSpaceCastSDNode & ASC , SDValue & NoNull , SDValue & Ptr , SDValue & DestType , SDValue & SrcType ) const { SDLoc SL ( & ASC ) ; SelectGPROrImm ( ASC . getOperand ( <NUM_LIT> ) , Ptr ) ; NoNull = CurDAG -> getTargetConstant ( <NUM_LIT> , SL , <STR_LIT> ) ; BrigType DestBT = getBrigType ( ASC . getValueType ( <NUM_LIT> ) . getSimpleVT ( ) . SimpleTy , false ) ; BrigType SrcBT = getBrigType ( Ptr . getValueType ( ) . getSimpleVT ( ) . SimpleTy , false ) ; DestType = CurDAG -> getTargetConstant ( DestBT , SL , <STR_LIT> ) ; SrcType = CurDAG -> getTargetConstant ( SrcBT , SL , <STR_LIT> ) ;


<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 ) ;


<s> SDNode * <ISA_LIT>DAGToDAGISel :: SelectArgSt ( MemSDNode * Node ) const { SDValue Base , Reg , Offset ; if ( ! SelectAddr ( Node -> getOperand ( <NUM_LIT> ) , Base , Reg , Offset ) ) return nullptr ; SDLoc SL ( Node ) ; MVT MemVT = Node -> getMemoryVT ( ) . getSimpleVT ( ) ; BrigType BT = getBrigType ( MemVT . SimpleTy , false ) ; SDValue Ops [ <NUM_LIT> ] = { Node -> getOperand ( <NUM_LIT> ) , Base , Reg , Offset , CurDAG -> getTargetConstant ( BT , SL , <STR_LIT> ) , CurDAG -> getTargetConstant ( Node -> getAddressSpace ( ) , SL , <STR_LIT> ) , CurDAG -> getTargetConstant ( Node -> getAlignment ( ) , SL , <STR_LIT> ) , Node -> getOperand ( <NUM_LIT> ) , SDValue ( ) } ; ArrayRef < SDValue > OpsArr = makeArrayRef ( Ops ) ; if ( Node -> getNumOperands ( ) == <NUM_LIT> ) Ops [ <NUM_LIT> ] = Node -> getOperand ( <NUM_LIT> ) ; else OpsArr = OpsArr . drop_back ( <NUM_LIT> ) ; return CurDAG -> SelectNodeTo ( Node , getStoreBrigOpcode ( BT ) , Node -> getVTList ( ) , OpsArr ) ;


<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 , <STR_LIT> ) ;


<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> ) ;


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


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


<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 ( ( <STR_LIT> ) IntNo ) ) {


<s> case <STR_LIT> : { SDLoc SL ( Node ) ; const SDValue Ops [ ] = { CurDAG -> getTargetConstant ( <NUM_LIT> , SL , <STR_LIT> ) , CurDAG -> getTargetConstant ( BRIG_ROUND_FLOAT_DEFAULT , SL , <STR_LIT> ) , Node -> getOperand ( <NUM_LIT> ) , CurDAG -> getConstantFP ( <NUM_LIT> , SL , <STR_LIT> ) , CurDAG -> getTargetConstant ( BRIG_TYPE_F32 , SL , <STR_LIT> ) } ; return CurDAG -> SelectNodeTo ( Node , <STR_LIT> , <STR_LIT> , Ops ) ; } case <STR_LIT> : { SDLoc SL ( Node ) ; const SDValue Ops [ ] = { CurDAG -> getTargetConstant ( <NUM_LIT> , SL , <STR_LIT> ) , CurDAG -> getTargetConstant ( BRIG_ROUND_FLOAT_DEFAULT , SL , <STR_LIT> ) , Node -> getOperand ( <NUM_LIT> ) , CurDAG -> getConstantFP ( BitsToFloat ( <NUM_LIT> ) , SL , <STR_LIT> ) , CurDAG -> getTargetConstant ( BRIG_TYPE_F32 , SL , <STR_LIT> ) } ; return CurDAG -> SelectNodeTo ( Node , <STR_LIT> , <STR_LIT> , Ops ) ; } default : return SelectCode ( Node ) ;


<s> case <STR_LIT> : { SDLoc SL ( Node ) ; const SDValue Ops [ ] = { CurDAG -> getTargetConstant ( <NUM_LIT> , SL , <STR_LIT> ) , CurDAG -> getTargetConstant ( BRIG_ROUND_FLOAT_DEFAULT , SL , <STR_LIT> ) , Node -> getOperand ( <NUM_LIT> ) , CurDAG -> getConstantFP ( BitsToFloat ( <NUM_LIT> ) , SL , <STR_LIT> ) , CurDAG -> getTargetConstant ( BRIG_TYPE_F32 , SL , <STR_LIT> ) } ; return CurDAG -> SelectNodeTo ( Node , <STR_LIT> , <STR_LIT> , Ops ) ; } default : return SelectCode ( Node ) ; }


<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 ( ) , SL , <STR_LIT> ) ;


<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 , DestType , SrcType } ;


<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> ) ;


<s> virtual ~ <ISA_LIT>DAGToDAGISel ( ) {


<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 == Sampler ) Alignment = <NUM_LIT> ;


<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 ) ) {


<s> return MachineJumpTableInfo :: EK_BlockAddress ;


<s> unsigned <ISA_LIT>TargetLowering :: getJumpTableEncoding ( ) const { return MachineJumpTableInfo :: EK_BlockAddress ;


<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 : BRIG_TYPE_U8 ;


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


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


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


<s> bool <ISA_LIT>TargetLowering :: isDesirableToTransformToIntegerOp ( unsigned Opc , EVT VT ) const {

return ( Opc == <STR_LIT> || Opc == <STR_LIT> ) && ( VT . getSimpleVT ( ) == <STR_LIT> || VT . getSimpleVT ( ) == <STR_LIT> ) ;


<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 :: isOffsetFoldingLegal ( const GlobalAddressSDNode * GA ) const {


<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 ) ;


<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> ) ; }


<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 ( ) ) {


<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 ) ; }


<s> 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 Chain ;


<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> ) ) ; } }


<s> 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> ) ) { uint64_t shr_val = SHR -> getZExtValue ( ) & <NUM_LIT> ; if ( ( shr_val & <NUM_LIT> ) == <NUM_LIT> ) return DAG . getNode ( <STR_LIT> , dl , VT , DAG . getConstant ( <STR_LIT> , dl , <STR_LIT> ) , Opr0 , Opr1 , DAG . getConstant ( shr_val >> <NUM_LIT> , dl , <STR_LIT> ) ) ; } return SDValue ( ) ;


<s> SDValue <ISA_LIT>TargetLowering :: PerformDAGCombine ( SDNode * N , DAGCombinerInfo & DCI ) const { switch ( N -> getOpcode ( ) ) { case <STR_LIT> : return PerformIntrinsic_Wo_ChainCombine ( N , DCI ) ; default : break ;


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


<s> <ISA_LIT>TargetLowering :: ~ <ISA_LIT>TargetLowering ( ) {


<s> <ISA_LIT>Kernel ( ) { curSize = <NUM_LIT> ; curRSize = <NUM_LIT> ; curHWSize = <NUM_LIT> ; curHWRSize = <NUM_LIT> ; mKernel = false ; sgv = nullptr ; EnqueuesKernel = false ; KernelIndex = - <NUM_LIT> ;


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


<s> mErrors . insert ( msg ) ; } else if ( val == ALWAYS ) { mErrors . insert ( msg ) ; }


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


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


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


<s> return iterator_range < func_iterator > ( func_begin ( ) , func_end ( ) ) ;


<s> func_iterator func_begin ( ) { return mFuncs . begin ( ) ;


<s> func_md_iterator func_md_begin ( ) {


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


<s> unsigned getArgReg ( unsigned arg ) { return ( arg < mArgRegs . size ( ) ) ? mArgRegs [ arg ] : arg ;


<s> return ( arg < mArgRegs . size ( ) ) ? mArgRegs [ arg ] : arg ;


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


<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 ( ) == <STR_LIT> ) {


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


<s> size_t <ISA_LIT>PrintfInfo :: getNumOperands ( ) {


<s> uint32_t <ISA_LIT>PrintfInfo :: getOperandID ( uint32_t idx ) { return mOperands [ idx ] ;


<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> ) ; }


<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 ( ) ;


<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 ( ) ;


<s> <ISA_LIT>ModuleInfo * AMI = & ( mmi . getObjFileInfo < <ISA_LIT>ModuleInfo > ( ) ) ; AMI -> processModule ( mmi . getModule ( ) , TM ) ; for ( Module :: const_iterator I = F -> getParent ( ) -> begin ( ) , E = F -> getParent ( ) -> end ( ) ; I != E ; ++ I ) { AMI -> getOrCreateFunctionID ( I -> getName ( ) ) ; } mSTM = TM -> getSubtargetImpl ( ) ; mKernel = AMI -> getKernel ( F -> getName ( ) ) ; mScratchSize = - <NUM_LIT> ; mPrivateMemSize = - <NUM_LIT> ; mGroupMemSize = - <NUM_LIT> ; mArgSize = - <NUM_LIT> ; mStackSize = - <NUM_LIT> ;


<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 ) ) return true ;


<s> bool <ISA_LIT>MachineFunctionInfo :: isKernel ( ) const { return mKernel != nullptr && mKernel -> mKernel ;


<s> 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 ( ) ) return false ; const ConstantArray * CA = dyn_cast < ConstantArray > ( GV -> getInitializer ( ) ) ; if ( ! CA ) return false ; for ( uint32_t start = <NUM_LIT> , stop = CA -> getNumOperands ( ) ; start < stop ; ++ start ) { 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 ) ) return true ;


<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 ( ) ) return false ;


<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 ( ) ;


<s> const GlobalVariable * GV = mMF -> getFunction ( ) -> getParent ( ) -> getGlobalVariable ( signedNames ) ; if ( ! GV || ! GV -> hasInitializer ( ) ) return false ; const ConstantArray * CA = dyn_cast < ConstantArray > ( GV -> getInitializer ( ) ) ; if ( ! CA ) return false ; for ( uint32_t start = <NUM_LIT> , stop = CA -> getNumOperands ( ) ; start < stop ; ++ start ) { 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 ) ) return true ;


<s> kernel_md_iterator kernel_md_begin ( ) { return mMetadataKernel . begin ( ) ;


<s> kernel_md_iterator kernel_md_end ( ) {


<s> kernel_md_iterator kernel_md_end ( ) { return mMetadataKernel . end ( ) ;


<s> bool read_size ( ) { return mReadPtr . size ( ) ;


<s> sampler_iterator sampler_begin ( ) { return mSamplerMap . begin ( ) ;


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


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


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


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


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


<s> static bool isValidFirstChar ( char C ) { return isValidChar ( C ) && C != '.' && ! ( C >= '0' && C <= '9' ) ;


<s> return new <ISA_LIT>MCCodeEmitter ( MCII , MRI , Ctx ) ;


<s> DummyMCCodeEmitter ( const MCInstrInfo & II , const MCRegisterInfo & MRI , const MCSubtargetInfo & STI , MCContext & Ctx ) : m_ii ( II ) , m_sti ( STI ) , m_ctx ( Ctx ) {


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


<s> void <ISA_LIT>MCCodeEmitter :: EmitImmediate ( const MCOperand & DispOp , unsigned Size , MCFixupKind FixupKind , unsigned & CurByte , raw_ostream & OS , SmallVectorImpl < MCFixup > & Fixups , int ImmOffset ) const { llvm_unreachable ( <STR_LIT> ) ;


<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 :: EmitRegModRMByte ( const MCOperand & ModRMReg , unsigned RegOpcodeFld , unsigned & CurByte , raw_ostream & OS ) const {


<s> void <ISA_LIT>MCCodeEmitter :: EmitSegmentOverridePrefix ( uint64_t TSFlags , unsigned & CurByte , int MemOperand , const MCInst & MI , 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 {


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


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


<s> <ISA_LIT>MCCodeEmitter ( const MCInstrInfo & mcii , const MCRegisterInfo & mri , MCContext & ctx ) : MCII ( mcii ) , MRI ( mri ) , Ctx ( ctx ) {


<s> <ISA_LIT>MCInstLower :: <ISA_LIT>MCInstLower ( MCContext & ctx , const <ISA_LIT>AsmPrinter & ap ) : Ctx ( ctx ) , AP ( ap ) {