<s> RegisterAsmPrinter < <ISA_LIT>AsmPrinter > X ( getThe<ISA_LIT>Target ( ) ) ;


<s> void <ISA_LIT>AsmPrinter :: EmitInstruction ( const MachineInstr * MI ) { SmallString < <NUM_LIT> > Str ; raw_svector_ostream O ( Str ) ; switch ( MI -> getOpcode ( ) ) { case <STR_LIT> : llvm_unreachable ( <STR_LIT> ) ; break ; } MCInst TmpInst ; MCInstLowering . Lower ( MI , TmpInst ) ;

EmitToStreamer ( * OutStreamer , TmpInst ) ;


<s> return static_cast < <ISA_LIT>TargetStreamer & > ( * OutStreamer -> getTargetStreamer ( ) ) ;


<s> <ISA_LIT>TargetStreamer & <ISA_LIT>AsmPrinter :: getTargetStreamer ( ) {

return static_cast < <ISA_LIT>TargetStreamer & > ( * OutStreamer -> getTargetStreamer ( ) ) ;


<s> bool <ISA_LIT>AsmPrinter :: runOnMachineFunction ( MachineFunction & MF ) { MF . ensureAlignment ( Align ( <NUM_LIT> ) ) ; return AsmPrinter :: runOnMachineFunction ( MF ) ;


<s> explicit <ISA_LIT>AsmPrinter ( TargetMachine & TM , std :: unique_ptr < MCStreamer > Streamer ) : AsmPrinter ( TM , std :: move ( Streamer ) ) , MCInstLowering ( & OutContext , * this ) {


<s> void <ISA_LIT>AsmPrinter :: emitInstruction ( const MachineInstr * MI ) { SmallString < <NUM_LIT> > Str ; raw_svector_ostream O ( Str ) ; switch ( MI -> getOpcode ( ) ) { case <STR_LIT> : llvm_unreachable ( <STR_LIT> ) ; break ; } MCInst TmpInst ; MCInstLowering . Lower ( MI , TmpInst ) ;


<s> StringRef getPassName ( ) const override {


<s> bool <ISA_LIT>AsmPrinter :: runOnMachineFunction ( MachineFunction & MF ) { MF . ensureAlignment ( Align ( <NUM_LIT> ) ) ; AsmPrinter :: runOnMachineFunction ( MF ) ;


<s> DEBUG ( dbgs ( ) << <STR_LIT> ) ; unsigned CC = getCCForBRcc ( MI -> getOperand ( <NUM_LIT> ) . getImm ( ) ) ; if ( CC != - <NUM_LIT> ) { BuildMI ( * MI -> getParent ( ) , MI , MI -> getDebugLoc ( ) , TII -> get ( getBRccForPseudo ( MI ) ) ) . addMBB ( MI -> getOperand ( <NUM_LIT> ) . getMBB ( ) ) . addReg ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) . add ( MI -> getOperand ( <NUM_LIT> ) ) . addImm ( getCCForBRcc ( MI -> getOperand ( <NUM_LIT> ) . getImm ( ) ) ) ;


<s> if ( CC != - <NUM_LIT> ) { BuildMI ( * MI -> getParent ( ) , MI , MI -> getDebugLoc ( ) , TII -> get ( getBRccForPseudo ( MI ) ) ) . addMBB ( MI -> getOperand ( <NUM_LIT> ) . getMBB ( ) ) . addReg ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) . add ( MI -> getOperand ( <NUM_LIT> ) ) . addImm ( getCCForBRcc ( MI -> getOperand ( <NUM_LIT> ) . getImm ( ) ) ) ; MI -> eraseFromParent ( ) ; } else {


<s> void <ISA_LIT>BranchFinalize :: replaceWithCmpBcc ( MachineInstr * MI ) const { DEBUG ( dbgs ( ) << <STR_LIT> << * MI << <STR_LIT> ) ; DEBUG ( dbgs ( ) << <STR_LIT> ) ; BuildMI ( * MI -> getParent ( ) , MI , MI -> getDebugLoc ( ) , TII -> get ( getCmpForPseudo ( MI ) ) ) . addReg ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) . add ( MI -> getOperand ( <NUM_LIT> ) ) ; BuildMI ( * MI -> getParent ( ) , MI , MI -> getDebugLoc ( ) , TII -> get ( <STR_LIT> ) ) . addMBB ( MI -> getOperand ( <NUM_LIT> ) . getMBB ( ) ) . addImm ( MI -> getOperand ( <NUM_LIT> ) . getImm ( ) ) ; MI -> eraseFromParent ( ) ;


<s> DEBUG ( dbgs ( ) << <STR_LIT> << * MI << <STR_LIT> ) ; DEBUG ( dbgs ( ) << <STR_LIT> ) ; BuildMI ( * MI -> getParent ( ) , MI , MI -> getDebugLoc ( ) , TII -> get ( getCmpForPseudo ( MI ) ) ) . addReg ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) . add ( MI -> getOperand ( <NUM_LIT> ) ) ; BuildMI ( * MI -> getParent ( ) , MI , MI -> getDebugLoc ( ) , TII -> get ( <STR_LIT> ) ) . addMBB ( MI -> getOperand ( <NUM_LIT> ) . getMBB ( ) ) . addImm ( MI -> getOperand ( <NUM_LIT> ) . getImm ( ) ) ;


<s> BlockToPCMap . insert ( std :: make_pair ( & MBB , PC ) ) ; for ( auto & MI : MBB ) { unsigned Size = TII -> getInstSizeInBytes ( MI ) ; if ( Size > <NUM_LIT> || Size == <NUM_LIT> ) { DEBUG ( dbgs ( ) << <STR_LIT> << MI << <STR_LIT> ) ; } else { MaxSize += Size ; } if ( MI . isBranch ( ) ) {


<s> unsigned MaxSize = <NUM_LIT> ; TII = MF . getSubtarget < <ISA_LIT>Subtarget > ( ) . getInstrInfo ( ) ; std :: map < MachineBasicBlock * , unsigned > BlockToPCMap ; std :: vector < std :: pair < MachineInstr * , unsigned >> BranchToPCList ; unsigned PC = <NUM_LIT> ; for ( auto & MBB : MF ) { BlockToPCMap . insert ( std :: make_pair ( & MBB , PC ) ) ; for ( auto & MI : MBB ) { unsigned Size = TII -> getInstSizeInBytes ( MI ) ; if ( Size > <NUM_LIT> || Size == <NUM_LIT> ) { DEBUG ( dbgs ( ) << <STR_LIT> << MI << <STR_LIT> ) ; } else { MaxSize += Size ; } if ( MI . isBranch ( ) ) { Branches . push_back ( & MI ) ;

BranchToPCList . emplace_back ( & MI , PC ) ;


<s> <ISA_LIT>BranchFinalize ( ) : MachineFunctionPass ( ID ) { initialize<ISA_LIT>BranchFinalizePass ( * PassRegistry :: getPassRegistry ( ) ) ;


<s> FunctionPass * llvm :: create<ISA_LIT>BranchFinalizePass ( ) { return new <ISA_LIT>BranchFinalize ( ) ;


<s> static unsigned getBRccForPseudo ( MachineInstr * MI ) { assert ( isBRccPseudo ( MI ) && <STR_LIT> ) ; if ( MI -> getOpcode ( ) == <STR_LIT> ) return <STR_LIT> ;


<s> return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; default :


BuildMI ( * MI -> getParent ( ) , MI , MI -> getDebugLoc ( ) , TII -> get ( getBRccForPseudo ( MI ) ) ) . addMBB ( MI -> getOperand ( <NUM_LIT> ) . getMBB ( ) ) . addReg ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) . add ( MI -> getOperand ( <NUM_LIT> ) ) . addImm ( getCCForBRcc ( MI -> getOperand ( <NUM_LIT> ) . getImm ( ) ) ) ;


<s> BuildMI ( * MI -> getParent ( ) , MI , MI -> getDebugLoc ( ) , TII -> get ( getBRccForPseudo ( MI ) ) ) . addMBB ( MI -> getOperand ( <NUM_LIT> ) . getMBB ( ) ) . addReg ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) . add ( MI -> getOperand ( <NUM_LIT> ) ) . addImm ( getCCForBRcc ( MI -> getOperand ( <NUM_LIT> ) . getImm ( ) ) ) ; MI -> eraseFromParent ( ) ; } else {


<s> BuildMI ( * MI -> getParent ( ) , MI , MI -> getDebugLoc ( ) , TII -> get ( getCmpForPseudo ( MI ) ) ) . addReg ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) . add ( MI -> getOperand ( <NUM_LIT> ) ) ; BuildMI ( * MI -> getParent ( ) , MI , MI -> getDebugLoc ( ) , TII -> get ( <STR_LIT> ) ) . addMBB ( MI -> getOperand ( <NUM_LIT> ) . getMBB ( ) ) . addImm ( MI -> getOperand ( <NUM_LIT> ) . getImm ( ) ) ;


<s> BuildMI ( * MI -> getParent ( ) , MI , MI -> getDebugLoc ( ) , TII -> get ( <STR_LIT> ) ) . addMBB ( MI -> getOperand ( <NUM_LIT> ) . getMBB ( ) ) . addImm ( MI -> getOperand ( <NUM_LIT> ) . getImm ( ) ) ;


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MF . getName ( ) << <STR_LIT> ) ; std :: vector < MachineInstr * > Branches ; bool Changed = false ; unsigned MaxSize = <NUM_LIT> ; TII = MF . getSubtarget < <ISA_LIT>Subtarget > ( ) . getInstrInfo ( ) ; std :: map < MachineBasicBlock * , unsigned > BlockToPCMap ; std :: vector < std :: pair < MachineInstr * , unsigned >> BranchToPCList ; unsigned PC = <NUM_LIT> ; for ( auto & MBB : MF ) { BlockToPCMap . insert ( std :: make_pair ( & MBB , PC ) ) ; for ( auto & MI : MBB ) { unsigned Size = TII -> getInstSizeInBytes ( MI ) ; if ( Size > <NUM_LIT> || Size == <NUM_LIT> ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MI << <STR_LIT> ) ; } else { MaxSize += Size ;


<s> for ( auto & MI : MBB ) { unsigned Size = TII -> getInstSizeInBytes ( MI ) ; if ( Size > <NUM_LIT> || Size == <NUM_LIT> ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MI << <STR_LIT> ) ; } else { MaxSize += Size ; } if ( MI . isBranch ( ) ) { Branches . push_back ( & MI ) ; BranchToPCList . emplace_back ( & MI , PC ) ; }


<s> static_assert ( B > <NUM_LIT> , <STR_LIT> ) ; DecodeSymbolicOperandOff ( Inst , Address , SignExtend32 < B > ( InsnS ) , Decoder ) ; return MCDisassembler :: Success ;


<s> const unsigned max = ( <NUM_LIT> << B ) - <NUM_LIT> ; Inst . addOperand ( MCOperand :: createImm ( InsnS < max ? static_cast < int > ( InsnS ) : - <NUM_LIT> ) ) ; return MCDisassembler :: Success ;


<s> Inst . addOperand ( MCOperand :: createImm ( InsnS < max ? static_cast < int > ( InsnS ) : - <NUM_LIT> ) ) ;


<s> static DecodeStatus DecodeGBR32ShortRegister ( MCInst & Inst , unsigned RegNo , uint64_t Address , const void * Decoder ) { if ( RegNo > <NUM_LIT> ) RegNo += <NUM_LIT> ; return DecodeGPR32RegisterClass ( Inst , RegNo , Address , Decoder ) ;


<s> } unsigned Reg = GPR32DecoderTable [ RegNo ] ; Inst . addOperand ( MCOperand :: createReg ( Reg ) ) ;


<s> if ( RegNo >= <NUM_LIT> ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; return MCDisassembler :: Fail ;


<s> return MCDisassembler :: Fail ; } DstA = decodeAField ( Insn ) ; DecodeGPR32RegisterClass ( Inst , DstA , Address , Decoder ) ; LImm = ( Insn >> <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( LImm ) ) ;

Inst . addOperand ( MCOperand :: createImm ( <NUM_LIT> ) ) ;


<s> unsigned DstA , SrcB ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; DstA = decodeAField ( Insn ) ; DecodeGPR32RegisterClass ( Inst , DstA , Address , Decoder ) ; SrcB = decodeBField ( Insn ) ;

DecodeGPR32RegisterClass ( Inst , SrcB , Address , Decoder ) ;


<s> unsigned S9 = Insn & <NUM_LIT> ; unsigned R = ( Insn & ( <NUM_LIT> & ~ <NUM_LIT> ) ) >> <NUM_LIT> ; DecodeGPR32RegisterClass ( Inst , R , Address , Dec ) ;

Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < <NUM_LIT> > ( S9 ) ) ) ;


<s> static DecodeStatus DecodeMEMrs9 ( MCInst & Inst , unsigned Insn , uint64_t Address , const void * Dec ) { unsigned S9 = Insn & <NUM_LIT> ; unsigned R = ( Insn & ( <NUM_LIT> & ~ <NUM_LIT> ) ) >> <NUM_LIT> ; DecodeGPR32RegisterClass ( Inst , R , Address , Dec ) ; Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < <NUM_LIT> > ( S9 ) ) ) ;


<s> static DecodeStatus DecodeMoveHRegInstruction ( MCInst & Inst , uint64_t Insn , uint64_t Address , const void * Decoder ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; using Field = decltype ( Insn ) ; Field h = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) | ( fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) << <NUM_LIT> ) ; Field g = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) | ( fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) << <NUM_LIT> ) ; auto DecodeRegisterOrImm = [ & Inst , Address , Decoder ] ( Field RegNum , Field Value ) { if ( <NUM_LIT> == RegNum ) { Inst . addOperand ( MCOperand :: createImm ( Value ) ) ; return MCDisassembler :: Success ; }

return DecodeGPR32RegisterClass ( Inst , RegNum , Address , Decoder ) ;


<s> Field h = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) | ( fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) << <NUM_LIT> ) ; Field g = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) | ( fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) << <NUM_LIT> ) ; auto DecodeRegisterOrImm = [ & Inst , Address , Decoder ] ( Field RegNum , Field Value ) { if ( <NUM_LIT> == RegNum ) { Inst . addOperand ( MCOperand :: createImm ( Value ) ) ; return MCDisassembler :: Success ;


<s> static_assert ( B > <NUM_LIT> , <STR_LIT> ) ;

Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < B > ( maskTrailingOnes < decltype ( InsnS ) > ( B ) & InsnS ) ) ) ;


<s> SrcC = decodeCField ( Insn ) ; DecodeGPR32RegisterClass ( Inst , SrcC , Address , Decoder ) ; LImm = ( Insn >> <NUM_LIT> ) ;

Inst . addOperand ( MCOperand :: createImm ( LImm ) ) ;


<s> static bool DecodeSymbolicOperand ( MCInst & Inst , uint64_t Address , uint64_t Value , const void * Decoder ) { static const uint64_t atLeast = <NUM_LIT> ; auto Disassembler = static_cast < const MCDisassembler * > ( Decoder ) ; return ( nullptr != Disassembler && Disassembler -> tryAddingSymbolicOperand ( Inst , Value , Address , true , <NUM_LIT> , atLeast ) ) ;


<s> return ( nullptr != Disassembler && Disassembler -> tryAddingSymbolicOperand ( Inst , Value , Address , true , <NUM_LIT> , atLeast ) ) ;


<s> static void DecodeSymbolicOperandOff ( MCInst & Inst , uint64_t Address , uint64_t Offset , const void * Decoder ) {

uint64_t nextAddress = Address + Offset ;


<s> if ( ! readInstruction32 ( Bytes , Address , Size , Insn32 ) ) { return Fail ; } return decodeInstruction ( DecoderTable32 , Instr , Insn32 , Address , this , STI ) ; } else { if ( Bytes . size ( ) >= <NUM_LIT> ) { uint64_t Insn48 ; if ( ! readInstruction48 ( Bytes , Address , Size , Insn48 ) ) return Fail ; Result = decodeInstruction ( DecoderTable48 , Instr , Insn48 , Address , this , STI ) ; if ( Success == Result ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; return Result ; } LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; } uint32_t Insn16 ; if ( ! readInstruction16 ( Bytes , Address , Size , Insn16 ) ) return Fail ;

return decodeInstruction ( DecoderTable16 , Instr , Insn16 , Address , this , STI ) ;


<s> Size = <NUM_LIT> ; return Fail ; } uint8_t DecodeByte = ( Bytes [ <NUM_LIT> ] & <NUM_LIT> ) >> <NUM_LIT> ; if ( DecodeByte < <NUM_LIT> ) { if ( Bytes . size ( ) < <NUM_LIT> ) { Size = <NUM_LIT> ; return Fail ; } if ( Bytes . size ( ) >= <NUM_LIT> ) { uint64_t Insn64 ; if ( ! readInstruction64 ( Bytes , Address , Size , Insn64 ) ) return Fail ; Result = decodeInstruction ( DecoderTable64 , Instr , Insn64 , Address , this , STI ) ; if ( Success == Result ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; return Result ; } LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; } uint32_t Insn32 ; if ( ! readInstruction32 ( Bytes , Address , Size , Insn32 ) ) { return Fail ; } return decodeInstruction ( DecoderTable32 , Instr , Insn32 , Address , this , STI ) ; } else { if ( Bytes . size ( ) >= <NUM_LIT> ) { uint64_t Insn48 ; if ( ! readInstruction48 ( Bytes , Address , Size , Insn48 ) ) return Fail ; Result = decodeInstruction ( DecoderTable48 , Instr , Insn48 , Address , this , STI ) ; if ( Success == Result ) {


<s> void LLVMInitialize<ISA_LIT>Disassembler ( ) {

TargetRegistry :: RegisterMCDisassembler ( getThe<ISA_LIT>Target ( ) , create<ISA_LIT>Disassembler ) ;


<s> unsigned DstB ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; DstB = decodeBField ( Insn ) ; DecodeGPR32RegisterClass ( Inst , DstB , Address , Decoder ) ; using Field = decltype ( Insn ) ; Field U6Field = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( U6Field ) ) ; Field CCField = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( CCField ) ) ; return MCDisassembler :: Success ;


<s> Field U6Field = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( U6Field ) ) ;

Field CCField = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ;


<s> Field H = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) | ( fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) << <NUM_LIT> ) ; Field G = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) | ( fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) << <NUM_LIT> ) ; auto DecodeRegisterOrImm = [ & Inst , Address , Decoder ] ( Field RegNum , Field Value ) { if ( <NUM_LIT> == RegNum ) {

Inst . addOperand ( MCOperand :: createImm ( Value ) ) ;


<s> unsigned DstB = decodeBField ( Insn ) ; DecodeGPR32RegisterClass ( Inst , DstB , Address , Decoder ) ; using Field = decltype ( Insn ) ; Field Lower = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ; Field Upper = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ; Field Sign = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ? - <NUM_LIT> : <NUM_LIT> ; Field Result = Sign * ( ( Upper << <NUM_LIT> ) + Lower ) ; Inst . addOperand ( MCOperand :: createImm ( Result ) ) ;


<s> Field U6 = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ;

Inst . addOperand ( MCOperand :: createImm ( U6 ) ) ;


<s> Field U6 = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( U6 ) ) ; return MCDisassembler :: Success ;


<s> return ( nullptr != Disassembler && Disassembler -> tryAddingSymbolicOperand ( Inst , Value , Address , true , <NUM_LIT> , AtLeast ) ) ;


uint64_t NextAddress = Address + Offset ;


<s> static const uint64_t AtLeast = <NUM_LIT> ;

return ( nullptr != Decoder && Decoder -> tryAddingSymbolicOperand ( Inst , Value , Address , true , <NUM_LIT> , AtLeast , <NUM_LIT> ) ) ;


<s> unsigned DstB ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; DstB = decodeBField ( Insn ) ; DecodeGPR32RegisterClass ( Inst , DstB , Address , Decoder ) ; using Field = decltype ( Insn ) ;

Field U6Field = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ;


<s> Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < <NUM_LIT> > ( S ) ) ) ; return MCDisassembler :: Success ;


<s> static MCDisassembler :: DecodeStatus DecodeBranchTargetS21 ( MCInst & Inst , unsigned S , uint64_t Address , const void * Decoder ) {

Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < <NUM_LIT> > ( S ) ) ) ;


<s> static MCDisassembler :: DecodeStatus DecodeBranchTargetS25 ( MCInst & Inst , unsigned S , uint64_t Address , const void * Decoder ) {


<s> return MCDisassembler :: Fail ; } unsigned Reg = GPR32DecoderTable [ RegNo ] ; Inst . addOperand ( MCOperand :: createReg ( Reg ) ) ;


<s> static MCDisassembler :: DecodeStatus DecodeLdLImmInstruction ( MCInst & Inst , uint64_t Insn , uint64_t Address , const void * Decoder ) { unsigned DstA , SrcB , LImm ; DEBUG ( dbgs ( ) << <STR_LIT> ) ; SrcB = decodeBField ( Insn ) ; if ( SrcB != <NUM_LIT> ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; return MCDisassembler :: Fail ; } DstA = decodeAField ( Insn ) ; DecodeGPR32RegisterClass ( Inst , DstA , Address , Decoder ) ; LImm = ( Insn >> <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( LImm ) ) ; Inst . addOperand ( MCOperand :: createImm ( <NUM_LIT> ) ) ;


<s> unsigned R = ( Insn & ( <NUM_LIT> & ~ <NUM_LIT> ) ) >> <NUM_LIT> ; DecodeGPR32RegisterClass ( Inst , R , Address , Dec ) ; Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < <NUM_LIT> > ( S9 ) ) ) ; return MCDisassembler :: Success ;


<s> Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < <NUM_LIT> > ( <NUM_LIT> & InsnS12 ) ) ) ;


<s> Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < <NUM_LIT> > ( <NUM_LIT> & InsnS9 ) ) ) ; return MCDisassembler :: Success ;


<s> static MCDisassembler :: DecodeStatus DecodeS9Operand ( MCInst & Inst , unsigned InsnS9 , uint64_t Address , const void * Decoder ) { Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < <NUM_LIT> > ( <NUM_LIT> & InsnS9 ) ) ) ; return MCDisassembler :: Success ;


<s> if ( DstB != <NUM_LIT> ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; return MCDisassembler :: Fail ; } SrcC = decodeCField ( Insn ) ;

DecodeGPR32RegisterClass ( Inst , SrcC , Address , Decoder ) ;


<s> LImm = ( Insn >> <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( LImm ) ) ; Inst . addOperand ( MCOperand :: createImm ( <NUM_LIT> ) ) ; return MCDisassembler :: Success ;


<s> MCDisassembler :: DecodeStatus <ISA_LIT>Disassembler :: getInstruction ( MCInst & Instr , uint64_t & Size , ArrayRef < uint8_t > Bytes , uint64_t Address , raw_ostream & vStream , raw_ostream & cStream ) const { MCDisassembler :: DecodeStatus Result ; if ( Bytes . size ( ) < <NUM_LIT> ) { Size = <NUM_LIT> ; return Fail ; } uint8_t DecodeByte = ( Bytes [ <NUM_LIT> ] & <NUM_LIT> ) >> <NUM_LIT> ; if ( DecodeByte < <NUM_LIT> ) { if ( Bytes . size ( ) < <NUM_LIT> ) { Size = <NUM_LIT> ; return Fail ; } if ( Bytes . size ( ) >= <NUM_LIT> ) { uint64_t Insn64 ;

if ( ! readInstruction64 ( Bytes , Address , Size , Insn64 ) ) return Fail ;


<s> if ( Bytes . size ( ) < <NUM_LIT> ) { Size = <NUM_LIT> ; return Fail ; } if ( Bytes . size ( ) >= <NUM_LIT> ) { uint64_t Insn64 ; if ( ! readInstruction64 ( Bytes , Address , Size , Insn64 ) ) return Fail ; Result = decodeInstruction ( DecoderTable64 , Instr , Insn64 , Address , this , STI ) ; if ( Result == MCDisassembler :: Success ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; return MCDisassembler :: Success ; } DEBUG ( dbgs ( ) << <STR_LIT> ) ; } uint32_t Insn32 ; if ( ! readInstruction32 ( Bytes , Address , Size , Insn32 ) ) {


<s> DstA = decodeAField ( Insn ) ; DecodeGPR32RegisterClass ( Inst , DstA , Address , Decoder ) ; LImm = ( Insn >> <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( LImm ) ) ;

Inst . addOperand ( MCOperand :: createImm ( <NUM_LIT> ) ) ;


<s> SrcB = decodeBField ( Insn ) ; DecodeGPR32RegisterClass ( Inst , SrcB , Address , Decoder ) ; if ( decodeCField ( Insn ) != <NUM_LIT> ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; return MCDisassembler :: Fail ;


<s> static DecodeStatus DecodeMoveHRegInstruction ( MCInst & Inst , uint64_t Insn , uint64_t Address , const void * Decoder ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; using Field = decltype ( Insn ) ;

Field h = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) | ( fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) << <NUM_LIT> ) ;


<s> return MCDisassembler :: Fail ; } SrcC = decodeCField ( Insn ) ; DecodeGPR32RegisterClass ( Inst , SrcC , Address , Decoder ) ; LImm = ( Insn >> <NUM_LIT> ) ;


<s> if ( Bytes . size ( ) < <NUM_LIT> ) { Size = <NUM_LIT> ; return Fail ; } uint8_t DecodeByte = ( Bytes [ <NUM_LIT> ] & <NUM_LIT> ) >> <NUM_LIT> ; if ( DecodeByte < <NUM_LIT> ) { if ( Bytes . size ( ) < <NUM_LIT> ) { Size = <NUM_LIT> ; return Fail ; } if ( Bytes . size ( ) >= <NUM_LIT> ) { uint64_t Insn64 ; if ( ! readInstruction64 ( Bytes , Address , Size , Insn64 ) ) return Fail ; Result = decodeInstruction ( DecoderTable64 , Instr , Insn64 , Address , this , STI ) ; if ( Success == Result ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; return Result ; } DEBUG ( dbgs ( ) << <STR_LIT> ) ; } uint32_t Insn32 ; if ( ! readInstruction32 ( Bytes , Address , Size , Insn32 ) ) { return Fail ; } return decodeInstruction ( DecoderTable32 , Instr , Insn32 , Address , this , STI ) ; } else { if ( Bytes . size ( ) >= <NUM_LIT> ) { uint64_t Insn48 ; if ( ! readInstruction48 ( Bytes , Address , Size , Insn48 ) ) return Fail ; Result = decodeInstruction ( DecoderTable48 , Instr , Insn48 , Address , this , STI ) ; if ( Success == Result ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; return Result ; } DEBUG ( dbgs ( ) << <STR_LIT> ) ;


<s> <ISA_LIT>Disassembler ( const MCSubtargetInfo & STI , MCContext & Ctx , MCInstrInfo const * MCII ) : MCDisassembler ( STI , Ctx ) , MCII ( MCII ) {


<s> static MCDisassembler * create<ISA_LIT>Disassembler ( const Target & T , const MCSubtargetInfo & STI , MCContext & Ctx ) { return new <ISA_LIT>Disassembler ( STI , Ctx , T . createMCInstrInfo ( ) ) ;


<s> static unsigned decodeAField ( unsigned Insn ) { return fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ;


<s> static unsigned decodeAField ( unsigned Insn ) {

return fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ;


<s> static unsigned decodeBField ( unsigned Insn ) {

return ( fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) << <NUM_LIT> ) | fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ;


<s> DecodeSymbolicOperandOff ( Inst , Address , SignExtend32 < B > ( InsnS ) , Decoder ) ;


<s> DstB = decodeBField ( Insn ) ; DecodeGPR32RegisterClass ( Inst , DstB , Address , Decoder ) ; using Field = decltype ( Insn ) ; Field U6Field = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( U6Field ) ) ; Field CCField = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( CCField ) ) ; return MCDisassembler :: Success ;


<s> static_assert ( B > <NUM_LIT> , <STR_LIT> ) ; const unsigned max = ( <NUM_LIT> << B ) - <NUM_LIT> ; Inst . addOperand ( MCOperand :: createImm ( InsnS < max ? static_cast < int > ( InsnS ) : - <NUM_LIT> ) ) ;


<s> const unsigned max = ( <NUM_LIT> << B ) - <NUM_LIT> ;

Inst . addOperand ( MCOperand :: createImm ( InsnS < max ? static_cast < int > ( InsnS ) : - <NUM_LIT> ) ) ;


<s> static DecodeStatus DecodeGBR32ShortRegister ( MCInst & Inst , unsigned RegNo , uint64_t Address , const MCDisassembler * Decoder ) { if ( RegNo > <NUM_LIT> ) RegNo += <NUM_LIT> ;

return DecodeGPR32RegisterClass ( Inst , RegNo , Address , Decoder ) ;


<s> static DecodeStatus DecodeGBR32ShortRegister ( MCInst & Inst , unsigned RegNo , uint64_t Address , const MCDisassembler * Decoder ) {

if ( RegNo > <NUM_LIT> ) RegNo += <NUM_LIT> ;


<s> static DecodeStatus DecodeGPR32RegisterClass ( MCInst & Inst , unsigned RegNo , uint64_t Address , const MCDisassembler * Decoder ) { if ( RegNo >= <NUM_LIT> ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; return MCDisassembler :: Fail ;


<s> return MCDisassembler :: Fail ; } unsigned Reg = GPR32DecoderTable [ RegNo ] ;

Inst . addOperand ( MCOperand :: createReg ( Reg ) ) ;


<s> if ( decodeCField ( Insn ) != <NUM_LIT> ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; return MCDisassembler :: Fail ; } Inst . addOperand ( MCOperand :: createImm ( ( uint32_t ) ( Insn >> <NUM_LIT> ) ) ) ;


<s> unsigned R = ( Insn & ( <NUM_LIT> & ~ <NUM_LIT> ) ) >> <NUM_LIT> ; DecodeGPR32RegisterClass ( Inst , R , Address , Dec ) ;

Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < <NUM_LIT> > ( S9 ) ) ) ;


<s> Field G = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) | ( fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) << <NUM_LIT> ) ; auto DecodeRegisterOrImm = [ & Inst , Address , Decoder ] ( Field RegNum , Field Value ) { if ( <NUM_LIT> == RegNum ) { Inst . addOperand ( MCOperand :: createImm ( Value ) ) ; return MCDisassembler :: Success ; } return DecodeGPR32RegisterClass ( Inst , RegNum , Address , Decoder ) ;


<s> static_assert ( B > <NUM_LIT> , <STR_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < B > ( maskTrailingOnes < decltype ( InsnS ) > ( B ) & InsnS ) ) ) ;


<s> unsigned DstB = decodeBField ( Insn ) ; DecodeGPR32RegisterClass ( Inst , DstB , Address , Decoder ) ; using Field = decltype ( Insn ) ; Field Lower = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ; Field Upper = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ;

Field Sign = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ? - <NUM_LIT> : <NUM_LIT> ;


<s> using Field = decltype ( Insn ) ; Field U6 = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( U6 ) ) ;


<s> static DecodeStatus DecodeSOPwithRU6 ( MCInst & Inst , uint64_t Insn , uint64_t Address , const MCDisassembler * Decoder ) {


<s> } SrcC = decodeCField ( Insn ) ; DecodeGPR32RegisterClass ( Inst , SrcC , Address , Decoder ) ; LImm = ( Insn >> <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( LImm ) ) ; Inst . addOperand ( MCOperand :: createImm ( <NUM_LIT> ) ) ;


<s> static bool DecodeSymbolicOperand ( MCInst & Inst , uint64_t Address , uint64_t Value , const MCDisassembler * Decoder ) { static const uint64_t AtLeast = <NUM_LIT> ; return ( nullptr != Decoder && Decoder -> tryAddingSymbolicOperand ( Inst , Value , Address , true , <NUM_LIT> , AtLeast ) ) ;


<s> uint64_t NextAddress = Address + Offset ;

if ( ! DecodeSymbolicOperand ( Inst , Address , NextAddress , Decoder ) ) Inst . addOperand ( MCOperand :: createImm ( Offset ) ) ;


<s> uint64_t NextAddress = Address + Offset ; if ( ! DecodeSymbolicOperand ( Inst , Address , NextAddress , Decoder ) ) Inst . addOperand ( MCOperand :: createImm ( Offset ) ) ;


<s> if ( Success == Result ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; return Result ; } LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; } uint32_t Insn32 ; if ( ! readInstruction32 ( Bytes , Address , Size , Insn32 ) ) { return Fail ; } return decodeInstruction ( DecoderTable32 , Instr , Insn32 , Address , this , STI ) ; } else { if ( Bytes . size ( ) >= <NUM_LIT> ) { uint64_t Insn48 ;

if ( ! readInstruction48 ( Bytes , Address , Size , Insn48 ) ) return Fail ;


<s> TargetRegistry :: RegisterMCDisassembler ( getThe<ISA_LIT>Target ( ) , create<ISA_LIT>Disassembler ) ;


<s> static bool readInstruction32 ( ArrayRef < uint8_t > Bytes , uint64_t Address , uint64_t & Size , uint32_t & Insn ) { Size = <NUM_LIT> ;

Insn = ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) ;


Insn = ( ( uint64_t ) Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( ( uint64_t ) Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( ( uint64_t ) Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( ( uint64_t ) Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( ( uint64_t ) Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( ( uint64_t ) Bytes [ <NUM_LIT> ] << <NUM_LIT> ) ;


<s> static bool readInstruction48 ( ArrayRef < uint8_t > Bytes , uint64_t Address , uint64_t & Size , uint64_t & Insn ) { Size = <NUM_LIT> ; Insn = ( ( uint64_t ) Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( ( uint64_t ) Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( ( uint64_t ) Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( ( uint64_t ) Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( ( uint64_t ) Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( ( uint64_t ) Bytes [ <NUM_LIT> ] << <NUM_LIT> ) ; return true ;


<s> Register Rb = MF . getRegInfo ( ) . createVirtualRegister ( & <STR_LIT> ) ; BuildMI ( * MI . getParent ( ) , MI , MI . getDebugLoc ( ) , TII -> get ( <STR_LIT> ) , Ra ) . add ( Src ) ;

BuildMI ( * MI . getParent ( ) , MI , MI . getDebugLoc ( ) , TII -> get ( <STR_LIT> ) , Rb ) . addImm ( <NUM_LIT> ) . addImm ( <STR_LIT> ) . addReg ( Ra ) ;


<s> BuildMI ( * MI . getParent ( ) , MI , MI . getDebugLoc ( ) , TII -> get ( <STR_LIT> ) ) . add ( Dest ) . addImm ( <NUM_LIT> ) . addImm ( <STR_LIT> ) . addReg ( R ) ;


<s> void <ISA_LIT>ExpandPseudos :: expandCTTZ ( MachineFunction & MF , MachineBasicBlock :: iterator MII ) { MachineInstr & MI = * MII ; const MachineOperand & Dest = MI . getOperand ( <NUM_LIT> ) ;

const MachineOperand & Src = MI . getOperand ( <NUM_LIT> ) ;


<s> Register AddOpc = isUInt < <NUM_LIT> > ( SI . getOperand ( <NUM_LIT> ) . getImm ( ) ) ? <STR_LIT> : <STR_LIT> ; BuildMI ( * SI . getParent ( ) , SI , SI . getDebugLoc ( ) , TII -> get ( AddOpc ) , AddrReg ) . addReg ( SI . getOperand ( <NUM_LIT> ) . getReg ( ) ) . addImm ( SI . getOperand ( <NUM_LIT> ) . getImm ( ) ) ; BuildMI ( * SI . getParent ( ) , SI , SI . getDebugLoc ( ) , TII -> get ( getMappedOp ( SI . getOpcode ( ) ) ) ) . addReg ( SI . getOperand ( <NUM_LIT> ) . getReg ( ) ) . addReg ( AddrReg ) . addImm ( <NUM_LIT> ) ; SI . eraseFromParent ( ) ;


<s> Register AddrReg = MF . getRegInfo ( ) . createVirtualRegister ( & <STR_LIT> ) ; Register AddOpc = isUInt < <NUM_LIT> > ( SI . getOperand ( <NUM_LIT> ) . getImm ( ) ) ? <STR_LIT> : <STR_LIT> ; BuildMI ( * SI . getParent ( ) , SI , SI . getDebugLoc ( ) , TII -> get ( AddOpc ) , AddrReg ) . addReg ( SI . getOperand ( <NUM_LIT> ) . getReg ( ) ) . addImm ( SI . getOperand ( <NUM_LIT> ) . getImm ( ) ) ; BuildMI ( * SI . getParent ( ) , SI , SI . getDebugLoc ( ) , TII -> get ( getMappedOp ( SI . getOpcode ( ) ) ) ) . addReg ( SI . getOperand ( <NUM_LIT> ) . getReg ( ) ) . addReg ( AddrReg ) . addImm ( <NUM_LIT> ) ;


<s> while ( MBBI != E ) { MachineBasicBlock :: iterator NMBBI = std :: next ( MBBI ) ; switch ( MBBI -> getOpcode ( ) ) { case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : expandStore ( MF , MBBI ) ; Expanded = true ; break ; case <STR_LIT> : expandCTLZ ( MF , MBBI ) ;


<s> <ISA_LIT>ExpandPseudos ( ) : MachineFunctionPass ( ID ) {


<s> unsigned AddrReg = MF . getRegInfo ( ) . createVirtualRegister ( & <STR_LIT> ) ; unsigned AddOpc = isUInt < <NUM_LIT> > ( SI . getOperand ( <NUM_LIT> ) . getImm ( ) ) ? <STR_LIT> : <STR_LIT> ; BuildMI ( * SI . getParent ( ) , SI , SI . getDebugLoc ( ) , TII -> get ( AddOpc ) , AddrReg ) . addReg ( SI . getOperand ( <NUM_LIT> ) . getReg ( ) ) . addImm ( SI . getOperand ( <NUM_LIT> ) . getImm ( ) ) ; BuildMI ( * SI . getParent ( ) , SI , SI . getDebugLoc ( ) , TII -> get ( getMappedOp ( SI . getOpcode ( ) ) ) ) . addReg ( SI . getOperand ( <NUM_LIT> ) . getReg ( ) ) . addReg ( AddrReg ) . addImm ( <NUM_LIT> ) ; SI . eraseFromParent ( ) ;


<s> BuildMI ( * SI . getParent ( ) , SI , SI . getDebugLoc ( ) , TII -> get ( getMappedOp ( SI . getOpcode ( ) ) ) ) . addReg ( SI . getOperand ( <NUM_LIT> ) . getReg ( ) ) . addReg ( AddrReg ) . addImm ( <NUM_LIT> ) ; SI . eraseFromParent ( ) ;


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


<s> switch ( PseudoOp ) { case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ;


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


<s> while ( MBBI != E ) { MachineBasicBlock :: iterator NMBBI = std :: next ( MBBI ) ; switch ( MBBI -> getOpcode ( ) ) { case <STR_LIT> : case <STR_LIT> : case <STR_LIT> :


<s> TargetFrameLowering :: determineCalleeSaves ( MF , SavedRegs , RS ) ; SavedRegs . set ( <STR_LIT> ) ;


<s> if ( Amt > AFI -> MaxCallStackReq && Old . getOpcode ( ) == <STR_LIT> ) AFI -> MaxCallStackReq = Amt ; } else { if ( Amt != <NUM_LIT> ) { assert ( ( Old . getOpcode ( ) == <STR_LIT> || Old . getOpcode ( ) == <STR_LIT> ) && <STR_LIT> ) ; bool IsAdd = ( Old . getOpcode ( ) == <STR_LIT> ) ; emitRegUpdate ( MBB , I , dl , <STR_LIT> , Amt , IsAdd , TII ) ; }


<s> BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) . addExternalSymbol ( load_funclet_name [ Last - <STR_LIT> ] ) . addReg ( <STR_LIT> , RegState :: Implicit | RegState :: Kill ) ; BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( <NUM_LIT> * ( StackSlotsUsedByFunclet ) ) ; } if ( SavedBlink ) { BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) ; } if ( hasFP ( MF ) ) { BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) . addReg ( <STR_LIT> , RegState :: Define ) . addReg ( <STR_LIT> , RegState :: Define ) . addReg ( <STR_LIT> ) . addImm ( <NUM_LIT> ) ; } if ( MF . getFunction ( ) . isVarArg ( ) ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ;

unsigned VarArgsBytes = MFI . getObjectSize ( AFI -> getVarArgsFrameIndex ( ) ) ;


<s> MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; uint64_t StackSize = MF . getFrameInfo ( ) . getStackSize ( ) ; bool SavedBlink = false ; unsigned AmountAboveFunclet = <NUM_LIT> ; if ( hasFP ( MF ) ) { BuildMI ( MBB , MBBI , DebugLoc ( ) , TII -> get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( StackSize ) ; AmountAboveFunclet += <NUM_LIT> ; } const std :: vector < CalleeSavedInfo > & CSI = MFI . getCalleeSavedInfo ( ) ; unsigned Last = determineLastCalleeSave ( CSI ) ; unsigned StackSlotsUsedByFunclet = <NUM_LIT> ; if ( UseSaveRestoreFunclet && Last > <STR_LIT> ) { StackSlotsUsedByFunclet = Last - <STR_LIT> ; AmountAboveFunclet += <NUM_LIT> * ( StackSlotsUsedByFunclet + <NUM_LIT> ) ; SavedBlink = true ; } if ( MFI . hasCalls ( ) && ! SavedBlink ) { AmountAboveFunclet += <NUM_LIT> ; SavedBlink = true ; } if ( StackSize - AmountAboveFunclet ) { BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( StackSize - AmountAboveFunclet ) ; } if ( StackSlotsUsedByFunclet ) { BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) . addExternalSymbol ( load_funclet_name [ Last - <STR_LIT> ] ) . addReg ( <STR_LIT> , RegState :: Implicit | RegState :: Kill ) ; BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( <NUM_LIT> * ( StackSlotsUsedByFunclet ) ) ; } if ( SavedBlink ) { BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) ;


<s> unsigned CFIIndex = MF . addFrameInst ( MCCFIInstruction :: createDefCfaOffset ( nullptr , - MFI . getStackSize ( ) ) ) ; BuildMI ( MBB , MBBI , dl , TII -> get ( TargetOpcode :: CFI_INSTRUCTION ) ) . addCFIIndex ( CFIIndex ) . setMIFlags ( MachineInstr :: FrameSetup ) ; int CurOffset = - <NUM_LIT> ; if ( hasFP ( MF ) ) { CFIIndex = MF . addFrameInst ( MCCFIInstruction :: createOffset ( nullptr , MRI -> getDwarfRegNum ( <STR_LIT> , true ) , CurOffset ) ) ; BuildMI ( MBB , MBBI , dl , TII -> get ( TargetOpcode :: CFI_INSTRUCTION ) ) . addCFIIndex ( CFIIndex ) . setMIFlags ( MachineInstr :: FrameSetup ) ; CurOffset -= <NUM_LIT> ; } if ( MFI . hasCalls ( ) ) { CFIIndex = MF . addFrameInst ( MCCFIInstruction :: createOffset ( nullptr , MRI -> getDwarfRegNum ( <STR_LIT> , true ) , CurOffset ) ) ; BuildMI ( MBB , MBBI , dl , TII -> get ( TargetOpcode :: CFI_INSTRUCTION ) ) . addCFIIndex ( CFIIndex ) . setMIFlags ( MachineInstr :: FrameSetup ) ; } for ( const auto & Entry : CSI ) { unsigned Reg = Entry . getReg ( ) ; int FI = Entry . getFrameIdx ( ) ; if ( ( hasFP ( MF ) && Reg == <STR_LIT> ) || ( MFI . hasCalls ( ) && Reg == <STR_LIT> ) ) continue ; CFIIndex = MF . addFrameInst ( MCCFIInstruction :: createOffset ( nullptr , MRI -> getDwarfRegNum ( Reg , true ) , MFI . getObjectOffset ( FI ) ) ) ;


<s> void <ISA_LIT>FrameLowering :: processFunctionBeforeFrameFinalized ( MachineFunction & MF , RegScavenger * RS ) const { const TargetRegisterInfo * RegInfo = MF . getSubtarget ( ) . getRegisterInfo ( ) ; DEBUG ( dbgs ( ) << <STR_LIT> << MF . getName ( ) << <STR_LIT> ) ;

MachineFrameInfo & MFI = MF . getFrameInfo ( ) ;


<s> bool <ISA_LIT>FrameLowering :: restoreCalleeSavedRegisters ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator MI , std :: vector < CalleeSavedInfo > & CSI , const TargetRegisterInfo * TRI ) const { DEBUG ( dbgs ( ) << <STR_LIT> << MBB . getParent ( ) -> getName ( ) << <STR_LIT> ) ;

unsigned Last = determineLastCalleeSave ( CSI ) ;


<s> bool <ISA_LIT>FrameLowering :: spillCalleeSavedRegisters ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator MI , const std :: vector < CalleeSavedInfo > & CSI , const TargetRegisterInfo * TRI ) const { DEBUG ( dbgs ( ) << <STR_LIT> << MBB . getParent ( ) -> getName ( ) << <STR_LIT> ) ; unsigned Last = determineLastCalleeSave ( CSI ) ;

if ( UseSaveRestoreFunclet && Last > <STR_LIT> ) {


<s> unsigned Last = <NUM_LIT> ; for ( auto Reg : CSI ) { assert ( Reg . getReg ( ) >= <STR_LIT> && Reg . getReg ( ) <= <STR_LIT> && <STR_LIT> ) ; if ( Reg . getReg ( ) > Last ) Last = Reg . getReg ( ) ; } return Last ;


<s> assert ( Reg . getReg ( ) >= <STR_LIT> && Reg . getReg ( ) <= <STR_LIT> && <STR_LIT> ) ; if ( Reg . getReg ( ) > Last ) Last = Reg . getReg ( ) ; }


<s> AmountAboveFunclet += <NUM_LIT> ; } const std :: vector < CalleeSavedInfo > & CSI = MFI . getCalleeSavedInfo ( ) ; unsigned Last = determineLastCalleeSave ( CSI ) ; unsigned StackSlotsUsedByFunclet = <NUM_LIT> ; if ( UseSaveRestoreFunclet && Last > <STR_LIT> ) { StackSlotsUsedByFunclet = Last - <STR_LIT> ; AmountAboveFunclet += <NUM_LIT> * ( StackSlotsUsedByFunclet + <NUM_LIT> ) ; SavedBlink = true ; } if ( MFI . hasCalls ( ) && ! SavedBlink ) { AmountAboveFunclet += <NUM_LIT> ; SavedBlink = true ; } if ( unsigned MoveAmount = StackSize - AmountAboveFunclet ) { unsigned Opc = <STR_LIT> ; if ( isUInt < <NUM_LIT> > ( MoveAmount ) ) Opc = <STR_LIT> ; else if ( isInt < <NUM_LIT> > ( MoveAmount ) ) Opc = <STR_LIT> ; BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( Opc ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( StackSize - AmountAboveFunclet ) ; } if ( StackSlotsUsedByFunclet ) { BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) . addExternalSymbol ( load_funclet_name [ Last - <STR_LIT> ] ) . addReg ( <STR_LIT> , RegState :: Implicit | RegState :: Kill ) ; unsigned Opc = <STR_LIT> ;

if ( isUInt < <NUM_LIT> > ( <NUM_LIT> * StackSlotsUsedByFunclet ) ) Opc = <STR_LIT> ;


<s> unsigned VarArgsBytes = MFI . getObjectSize ( AFI -> getVarArgsFrameIndex ( ) ) ; unsigned Opc = <STR_LIT> ; if ( isUInt < <NUM_LIT> > ( VarArgsBytes ) ) Opc = <STR_LIT> ; else if ( isInt < <NUM_LIT> > ( VarArgsBytes ) ) Opc = <STR_LIT> ; BuildMI ( MBB , MBBI , dl , TII -> get ( Opc ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( VarArgsBytes ) ; } if ( hasFP ( MF ) ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; BuildMI ( MBB , MBBI , dl , TII -> get ( <STR_LIT> ) ) . addReg ( <STR_LIT> , RegState :: Define ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( - <NUM_LIT> ) ; AlreadyAdjusted += <NUM_LIT> ; } if ( UseSaveRestoreFunclet && Last > <STR_LIT> ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; StackSlotsUsedByFunclet = Last - <STR_LIT> ; BuildMI ( MBB , MBBI , dl , TII -> get ( <STR_LIT> ) ) ; BuildMI ( MBB , MBBI , dl , TII -> get ( <STR_LIT> ) ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( <NUM_LIT> * StackSlotsUsedByFunclet ) ; BuildMI ( MBB , MBBI , dl , TII -> get ( <STR_LIT> ) ) . addExternalSymbol ( store_funclet_name [ Last - <STR_LIT> ] ) . addReg ( <STR_LIT> , RegState :: Implicit | RegState :: Kill ) ; AlreadyAdjusted += <NUM_LIT> * ( StackSlotsUsedByFunclet + <NUM_LIT> ) ; SavedBlink = true ; } if ( MFI . hasCalls ( ) && ! SavedBlink ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; BuildMI ( MBB , MBBI , dl , TII -> get ( <STR_LIT> ) ) ; AlreadyAdjusted += <NUM_LIT> ; } if ( AFI -> MaxCallStackReq > <NUM_LIT> ) MFI . setStackSize ( MFI . getStackSize ( ) + AFI -> MaxCallStackReq ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << ( MFI . getStackSize ( ) - AlreadyAdjusted ) << <STR_LIT> ) ; generateStackAdjustment ( MBB , MBBI , * ST . getInstrInfo ( ) , dl , - ( MFI . getStackSize ( ) - AlreadyAdjusted ) , <STR_LIT> ) ; if ( hasFP ( MF ) ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ;

BuildMI ( MBB , MBBI , dl , TII -> get ( isUInt < <NUM_LIT> > ( MFI . getStackSize ( ) ) ? <STR_LIT> : <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( MFI . getStackSize ( ) ) ;


<s> else Opc = IsAdd ? <STR_LIT> : <STR_LIT> ;

BuildMI ( MBB , MBBI , dl , TII -> get ( Opc ) , Reg ) . addReg ( Reg , RegState :: Kill ) . addImm ( NumBytes ) ;


<s> unsigned AdjOp ; if ( ! Amount ) return ; bool Positive ; unsigned AbsAmount ; if ( Amount < <NUM_LIT> ) { AbsAmount = - Amount ; Positive = false ; } else { AbsAmount = Amount ; Positive = true ; } LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << Amount << <STR_LIT> << AbsAmount << <STR_LIT> ) ; assert ( ( AbsAmount % <NUM_LIT> == <NUM_LIT> ) && <STR_LIT> ) ; if ( isUInt < <NUM_LIT> > ( AbsAmount ) ) AdjOp = Positive ? <STR_LIT> : <STR_LIT> ; else if ( isInt < <NUM_LIT> > ( AbsAmount ) ) AdjOp = Positive ? <STR_LIT> : <STR_LIT> ; else AdjOp = Positive ? <STR_LIT> : <STR_LIT> ; BuildMI ( MBB , MBBI , dl , TII . get ( AdjOp ) , StackPtr ) . addReg ( StackPtr ) . addImm ( AbsAmount ) ;


<s> static void generateStackAdjustment ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator MBBI , const <ISA_LIT>InstrInfo & TII , DebugLoc dl , int Amount , int StackPtr ) { unsigned AdjOp ; if ( ! Amount ) return ; bool Positive ; unsigned AbsAmount ; if ( Amount < <NUM_LIT> ) { AbsAmount = - Amount ; Positive = false ; } else { AbsAmount = Amount ; Positive = true ; } LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << Amount << <STR_LIT> << AbsAmount << <STR_LIT> ) ;

assert ( ( AbsAmount % <NUM_LIT> == <NUM_LIT> ) && <STR_LIT> ) ;


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MBB . getParent ( ) -> getName ( ) << <STR_LIT> ) ; unsigned Last = determineLastCalleeSave ( CSI ) ; if ( UseSaveRestoreFunclet && Last > <STR_LIT> ) { return true ; }


<s> BuildMI ( MBB , MBBI , dl , TII -> get ( <STR_LIT> ) ) ; BuildMI ( MBB , MBBI , dl , TII -> get ( <STR_LIT> ) ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( <NUM_LIT> * StackSlotsUsedByFunclet ) ; BuildMI ( MBB , MBBI , dl , TII -> get ( <STR_LIT> ) ) . addExternalSymbol ( store_funclet_name [ Last - <STR_LIT> ] ) . addReg ( <STR_LIT> , RegState :: Implicit | RegState :: Kill ) ; AlreadyAdjusted += <NUM_LIT> * ( StackSlotsUsedByFunclet + <NUM_LIT> ) ; SavedBlink = true ; } if ( MFI . hasCalls ( ) && ! SavedBlink ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; BuildMI ( MBB , MBBI , dl , TII -> get ( <STR_LIT> ) ) ; AlreadyAdjusted += <NUM_LIT> ; } if ( AFI -> MaxCallStackReq > <NUM_LIT> ) MFI . setStackSize ( MFI . getStackSize ( ) + AFI -> MaxCallStackReq ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << ( MFI . getStackSize ( ) - AlreadyAdjusted ) << <STR_LIT> ) ; generateStackAdjustment ( MBB , MBBI , * ST . getInstrInfo ( ) , dl , - ( MFI . getStackSize ( ) - AlreadyAdjusted ) , <STR_LIT> ) ; if ( hasFP ( MF ) ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; BuildMI ( MBB , MBBI , dl , TII -> get ( isUInt < <NUM_LIT> > ( MFI . getStackSize ( ) ) ? <STR_LIT> : <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( MFI . getStackSize ( ) ) ; } unsigned CFIIndex = MF . addFrameInst ( MCCFIInstruction :: cfiDefCfaOffset ( nullptr , MFI . getStackSize ( ) ) ) ; BuildMI ( MBB , MBBI , dl , TII -> get ( TargetOpcode :: CFI_INSTRUCTION ) ) . addCFIIndex ( CFIIndex ) . setMIFlags ( MachineInstr :: FrameSetup ) ; int CurOffset = - <NUM_LIT> ; if ( hasFP ( MF ) ) { CFIIndex = MF . addFrameInst ( MCCFIInstruction :: createOffset ( nullptr , MRI -> getDwarfRegNum ( <STR_LIT> , true ) , CurOffset ) ) ; BuildMI ( MBB , MBBI , dl , TII -> get ( TargetOpcode :: CFI_INSTRUCTION ) ) . addCFIIndex ( CFIIndex ) . setMIFlags ( MachineInstr :: FrameSetup ) ; CurOffset -= <NUM_LIT> ; } if ( MFI . hasCalls ( ) ) { CFIIndex = MF . addFrameInst ( MCCFIInstruction :: createOffset ( nullptr , MRI -> getDwarfRegNum ( <STR_LIT> , true ) , CurOffset ) ) ; BuildMI ( MBB , MBBI , dl , TII -> get ( TargetOpcode :: CFI_INSTRUCTION ) ) . addCFIIndex ( CFIIndex ) . setMIFlags ( MachineInstr :: FrameSetup ) ; } for ( const auto & Entry : CSI ) { unsigned Reg = Entry . getReg ( ) ;


<s> const TargetRegisterClass * RC = & <STR_LIT> ; if ( MFI . hasStackObjects ( ) ) { int RegScavFI = MFI . CreateStackObject ( RegInfo -> getSpillSize ( * RC ) , RegInfo -> getSpillAlign ( * RC ) , false ) ; RS -> addScavengingFrameIndex ( RegScavFI ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << RegScavFI << <STR_LIT> ) ; }


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MFI . getStackSize ( ) << <STR_LIT> ) ; const TargetRegisterClass * RC = & <STR_LIT> ; if ( MFI . hasStackObjects ( ) ) { int RegScavFI = MFI . CreateStackObject ( RegInfo -> getSpillSize ( * RC ) , RegInfo -> getSpillAlign ( * RC ) , false ) ; RS -> addScavengingFrameIndex ( RegScavFI ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << RegScavFI << <STR_LIT> ) ; }


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MBB . getParent ( ) -> getName ( ) << <STR_LIT> ) ; unsigned Last = determineLastCalleeSave ( CSI ) ; if ( UseSaveRestoreFunclet && Last > <STR_LIT> ) {


<s> <ISA_LIT>FrameLowering ( const <ISA_LIT>Subtarget & st ) : TargetFrameLowering ( TargetFrameLowering :: StackGrowsDown , Align ( <NUM_LIT> ) , <NUM_LIT> ) , ST ( st ) {


<s> } if ( MFI . hasCalls ( ) || ( UseSaveRestoreFunclet && Last > <STR_LIT> ) ) { int StackObj = MFI . CreateFixedSpillStackObject ( <NUM_LIT> , CurOffset , true ) ; DEBUG ( dbgs ( ) << <STR_LIT> << StackObj << <STR_LIT> << CurOffset << <STR_LIT> ) ; ( void ) StackObj ; CurOffset -= <NUM_LIT> ; } for ( unsigned Which = Last ; Which > <STR_LIT> ; Which -- ) { auto RegI = getSavedReg ( CSI , Which ) ; if ( RegI == CSI . end ( ) || RegI -> getFrameIdx ( ) == <NUM_LIT> ) { int FI = MFI . CreateFixedSpillStackObject ( <NUM_LIT> , CurOffset , true ) ; if ( RegI != CSI . end ( ) ) RegI -> setFrameIdx ( FI ) ; } else MFI . setObjectOffset ( RegI -> getFrameIdx ( ) , CurOffset ) ; CurOffset -= <NUM_LIT> ; } for ( auto & I : CSI ) { if ( I . getReg ( ) > <STR_LIT> ) continue ; if ( I . getFrameIdx ( ) == <NUM_LIT> ) { I . setFrameIdx ( MFI . CreateFixedSpillStackObject ( <NUM_LIT> , CurOffset , true ) ) ; DEBUG ( dbgs ( ) << <STR_LIT> << I . getFrameIdx ( ) << <STR_LIT> << CurOffset << <STR_LIT> ) ; } else { MFI . setObjectOffset ( I . getFrameIdx ( ) , CurOffset ) ; DEBUG ( dbgs ( ) << <STR_LIT> << I . getFrameIdx ( ) << <STR_LIT> << CurOffset << <STR_LIT> ) ; } CurOffset -= <NUM_LIT> ; }


<s> TargetFrameLowering :: determineCalleeSaves ( MF , SavedRegs , RS ) ; SavedRegs . set ( <STR_LIT> ) ;


<s> } else { if ( Amt != <NUM_LIT> ) { assert ( ( Old . getOpcode ( ) == <STR_LIT> || Old . getOpcode ( ) == <STR_LIT> ) && <STR_LIT> ) ; bool IsAdd = ( Old . getOpcode ( ) == <STR_LIT> ) ; emitRegUpdate ( MBB , I , dl , <STR_LIT> , Amt , IsAdd , TII ) ; } } return MBB . erase ( I ) ;


<s> if ( hasFP ( MF ) ) { BuildMI ( MBB , MBBI , DebugLoc ( ) , TII -> get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( StackSize ) ; AmountAboveFunclet += <NUM_LIT> ; } const std :: vector < CalleeSavedInfo > & CSI = MFI . getCalleeSavedInfo ( ) ; unsigned Last = determineLastCalleeSave ( CSI ) ; unsigned StackSlotsUsedByFunclet = <NUM_LIT> ; if ( UseSaveRestoreFunclet && Last > <STR_LIT> ) { StackSlotsUsedByFunclet = Last - <STR_LIT> ; AmountAboveFunclet += <NUM_LIT> * ( StackSlotsUsedByFunclet + <NUM_LIT> ) ; SavedBlink = true ; } if ( MFI . hasCalls ( ) && ! SavedBlink ) { AmountAboveFunclet += <NUM_LIT> ; SavedBlink = true ; } if ( StackSize - AmountAboveFunclet ) { BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( StackSize - AmountAboveFunclet ) ; } if ( StackSlotsUsedByFunclet ) { BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) . addExternalSymbol ( load_funclet_name [ Last - <STR_LIT> ] ) . addReg ( <STR_LIT> , RegState :: Implicit | RegState :: Kill ) ; BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( <NUM_LIT> * ( StackSlotsUsedByFunclet ) ) ; } if ( SavedBlink ) { BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) ; } if ( hasFP ( MF ) ) {

BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) . addReg ( <STR_LIT> , RegState :: Define ) . addReg ( <STR_LIT> , RegState :: Define ) . addReg ( <STR_LIT> ) . addImm ( <NUM_LIT> ) ;


<s> const std :: vector < CalleeSavedInfo > & CSI = MFI . getCalleeSavedInfo ( ) ; unsigned Last = determineLastCalleeSave ( CSI ) ; unsigned StackSlotsUsedByFunclet = <NUM_LIT> ; if ( UseSaveRestoreFunclet && Last > <STR_LIT> ) { StackSlotsUsedByFunclet = Last - <STR_LIT> ; AmountAboveFunclet += <NUM_LIT> * ( StackSlotsUsedByFunclet + <NUM_LIT> ) ; SavedBlink = true ; } if ( MFI . hasCalls ( ) && ! SavedBlink ) { AmountAboveFunclet += <NUM_LIT> ; SavedBlink = true ; } if ( StackSize - AmountAboveFunclet ) { BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( StackSize - AmountAboveFunclet ) ; } if ( StackSlotsUsedByFunclet ) {

BuildMI ( MBB , MBBI , MBB . findDebugLoc ( MBBI ) , TII -> get ( <STR_LIT> ) ) . addExternalSymbol ( load_funclet_name [ Last - <STR_LIT> ] ) . addReg ( <STR_LIT> , RegState :: Implicit | RegState :: Kill ) ;


<s> DEBUG ( dbgs ( ) << <STR_LIT> << Amount << <STR_LIT> << AbsAmount << <STR_LIT> ) ; assert ( ( AbsAmount % <NUM_LIT> == <NUM_LIT> ) && <STR_LIT> ) ; if ( isUInt < <NUM_LIT> > ( AbsAmount ) ) AdjOp = Positive ? <STR_LIT> : <STR_LIT> ;

else AdjOp = Positive ? <STR_LIT> : <STR_LIT> ;


<s> static void generateStackAdjustment ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator MBBI , const <ISA_LIT>InstrInfo & TII , DebugLoc dl , int Amount , int StackPtr ) { unsigned AdjOp ; if ( ! Amount ) return ; bool Positive ; unsigned AbsAmount ; if ( Amount < <NUM_LIT> ) { AbsAmount = - Amount ; Positive = false ; } else {


<s> DEBUG ( dbgs ( ) << <STR_LIT> << MF . getFunction ( ) -> getName ( ) << <STR_LIT> ) ; MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; DEBUG ( dbgs ( ) << <STR_LIT> << MFI . getStackSize ( ) << <STR_LIT> ) ; const TargetRegisterClass * RC = & <STR_LIT> ; if ( MFI . hasStackObjects ( ) ) { int RegScavFI = MFI . CreateStackObject ( RegInfo -> getSpillSize ( * RC ) , RegInfo -> getSpillAlignment ( * RC ) , false ) ;

RS -> addScavengingFrameIndex ( RegScavFI ) ;


<s> DEBUG ( dbgs ( ) << <STR_LIT> << MFI . getStackSize ( ) << <STR_LIT> ) ; const TargetRegisterClass * RC = & <STR_LIT> ; if ( MFI . hasStackObjects ( ) ) { int RegScavFI = MFI . CreateStackObject ( RegInfo -> getSpillSize ( * RC ) , RegInfo -> getSpillAlignment ( * RC ) , false ) ; RS -> addScavengingFrameIndex ( RegScavFI ) ; DEBUG ( dbgs ( ) << <STR_LIT> << RegScavFI << <STR_LIT> ) ;


<s> DEBUG ( dbgs ( ) << <STR_LIT> << MBB . getParent ( ) -> getFunction ( ) -> getName ( ) << <STR_LIT> ) ; unsigned Last = determineLastCalleeSave ( CSI ) ; if ( UseSaveRestoreFunclet && Last > <STR_LIT> ) { return true ; }


<s> bool <ISA_LIT>FrameLowering :: spillCalleeSavedRegisters ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator MI , const std :: vector < CalleeSavedInfo > & CSI , const TargetRegisterInfo * TRI ) const { DEBUG ( dbgs ( ) << <STR_LIT> << MBB . getParent ( ) -> getFunction ( ) -> getName ( ) << <STR_LIT> ) ; unsigned Last = determineLastCalleeSave ( CSI ) ; if ( UseSaveRestoreFunclet && Last > <STR_LIT> ) { return true ; }


<s> const TargetRegisterInfo * RegInfo = MF . getSubtarget ( ) . getRegisterInfo ( ) ; bool HasFP = MF . getTarget ( ) . Options . DisableFramePointerElim ( MF ) || MF . getFrameInfo ( ) . hasVarSizedObjects ( ) || MF . getFrameInfo ( ) . isFrameAddressTaken ( ) || RegInfo -> hasStackRealignment ( MF ) ;


<s> bool HasFP = MF . getTarget ( ) . Options . DisableFramePointerElim ( MF ) || MF . getFrameInfo ( ) . hasVarSizedObjects ( ) || MF . getFrameInfo ( ) . isFrameAddressTaken ( ) || RegInfo -> hasStackRealignment ( MF ) ; return HasFP ;


<s> ScalarAlloc = - ScalarAlloc ; } generateStackAdjustment ( MBB , MBBI , * ST . getInstrInfo ( ) , DebugLoc ( ) , ScalarAlloc , <STR_LIT> ) ;


<s> void <ISA_LIT>FrameLowering :: adjustStackToMatchRecords ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator MBBI , bool Allocate ) const { MachineFunction & MF = * MBB . getParent ( ) ; int ScalarAlloc = MF . getFrameInfo ( ) . getStackSize ( ) ;


<s> <ISA_LIT>FrameLowering ( const <ISA_LIT>Subtarget & st ) : TargetFrameLowering ( TargetFrameLowering :: StackGrowsDown , <NUM_LIT> , <NUM_LIT> ) , ST ( st ) {


<s> auto RegI = getSavedReg ( CSI , Which ) ; if ( RegI == CSI . end ( ) || RegI -> getFrameIdx ( ) == <NUM_LIT> ) { int FI = MFI . CreateFixedSpillStackObject ( <NUM_LIT> , CurOffset , true ) ; if ( RegI != CSI . end ( ) ) RegI -> setFrameIdx ( FI ) ; } else MFI . setObjectOffset ( RegI -> getFrameIdx ( ) , CurOffset ) ; CurOffset -= <NUM_LIT> ; } for ( auto & I : CSI ) { if ( I . getReg ( ) > <STR_LIT> ) continue ; if ( I . getFrameIdx ( ) == <NUM_LIT> ) {

I . setFrameIdx ( MFI . CreateFixedSpillStackObject ( <NUM_LIT> , CurOffset , true ) ) ;


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MF . getName ( ) << <STR_LIT> ) ; TargetFrameLowering :: determineCalleeSaves ( MF , SavedRegs , RS ) ;


<s> void <ISA_LIT>FrameLowering :: determineCalleeSaves ( MachineFunction & MF , BitVector & SavedRegs , RegScavenger * RS ) const { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MF . getName ( ) << <STR_LIT> ) ; TargetFrameLowering :: determineCalleeSaves ( MF , SavedRegs , RS ) ; SavedRegs . set ( <STR_LIT> ) ;


<s> assert ( Reg . getReg ( ) >= <STR_LIT> && Reg . getReg ( ) <= <STR_LIT> && <STR_LIT> ) ; if ( Reg . getReg ( ) > Last ) Last = Reg . getReg ( ) ;


<s> if ( Reg . getReg ( ) > Last ) Last = Reg . getReg ( ) ; } return Last ;


<s> auto * AFI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; if ( ! hasFP ( MF ) ) { if ( Amt > AFI -> MaxCallStackReq && Old . getOpcode ( ) == <STR_LIT> ) AFI -> MaxCallStackReq = Amt ; } else { if ( Amt != <NUM_LIT> ) { assert ( ( Old . getOpcode ( ) == <STR_LIT> || Old . getOpcode ( ) == <STR_LIT> ) && <STR_LIT> ) ; bool IsAdd = ( Old . getOpcode ( ) == <STR_LIT> ) ; emitRegUpdate ( MBB , I , dl , <STR_LIT> , Amt , IsAdd , TII ) ; }


<s> static void emitRegUpdate ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator & MBBI , DebugLoc dl , unsigned Reg , int NumBytes , bool IsAdd , const <ISA_LIT>InstrInfo * TII ) { unsigned Opc = IsAdd ? <STR_LIT> : <STR_LIT> ; BuildMI ( MBB , MBBI , dl , TII -> get ( Opc ) , Reg ) . addReg ( Reg , RegState :: Kill ) . addImm ( NumBytes ) ;


<s> AbsAmount = Amount ; Positive = true ; } LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << Amount << <STR_LIT> << AbsAmount << <STR_LIT> ) ; assert ( ( AbsAmount % <NUM_LIT> == <NUM_LIT> ) && <STR_LIT> ) ;

if ( isUInt < <NUM_LIT> > ( AbsAmount ) ) AdjOp = Positive ? <STR_LIT> : <STR_LIT> ;


<s> static std :: vector < CalleeSavedInfo > :: iterator getSavedReg ( std :: vector < CalleeSavedInfo > & V , unsigned reg ) {

for ( auto I = V . begin ( ) , E = V . end ( ) ; I != E ; ++ I ) {


<s> for ( auto I = V . begin ( ) , E = V . end ( ) ; I != E ; ++ I ) { if ( reg == I -> getReg ( ) ) return I ; }


<s> bool HasFP = MF . getTarget ( ) . Options . DisableFramePointerElim ( MF ) || MF . getFrameInfo ( ) . hasVarSizedObjects ( ) || MF . getFrameInfo ( ) . isFrameAddressTaken ( ) || RegInfo -> needsStackRealignment ( MF ) ; return HasFP ;


<s> bool <ISA_LIT>FrameLowering :: hasFP ( const MachineFunction & MF ) const { const TargetRegisterInfo * RegInfo = MF . getSubtarget ( ) . getRegisterInfo ( ) ; bool HasFP = MF . getTarget ( ) . Options . DisableFramePointerElim ( MF ) || MF . getFrameInfo ( ) . hasVarSizedObjects ( ) || MF . getFrameInfo ( ) . isFrameAddressTaken ( ) || RegInfo -> needsStackRealignment ( MF ) ; return HasFP ;


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MF . getName ( ) << <STR_LIT> ) ; MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MFI . getStackSize ( ) << <STR_LIT> ) ; const TargetRegisterClass * RC = & <STR_LIT> ; if ( MFI . hasStackObjects ( ) ) {

int RegScavFI = MFI . CreateStackObject ( RegInfo -> getSpillSize ( * RC ) , RegInfo -> getSpillAlignment ( * RC ) , false ) ;


<s> bool <ISA_LIT>FrameLowering :: spillCalleeSavedRegisters ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator MI , const std :: vector < CalleeSavedInfo > & CSI , const TargetRegisterInfo * TRI ) const { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << MBB . getParent ( ) -> getName ( ) << <STR_LIT> ) ; unsigned Last = determineLastCalleeSave ( CSI ) ; if ( UseSaveRestoreFunclet && Last > <STR_LIT> ) { return true ;


<s> void printOperand ( const MCInst * MI , uint64_t , unsigned OpNum , raw_ostream & O ) { printOperand ( MI , OpNum , O ) ;


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << cc << <STR_LIT> ) ; return <STR_LIT> ;


<s> case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ;


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


<s> O << <ISA_LIT>CondCodeToString ( ( <STR_LIT> ) MI -> getOperand ( OpNum ) . getImm ( ) ) ;


<s> void <ISA_LIT>InstPrinter :: printInst ( const MCInst * MI , uint64_t Address , StringRef Annot , const MCSubtargetInfo & STI , raw_ostream & O ) { printInstruction ( MI , Address , O ) ; printAnnotation ( O , Annot ) ;


<s> printU6ShiftedBy ( <NUM_LIT> , MI , OpNum , O ) ;


<s> unsigned Value2 = Value >> ShiftBy ; if ( Value2 > <NUM_LIT> || ( Value2 << ShiftBy != Value ) ) { errs ( ) << <STR_LIT> << <STR_LIT> << MI -> getOpcode ( ) << <STR_LIT> << Value ; if ( ShiftBy ) errs ( ) << <STR_LIT> << ( <NUM_LIT> << ShiftBy ) << <STR_LIT> ; assert ( false && <STR_LIT> ) ; } } printOperand ( MI , OpNum , O ) ;


<s> errs ( ) << <STR_LIT> << <STR_LIT> << MI -> getOpcode ( ) << <STR_LIT> << Value ; if ( ShiftBy ) errs ( ) << <STR_LIT> << ( <NUM_LIT> << ShiftBy ) << <STR_LIT> ; assert ( false && <STR_LIT> ) ; } }


<s> static const char * <ISA_LIT>BRCondCodeToString ( <STR_LIT> BRCC ) { switch ( BRCC ) { 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> int Offset = <NUM_LIT> ; const MCSymbolRefExpr * SRE ; if ( const auto * BE = dyn_cast < MCBinaryExpr > ( Expr ) ) { SRE = dyn_cast < MCSymbolRefExpr > ( BE -> getLHS ( ) ) ; const auto * CE = dyn_cast < MCConstantExpr > ( BE -> getRHS ( ) ) ;


<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> ; } return BadConditionCode ( BRCC ) ;


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


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


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


<s> DEBUG ( dbgs ( ) << <STR_LIT> << cc << <STR_LIT> ) ;


<s> static const char * BadConditionCode ( T cc ) { DEBUG ( dbgs ( ) << <STR_LIT> << cc << <STR_LIT> ) ; return <STR_LIT> ;


<s> const MCOperand & Op = MI -> getOperand ( OpNum ) ;

assert ( Op . isImm ( ) && <STR_LIT> ) ;


<s> assert ( Op . isImm ( ) && <STR_LIT> ) ;

O << <ISA_LIT>BRCondCodeToString ( ( <STR_LIT> ) Op . getImm ( ) ) ;


<s> const auto * CE = dyn_cast < MCConstantExpr > ( BE -> getRHS ( ) ) ; assert ( SRE && CE && <STR_LIT> ) ; Offset = CE -> getValue ( ) ; } else { SRE = dyn_cast < MCSymbolRefExpr > ( Expr ) ; assert ( SRE && <STR_LIT> ) ; } assert ( SRE -> getKind ( ) == MCSymbolRefExpr :: VK_None ) ; OS << '@' ; SRE -> getSymbol ( ) . print ( OS , MAI ) ; if ( Offset ) {


<s> void <ISA_LIT>InstPrinter :: printInst ( const MCInst * MI , raw_ostream & O , StringRef Annot , const MCSubtargetInfo & STI ) { printInstruction ( MI , O ) ;


<s> void <ISA_LIT>InstPrinter :: printInst ( const MCInst * MI , raw_ostream & O , StringRef Annot , const MCSubtargetInfo & STI ) { printInstruction ( MI , O ) ; printAnnotation ( O , Annot ) ;


<s> const MCOperand & base = MI -> getOperand ( OpNum ) ; const MCOperand & offset = MI -> getOperand ( OpNum + <NUM_LIT> ) ; assert ( base . isReg ( ) && <STR_LIT> ) ; assert ( offset . isImm ( ) && <STR_LIT> ) ; printRegName ( O , base . getReg ( ) ) ;


<s> void <ISA_LIT>InstPrinter :: printOperand ( const MCInst * MI , unsigned OpNum , raw_ostream & O ) { const MCOperand & Op = MI -> getOperand ( OpNum ) ; if ( Op . isReg ( ) ) { printRegName ( O , Op . getReg ( ) ) ; return ; } if ( Op . isImm ( ) ) { O << Op . getImm ( ) ; return ; } assert ( Op . isExpr ( ) && <STR_LIT> ) ; printExpr ( Op . getExpr ( ) , & MAI , O ) ;


<s> const MCOperand & Op = MI -> getOperand ( OpNum ) ; if ( Op . isReg ( ) ) { printRegName ( O , Op . getReg ( ) ) ; return ; } if ( Op . isImm ( ) ) {


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

const MCOperand & Op = MI -> getOperand ( OpNum ) ;


O << <ISA_LIT>CondCodeToString ( ( <STR_LIT> ) Op . getImm ( ) ) ;


<s> void <ISA_LIT>InstPrinter :: printRegName ( raw_ostream & OS , unsigned RegNo ) const {

OS << StringRef ( getRegisterName ( RegNo ) ) . lower ( ) ;


<s> while ( isPredicated ( * I ) || I -> isTerminator ( ) || I -> isDebugValue ( ) ) { bool CantAnalyze = false ; while ( I -> isDebugValue ( ) || ! I -> isTerminator ( ) ) { if ( I == MBB . begin ( ) ) return false ; -- I ; } if ( isJumpOpcode ( I -> getOpcode ( ) ) ) { CantAnalyze = true ; } else if ( isUncondBranchOpcode ( I -> getOpcode ( ) ) ) { TBB = I -> getOperand ( <NUM_LIT> ) . getMBB ( ) ; } else if ( isCondBranchOpcode ( I -> getOpcode ( ) ) ) { if ( ! Cond . empty ( ) ) return true ; assert ( ! FBB && <STR_LIT> ) ; FBB = TBB ; TBB = I -> getOperand ( <NUM_LIT> ) . getMBB ( ) ; Cond . push_back ( I -> getOperand ( <NUM_LIT> ) ) ; Cond . push_back ( I -> getOperand ( <NUM_LIT> ) ) ; Cond . push_back ( I -> getOperand ( <NUM_LIT> ) ) ; } else if ( I -> isReturn ( ) ) { CantAnalyze = ! isPredicated ( * I ) ; } else { return true ; } if ( ! isPredicated ( * I ) && ( isUncondBranchOpcode ( I -> getOpcode ( ) ) || isJumpOpcode ( I -> getOpcode ( ) ) || I -> isReturn ( ) ) ) {


<s> unsigned Align = MFI . getObjectAlignment ( FrameIndex ) ; MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( MF , FrameIndex ) , MachineMemOperand :: MOLoad , MFI . getObjectSize ( FrameIndex ) , Align ) ; assert ( MMO && <STR_LIT> ) ;

assert ( TRI -> getSpillSize ( * RC ) == <NUM_LIT> && <STR_LIT> ) ;


<s> MachineFunction & MF = * MBB . getParent ( ) ; MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; unsigned Align = MFI . getObjectAlignment ( FrameIndex ) ; MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( MF , FrameIndex ) , MachineMemOperand :: MOLoad , MFI . getObjectSize ( FrameIndex ) , Align ) ; assert ( MMO && <STR_LIT> ) ; assert ( TRI -> getSpillSize ( * RC ) == <NUM_LIT> && <STR_LIT> ) ; assert ( <STR_LIT> . hasSubClassEq ( RC ) && <STR_LIT> ) ;

DEBUG ( dbgs ( ) << <STR_LIT> << PrintReg ( DestReg , TRI ) << <STR_LIT> << FrameIndex << <STR_LIT> ) ;


<s> void <ISA_LIT>InstrInfo :: storeRegToStackSlot ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator I , unsigned SrcReg , bool isKill , int FrameIndex , const TargetRegisterClass * RC , const TargetRegisterInfo * TRI ) const { DebugLoc dl = MBB . findDebugLoc ( I ) ; MachineFunction & MF = * MBB . getParent ( ) ; MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; unsigned Align = MFI . getObjectAlignment ( FrameIndex ) ; MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( MF , FrameIndex ) , MachineMemOperand :: MOStore , MFI . getObjectSize ( FrameIndex ) , Align ) ; assert ( MMO && <STR_LIT> ) ; assert ( TRI -> getSpillSize ( * RC ) == <NUM_LIT> && <STR_LIT> ) ; assert ( <STR_LIT> . hasSubClassEq ( RC ) && <STR_LIT> ) ;

DEBUG ( dbgs ( ) << <STR_LIT> << PrintReg ( SrcReg , TRI ) << <STR_LIT> << FrameIndex << <STR_LIT> ) ;


<s> assert ( <STR_LIT> . hasSubClassEq ( RC ) && <STR_LIT> ) ; DEBUG ( dbgs ( ) << <STR_LIT> << printReg ( DestReg , TRI ) << <STR_LIT> << FrameIndex << <STR_LIT> ) ;

BuildMI ( MBB , I , dl , get ( <STR_LIT> ) ) . addReg ( DestReg , RegState :: Define ) . addFrameIndex ( FrameIndex ) . addImm ( <NUM_LIT> ) . addMemOperand ( MMO ) ;


<s> DebugLoc dl = MBB . findDebugLoc ( I ) ; MachineFunction & MF = * MBB . getParent ( ) ; MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; unsigned Align = MFI . getObjectAlignment ( FrameIndex ) ; MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( MF , FrameIndex ) , MachineMemOperand :: MOStore , MFI . getObjectSize ( FrameIndex ) , Align ) ;


<s> DebugLoc dl = MBB . findDebugLoc ( I ) ; MachineFunction & MF = * MBB . getParent ( ) ; MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; unsigned Align = MFI . getObjectAlignment ( FrameIndex ) ; MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( MF , FrameIndex ) , MachineMemOperand :: MOLoad , MFI . getObjectSize ( FrameIndex ) , Align ) ; assert ( MMO && <STR_LIT> ) ; assert ( TRI -> getSpillSize ( * RC ) == <NUM_LIT> && <STR_LIT> ) ; assert ( <STR_LIT> . hasSubClassEq ( RC ) && <STR_LIT> ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << printReg ( DestReg , TRI ) << <STR_LIT> << FrameIndex << <STR_LIT> ) ;


<s> MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( MF , FrameIndex ) , MachineMemOperand :: MOStore , MFI . getObjectSize ( FrameIndex ) , Align ) ; assert ( MMO && <STR_LIT> ) ; assert ( TRI -> getSpillSize ( * RC ) == <NUM_LIT> && <STR_LIT> ) ;

assert ( <STR_LIT> . hasSubClassEq ( RC ) && <STR_LIT> ) ;


<s> DebugLoc dl = MBB . findDebugLoc ( I ) ; MachineFunction & MF = * MBB . getParent ( ) ; MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; unsigned Align = MFI . getObjectAlignment ( FrameIndex ) ; MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( MF , FrameIndex ) , MachineMemOperand :: MOStore , MFI . getObjectSize ( FrameIndex ) , Align ) ; assert ( MMO && <STR_LIT> ) ; assert ( TRI -> getSpillSize ( * RC ) == <NUM_LIT> && <STR_LIT> ) ; assert ( <STR_LIT> . hasSubClassEq ( RC ) && <STR_LIT> ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << printReg ( SrcReg , TRI ) << <STR_LIT> << FrameIndex << <STR_LIT> ) ; BuildMI ( MBB , I , dl , get ( <STR_LIT> ) ) . addReg ( SrcReg , getKillRegState ( isKill ) ) . addFrameIndex ( FrameIndex ) . addImm ( <NUM_LIT> ) . addMemOperand ( MMO ) ;


<s> void <ISA_LIT>InstrInfo :: copyPhysReg ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator I , const DebugLoc & dl , MCRegister DestReg , MCRegister SrcReg , bool KillSrc ) const { assert ( <STR_LIT> . contains ( SrcReg ) && <STR_LIT> ) ; assert ( <STR_LIT> . contains ( DestReg ) && <STR_LIT> ) ; BuildMI ( MBB , I , dl , get ( <STR_LIT> ) , DestReg ) . addReg ( SrcReg , getKillRegState ( KillSrc ) ) ;


<s> OffsetPos ++ ; } if ( ! MI . getOperand ( BasePos ) . isReg ( ) || ! MI . getOperand ( OffsetPos ) . isImm ( ) ) return false ;


<s> bool <ISA_LIT>InstrInfo :: getBaseAndOffsetPosition ( const MachineInstr & MI , unsigned & BasePos , unsigned & OffsetPos ) const { if ( ! MI . mayLoad ( ) && ! MI . mayStore ( ) ) return false ; BasePos = <NUM_LIT> ; OffsetPos = <NUM_LIT> ;

if ( isPostIncrement ( MI ) || isPreIncrement ( MI ) ) {


<s> const MachineFunction * MF = MI . getParent ( ) -> getParent ( ) ; const char * AsmStr = MI . getOperand ( <NUM_LIT> ) . getSymbolName ( ) ; return getInlineAsmLength ( AsmStr , * MF -> getTarget ( ) . getMCAsmInfo ( ) ) ;


<s> const char * AsmStr = MI . getOperand ( <NUM_LIT> ) . getSymbolName ( ) ;

return getInlineAsmLength ( AsmStr , * MF -> getTarget ( ) . getMCAsmInfo ( ) ) ;


<s> assert ( TBB && <STR_LIT> ) ; assert ( ( Cond . size ( ) == <NUM_LIT> || Cond . size ( ) == <NUM_LIT> ) && <STR_LIT> ) ; if ( Cond . empty ( ) ) { BuildMI ( & MBB , dl , get ( <STR_LIT> ) ) . addMBB ( TBB ) ; return <NUM_LIT> ; } int BccOpc = Cond [ <NUM_LIT> ] . isImm ( ) ? <STR_LIT> : <STR_LIT> ;

MachineInstrBuilder MIB = BuildMI ( & MBB , dl , get ( BccOpc ) ) ;


<s> bool <ISA_LIT>InstrInfo :: isPostIncrement ( const MachineInstr & MI ) const { const MCInstrDesc & MID = MI . getDesc ( ) ;


return ( ( F >> TSF_AddrModeOff ) & TSF_AddModeMask ) == PreInc ;


<s> const MCInstrDesc & MID = MI . getDesc ( ) ; const uint64_t F = MID . TSFlags ; return ( ( F >> TSF_AddrModeOff ) & TSF_AddModeMask ) == PreInc ;


<s> <ISA_LIT>InstrInfo :: <ISA_LIT>InstrInfo ( const <ISA_LIT>Subtarget & ST ) : <ISA_LIT>GenInstrInfo ( <STR_LIT> , <STR_LIT> ) , RI ( ST ) {


<s> assert ( <STR_LIT> . contains ( SrcReg ) && <STR_LIT> ) ; assert ( <STR_LIT> . contains ( DestReg ) && <STR_LIT> ) ; BuildMI ( MBB , I , DL , get ( <STR_LIT> ) , DestReg ) . addReg ( SrcReg , getKillRegState ( KillSrc ) ) ;


<s> void <ISA_LIT>InstrInfo :: copyPhysReg ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator I , const DebugLoc & DL , MCRegister DestReg , MCRegister SrcReg , bool KillSrc ) const { assert ( <STR_LIT> . contains ( SrcReg ) && <STR_LIT> ) ; assert ( <STR_LIT> . contains ( DestReg ) && <STR_LIT> ) ; BuildMI ( MBB , I , DL , get ( <STR_LIT> ) , DestReg ) . addReg ( SrcReg , getKillRegState ( KillSrc ) ) ;


<s> return <NUM_LIT> ; } int BccOpc = Cond [ <NUM_LIT> ] . isImm ( ) ? <STR_LIT> : <STR_LIT> ; MachineInstrBuilder MIB = BuildMI ( & MBB , DL , get ( BccOpc ) ) ; MIB . addMBB ( TBB ) ; for ( unsigned i = <NUM_LIT> ; i < <NUM_LIT> ; i ++ ) { MIB . add ( Cond [ i ] ) ; } if ( ! FBB ) {


<s> if ( isInt < <NUM_LIT> > ( Value ) ) { return BuildMI ( MBB , MI , DL , get ( <STR_LIT> ) , Reg ) . addImm ( Value ) . getInstr ( ) ; }


<s> void <ISA_LIT>InstrInfo :: loadRegFromStackSlot ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator I , Register DestReg , int FrameIndex , const TargetRegisterClass * RC , const TargetRegisterInfo * TRI ) const { DebugLoc DL = MBB . findDebugLoc ( I ) ; MachineFunction & MF = * MBB . getParent ( ) ; MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( MF , FrameIndex ) , MachineMemOperand :: MOLoad , MFI . getObjectSize ( FrameIndex ) , MFI . getObjectAlign ( FrameIndex ) ) ;


<s> assert ( ( Cond . size ( ) == <NUM_LIT> ) && <STR_LIT> ) ; Cond [ <NUM_LIT> ] . setImm ( getOppositeBranchCondition ( ( <STR_LIT> ) Cond [ <NUM_LIT> ] . getImm ( ) ) ) ; return false ;


<s> assert ( <STR_LIT> . hasSubClassEq ( RC ) && <STR_LIT> ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << printReg ( SrcReg , TRI ) << <STR_LIT> << FrameIndex << <STR_LIT> ) ;

BuildMI ( MBB , I , DL , get ( <STR_LIT> ) ) . addReg ( SrcReg , getKillRegState ( IsKill ) ) . addFrameIndex ( FrameIndex ) . addImm ( <NUM_LIT> ) . addMemOperand ( MMO ) ;


<s> assert ( MMO && <STR_LIT> ) ; assert ( TRI -> getSpillSize ( * RC ) == <NUM_LIT> && <STR_LIT> ) ; assert ( <STR_LIT> . hasSubClassEq ( RC ) && <STR_LIT> ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << printReg ( DestReg , TRI ) << <STR_LIT> << FrameIndex << <STR_LIT> ) ;


<s> MachineFunction & MF = * MBB . getParent ( ) ; MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( MF , FrameIndex ) , MachineMemOperand :: MOStore , MFI . getObjectSize ( FrameIndex ) , MFI . getObjectAlign ( FrameIndex ) ) ; assert ( MMO && <STR_LIT> ) ; assert ( TRI -> getSpillSize ( * RC ) == <NUM_LIT> && <STR_LIT> ) ; assert ( <STR_LIT> . hasSubClassEq ( RC ) && <STR_LIT> ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << printReg ( SrcReg , TRI ) << <STR_LIT> << FrameIndex << <STR_LIT> ) ; BuildMI ( MBB , I , dl , get ( <STR_LIT> ) ) . addReg ( SrcReg , getKillRegState ( isKill ) ) . addFrameIndex ( FrameIndex ) . addImm ( <NUM_LIT> ) . addMemOperand ( MMO ) ;


<s> DebugLoc dl = MBB . findDebugLoc ( I ) ; MachineFunction & MF = * MBB . getParent ( ) ; MachineFrameInfo & MFI = MF . getFrameInfo ( ) ;

MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( MF , FrameIndex ) , MachineMemOperand :: MOStore , MFI . getObjectSize ( FrameIndex ) , MFI . getObjectAlign ( FrameIndex ) ) ;


<s> <ISA_LIT>InstrInfo :: <ISA_LIT>InstrInfo ( const <ISA_LIT>Subtarget & ST ) : <ISA_LIT>GenInstrInfo ( <STR_LIT> , <STR_LIT> ) , ST ( ST ) , RI ( ST ) {


<s> } else if ( isCondBranchOpcode ( I -> getOpcode ( ) ) ) { if ( ! Cond . empty ( ) ) return true ; assert ( ! FBB && <STR_LIT> ) ; FBB = TBB ; TBB = I -> getOperand ( <NUM_LIT> ) . getMBB ( ) ; Cond . push_back ( I -> getOperand ( <NUM_LIT> ) ) ; Cond . push_back ( I -> getOperand ( <NUM_LIT> ) ) ; Cond . push_back ( I -> getOperand ( <NUM_LIT> ) ) ; } else if ( I -> isReturn ( ) ) { CantAnalyze = ! isPredicated ( * I ) ; } else { return true ; } if ( ! isPredicated ( * I ) && ( isUncondBranchOpcode ( I -> getOpcode ( ) ) || isJumpOpcode ( I -> getOpcode ( ) ) || I -> isReturn ( ) ) ) { Cond . clear ( ) ; FBB = nullptr ; if ( AllowModify ) { MachineBasicBlock :: iterator DI = std :: next ( I ) ; while ( DI != MBB . end ( ) ) { MachineInstr & InstToDelete = * DI ;


<s> void <ISA_LIT>InstrInfo :: anchor ( ) {


<s> <ISA_LIT>InstrInfo :: <ISA_LIT>InstrInfo ( ) : <ISA_LIT>GenInstrInfo ( <STR_LIT> , <STR_LIT> ) , RI ( ) {


<s> assert ( <STR_LIT> . contains ( SrcReg ) && <STR_LIT> ) ; assert ( <STR_LIT> . contains ( DestReg ) && <STR_LIT> ) ;

BuildMI ( MBB , I , dl , get ( <STR_LIT> ) , DestReg ) . addReg ( SrcReg , getKillRegState ( KillSrc ) ) ;


<s> return getInlineAsmLength ( AsmStr , * MF -> getTarget ( ) . getMCAsmInfo ( ) ) ; } return MI . getDesc ( ) . getSize ( ) ;


<s> const char * AsmStr = MI . getOperand ( <NUM_LIT> ) . getSymbolName ( ) ; return getInlineAsmLength ( AsmStr , * MF -> getTarget ( ) . getMCAsmInfo ( ) ) ; } return MI . getDesc ( ) . getSize ( ) ;


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


<s> const <ISA_LIT>RegisterInfo & getRegisterInfo ( ) const {


<s> assert ( TBB && <STR_LIT> ) ; assert ( ( Cond . size ( ) == <NUM_LIT> || Cond . size ( ) == <NUM_LIT> ) && <STR_LIT> ) ; if ( Cond . empty ( ) ) { BuildMI ( & MBB , dl , get ( <STR_LIT> ) ) . addMBB ( TBB ) ; return <NUM_LIT> ; } int BccOpc = Cond [ <NUM_LIT> ] . isImm ( ) ? <STR_LIT> : <STR_LIT> ; MachineInstrBuilder MIB = BuildMI ( & MBB , dl , get ( BccOpc ) ) ; MIB . addMBB ( TBB ) ; for ( unsigned i = <NUM_LIT> ; i < <NUM_LIT> ; i ++ ) { MIB . add ( Cond [ i ] ) ; } if ( ! FBB ) { return <NUM_LIT> ;


<s> static bool isCondBranchOpcode ( int Opc ) {

return Opc == <STR_LIT> || Opc == <STR_LIT> ;


<s> static bool isJumpOpcode ( int Opc ) {


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


return Opcode == <STR_LIT> || Opcode == <STR_LIT> || Opcode == <STR_LIT> ;


<s> unsigned <ISA_LIT>InstrInfo :: isLoadFromStackSlot ( const MachineInstr & MI , int & FrameIndex ) const { int Opcode = MI . getOpcode ( ) ;


<s> static bool isStore ( int Opcode ) { return Opcode == <STR_LIT> || Opcode == <STR_LIT> || Opcode == <STR_LIT> ;


<s> static bool isUncondBranchOpcode ( int Opc ) { return Opc == <STR_LIT> ;


<s> static bool isZeroImm ( const MachineOperand & Op ) { return Op . isImm ( ) && Op . getImm ( ) == <NUM_LIT> ;


<s> return Op . isImm ( ) && Op . getImm ( ) == <NUM_LIT> ;


<s> return BuildMI ( MBB , MI , dl , get ( <STR_LIT> ) , Reg ) . addImm ( Value ) . getInstr ( ) ; } llvm_unreachable ( <STR_LIT> ) ;


<s> MachineBasicBlock :: iterator <ISA_LIT>InstrInfo :: loadImmediate ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator MI , unsigned Reg , uint64_t Value ) const { DebugLoc dl = MBB . findDebugLoc ( MI ) ;


<s> MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( MF , FrameIndex ) , MachineMemOperand :: MOLoad , MFI . getObjectSize ( FrameIndex ) , Align ) ; assert ( MMO && <STR_LIT> ) ; assert ( TRI -> getSpillSize ( * RC ) == <NUM_LIT> && <STR_LIT> ) ;


<s> bool <ISA_LIT>InstrInfo :: reverseBranchCondition ( SmallVectorImpl < MachineOperand > & Cond ) const { assert ( ( Cond . size ( ) == <NUM_LIT> ) && <STR_LIT> ) ;

Cond [ <NUM_LIT> ] . setImm ( GetOppositeBranchCondition ( ( <STR_LIT> ) Cond [ <NUM_LIT> ] . getImm ( ) ) ) ;


<s> DebugLoc dl = MBB . findDebugLoc ( I ) ; MachineFunction & MF = * MBB . getParent ( ) ; MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; unsigned Align = MFI . getObjectAlignment ( FrameIndex ) ; MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( MF , FrameIndex ) , MachineMemOperand :: MOStore , MFI . getObjectSize ( FrameIndex ) , Align ) ; assert ( MMO && <STR_LIT> ) ; assert ( TRI -> getSpillSize ( * RC ) == <NUM_LIT> && <STR_LIT> ) ; assert ( <STR_LIT> . hasSubClassEq ( RC ) && <STR_LIT> ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << printReg ( SrcReg , TRI ) << <STR_LIT> << FrameIndex << <STR_LIT> ) ; BuildMI ( MBB , I , dl , get ( <STR_LIT> ) ) . addReg ( SrcReg , getKillRegState ( isKill ) ) . addFrameIndex ( FrameIndex ) . addImm ( <NUM_LIT> ) . addMemOperand ( MMO ) ;


<s> <ISA_LIT>DAGToDAGISel ( <ISA_LIT>TargetMachine & TM , CodeGenOpt :: Level OptLevel ) : SelectionDAGISel ( TM , OptLevel ) {


<s> return new <ISA_LIT>DAGToDAGISel ( TM , OptLevel ) ;


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


<s> if ( Addr . getOpcode ( ) == <STR_LIT> ) RHSC = - RHSC ; Base = Addr . getOperand ( <NUM_LIT> ) ;

Offset = CurDAG -> getTargetConstant ( RHSC , SDLoc ( Addr ) , <STR_LIT> ) ;


<s> bool <ISA_LIT>DAGToDAGISel :: SelectAddrModeFar ( SDValue Addr , SDValue & Base , SDValue & Offset ) { if ( SelectAddrModeS9 ( Addr , Base , Offset ) ) return false ; if ( Addr . getOpcode ( ) == <STR_LIT> ) { return false ; } if ( ConstantSDNode * RHS = dyn_cast < ConstantSDNode > ( Addr . getOperand ( <NUM_LIT> ) ) ) { int32_t RHSC = RHS -> getSExtValue ( ) ; if ( Addr . getOpcode ( ) == <STR_LIT> ) RHSC = - RHSC ; Base = Addr . getOperand ( <NUM_LIT> ) ; Offset = CurDAG -> getTargetConstant ( RHSC , SDLoc ( Addr ) , <STR_LIT> ) ; return true ;


<s> if ( Addr . getOpcode ( ) == <STR_LIT> ) {

Base = Addr . getOperand ( <NUM_LIT> ) ;


<s> Offset = CurDAG -> getTargetConstant ( <NUM_LIT> , SDLoc ( Addr ) , <STR_LIT> ) ; return true ; }


<s> return false ; } if ( Addr . getOpcode ( ) != <STR_LIT> && Addr . getOpcode ( ) != <STR_LIT> && ! CurDAG -> isBaseWithConstantOffset ( Addr ) ) { if ( Addr . getOpcode ( ) == <STR_LIT> ) { int FI = cast < FrameIndexSDNode > ( Addr ) -> getIndex ( ) ; Base = CurDAG -> getTargetFrameIndex ( FI , TLI -> getPointerTy ( CurDAG -> getDataLayout ( ) ) ) ; } else { Base = Addr ; } Offset = CurDAG -> getTargetConstant ( <NUM_LIT> , SDLoc ( Addr ) , <STR_LIT> ) ; return true ; } if ( ConstantSDNode * RHS = dyn_cast < ConstantSDNode > ( Addr . getOperand ( <NUM_LIT> ) ) ) { int32_t RHSC = RHS -> getSExtValue ( ) ; if ( Addr . getOpcode ( ) == <STR_LIT> ) RHSC = - RHSC ;

if ( ! isInt < <NUM_LIT> > ( RHSC ) ) return false ;


<s> } if ( ConstantSDNode * RHS = dyn_cast < ConstantSDNode > ( Addr . getOperand ( <NUM_LIT> ) ) ) { int32_t RHSC = RHS -> getSExtValue ( ) ; if ( Addr . getOpcode ( ) == <STR_LIT> ) RHSC = - RHSC ; if ( ! isInt < <NUM_LIT> > ( RHSC ) ) return false ; Base = Addr . getOperand ( <NUM_LIT> ) ; if ( Base . getOpcode ( ) == <STR_LIT> ) { int FI = cast < FrameIndexSDNode > ( Base ) -> getIndex ( ) ; Base = CurDAG -> getTargetFrameIndex ( FI , TLI -> getPointerTy ( CurDAG -> getDataLayout ( ) ) ) ; } Offset = CurDAG -> getTargetConstant ( RHSC , SDLoc ( Addr ) , <STR_LIT> ) ;


<s> Pred = CurDAG -> getTargetConstant ( CN -> getZExtValue ( ) , SDLoc ( N ) , <STR_LIT> ) ;

Reg = CurDAG -> getRegister ( <STR_LIT> , <STR_LIT> ) ;


<s> Pred = CurDAG -> getTargetConstant ( CN -> getZExtValue ( ) , SDLoc ( N ) , <STR_LIT> ) ; Reg = CurDAG -> getRegister ( <STR_LIT> , <STR_LIT> ) ; return true ;


<s> return true ; } if ( Addr . getOpcode ( ) == <STR_LIT> ) { ConstantSDNode * CN = nullptr ; if ( ( FIN = dyn_cast < FrameIndexSDNode > ( Addr . getOperand ( <NUM_LIT> ) ) ) && ( CN = dyn_cast < ConstantSDNode > ( Addr . getOperand ( <NUM_LIT> ) ) ) && ( CN -> getSExtValue ( ) % <NUM_LIT> == <NUM_LIT> && CN -> getSExtValue ( ) >= <NUM_LIT> ) ) { Base = CurDAG -> getTargetFrameIndex ( FIN -> getIndex ( ) , <STR_LIT> ) ; Offset = CurDAG -> getTargetConstant ( CN -> getSExtValue ( ) , SDLoc ( Addr ) , <STR_LIT> ) ;


<s> ConstantSDNode * CN = nullptr ; if ( ( FIN = dyn_cast < FrameIndexSDNode > ( Addr . getOperand ( <NUM_LIT> ) ) ) && ( CN = dyn_cast < ConstantSDNode > ( Addr . getOperand ( <NUM_LIT> ) ) ) && ( CN -> getSExtValue ( ) % <NUM_LIT> == <NUM_LIT> && CN -> getSExtValue ( ) >= <NUM_LIT> ) ) { Base = CurDAG -> getTargetFrameIndex ( FIN -> getIndex ( ) , <STR_LIT> ) ; Offset = CurDAG -> getTargetConstant ( CN -> getSExtValue ( ) , SDLoc ( Addr ) , <STR_LIT> ) ; return true ; } }


<s> DEBUG ( errs ( ) << <STR_LIT> << ( unsigned ) RegVT . getSimpleVT ( ) . SimpleTy << <STR_LIT> ) ; llvm_unreachable ( <STR_LIT> ) ; } case <STR_LIT> : unsigned VReg = RegInfo . createVirtualRegister ( & <STR_LIT> ) ; RegInfo . addLiveIn ( VA . getLocReg ( ) , VReg ) ; ArgIn = DAG . getCopyFromReg ( Chain , dl , VReg , RegVT ) ; CFRegNode . push_back ( ArgIn . getValue ( ArgIn -> getNumValues ( ) - <NUM_LIT> ) ) ; } } else { assert ( VA . isMemLoc ( ) ) ; unsigned ObjSize = VA . getLocVT ( ) . getStoreSize ( ) ; assert ( ( ObjSize <= StackSlotSize ) && <STR_LIT> ) ; int FI = MFI . CreateFixedObject ( ObjSize , VA . getLocMemOffset ( ) , true ) ; SDValue FIN = DAG . getFrameIndex ( FI , <STR_LIT> ) ; ArgIn = DAG . getLoad ( VA . getLocVT ( ) , dl , Chain , FIN , MachinePointerInfo :: getFixedStack ( MF , FI ) ) ; } const ArgDataPair ADP = { ArgIn , Ins [ i ] . Flags } ; ArgData . push_back ( ADP ) ; } if ( IsVarArg ) { static const MCPhysReg ArgRegs [ ] = { <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> } ; auto * AFI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; unsigned FirstVAReg = CCInfo . getFirstUnallocated ( ArgRegs ) ; if ( FirstVAReg < array_lengthof ( ArgRegs ) ) { int Offset = <NUM_LIT> ; int VarFI = MFI . CreateFixedObject ( ( array_lengthof ( ArgRegs ) - FirstVAReg ) * <NUM_LIT> , CCInfo . getNextStackOffset ( ) , true ) ; AFI -> setVarArgsFrameIndex ( VarFI ) ; SDValue FIN = DAG . getFrameIndex ( VarFI , <STR_LIT> ) ; for ( unsigned i = FirstVAReg ; i < array_lengthof ( ArgRegs ) ; i ++ ) { unsigned VReg = RegInfo . createVirtualRegister ( & <STR_LIT> ) ;

RegInfo . addLiveIn ( ArgRegs [ i ] , VReg ) ;


<s> assert ( cast < ConstantSDNode > ( Op . getOperand ( <NUM_LIT> ) ) -> getZExtValue ( ) == <NUM_LIT> && <STR_LIT> ) ; Register FrameReg = ARI . getFrameRegister ( MF ) ; return DAG . getCopyFromReg ( DAG . getEntryNode ( ) , dl , FrameReg , VT ) ;


<s> const <ISA_LIT>RegisterInfo & ARI = * Subtarget . getRegisterInfo ( ) ; MachineFunction & MF = DAG . getMachineFunction ( ) ; MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; MFI . setFrameAddressIsTaken ( true ) ; EVT VT = Op . getValueType ( ) ; SDLoc dl ( Op ) ; assert ( cast < ConstantSDNode > ( Op . getOperand ( <NUM_LIT> ) ) -> getZExtValue ( ) == <NUM_LIT> && <STR_LIT> ) ; Register FrameReg = ARI . getFrameRegister ( MF ) ; return DAG . getCopyFromReg ( DAG . getEntryNode ( ) , dl , FrameReg , VT ) ;


<s> assert ( VA . isMemLoc ( ) ) ; unsigned ObjSize = VA . getLocVT ( ) . getStoreSize ( ) ; assert ( ( ObjSize <= StackSlotSize ) && <STR_LIT> ) ; int FI = MFI . CreateFixedObject ( ObjSize , VA . getLocMemOffset ( ) , true ) ; SDValue FIN = DAG . getFrameIndex ( FI , <STR_LIT> ) ; ArgIn = DAG . getLoad ( VA . getLocVT ( ) , dl , Chain , FIN , MachinePointerInfo :: getFixedStack ( MF , FI ) ) ; } const ArgDataPair ADP = { ArgIn , Ins [ i ] . Flags } ; ArgData . push_back ( ADP ) ; } if ( IsVarArg ) { static const MCPhysReg ArgRegs [ ] = { <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> } ; auto * AFI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; unsigned FirstVAReg = CCInfo . getFirstUnallocated ( ArgRegs ) ; if ( FirstVAReg < array_lengthof ( ArgRegs ) ) { int Offset = <NUM_LIT> ; int VarFI = MFI . CreateFixedObject ( ( array_lengthof ( ArgRegs ) - FirstVAReg ) * <NUM_LIT> , CCInfo . getNextStackOffset ( ) , true ) ; AFI -> setVarArgsFrameIndex ( VarFI ) ; SDValue FIN = DAG . getFrameIndex ( VarFI , <STR_LIT> ) ; for ( unsigned i = FirstVAReg ; i < array_lengthof ( ArgRegs ) ; i ++ ) { unsigned VReg = RegInfo . createVirtualRegister ( & <STR_LIT> ) ; RegInfo . addLiveIn ( ArgRegs [ i ] , VReg ) ; SDValue Val = DAG . getCopyFromReg ( Chain , dl , VReg , <STR_LIT> ) ; CFRegNode . push_back ( Val . getValue ( Val -> getNumValues ( ) - <NUM_LIT> ) ) ; SDValue VAObj = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , FIN , DAG . getConstant ( Offset , dl , <STR_LIT> ) ) ; SDValue Store = DAG . getStore ( Val . getValue ( <NUM_LIT> ) , dl , Val , VAObj , MachinePointerInfo ( ) ) ; MemOps . push_back ( Store ) ; Offset += <NUM_LIT> ; } } else { llvm_unreachable ( <STR_LIT> ) ; } } if ( ! CFRegNode . empty ( ) ) Chain = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , CFRegNode ) ; for ( const auto & ArgDI : ArgData ) { if ( ArgDI . Flags . isByVal ( ) && ArgDI . Flags . getByValSize ( ) ) {

unsigned Size = ArgDI . Flags . getByValSize ( ) ;


<s> switch ( Op . getOpcode ( ) ) { case <STR_LIT> : return LowerGlobalAddress ( Op , DAG ) ; case <STR_LIT> : return LowerFRAMEADDR ( Op , DAG ) ; case <STR_LIT> : return LowerSELECT_CC ( Op , DAG ) ; case <STR_LIT> :


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; LLVM_DEBUG ( N -> dump ( & DAG ) ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << N -> use_size ( ) << <STR_LIT> ) ; switch ( N -> getOpcode ( ) ) { case <STR_LIT> : if ( N -> getValueType ( <NUM_LIT> ) == <STR_LIT> ) { SDValue V = DAG . getNode ( <STR_LIT> , SDLoc ( N ) , DAG . getVTList ( <STR_LIT> , <STR_LIT> ) , N -> getOperand ( <NUM_LIT> ) ) ; SDValue Op = DAG . getNode ( <STR_LIT> , SDLoc ( N ) , <STR_LIT> , V ) ; Results . push_back ( Op ) ; Results . push_back ( V . getValue ( <NUM_LIT> ) ) ; } break ; default : break ; }


<s> setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Custom ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Custom ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Custom ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Custom ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Custom ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Custom ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ;


<s> setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Custom ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Custom ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ;


<s> setBooleanContents ( ZeroOrOneBooleanContent ) ; setBooleanVectorContents ( ZeroOrOneBooleanContent ) ; for ( unsigned Opc = <NUM_LIT> ; Opc < <STR_LIT> ; ++ Opc ) setOperationAction ( Opc , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ;

setOperationAction ( <STR_LIT> , <STR_LIT> , Custom ) ;


<s> computeRegisterProperties ( Subtarget . getRegisterInfo ( ) ) ; setStackPointerRegisterToSaveRestore ( <STR_LIT> ) ; setSchedulingPreference ( Sched :: Source ) ; setBooleanContents ( ZeroOrOneBooleanContent ) ; setBooleanVectorContents ( ZeroOrOneBooleanContent ) ; for ( unsigned Opc = <NUM_LIT> ; Opc < <STR_LIT> ; ++ Opc ) setOperationAction ( Opc , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Legal ) ;


<s> bool <ISA_LIT>TargetLowering :: CanLowerReturn ( CallingConv :: ID CallConv , MachineFunction & MF , bool IsVarArg , const SmallVectorImpl < <STR_LIT> > & Outs , LLVMContext & Context ) const { SmallVector < CCValAssign , <NUM_LIT> > RVLocs ; CCState CCInfo ( CallConv , IsVarArg , MF , RVLocs , Context ) ;

if ( ! CCInfo . CheckReturn ( Outs , RetCC_<ISA_LIT> ) ) return false ;


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


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


<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> ; default : llvm_unreachable ( <STR_LIT> ) ; }


<s> bool <ISA_LIT>TargetLowering :: isLegalAddressingMode ( const DataLayout & DL , const AddrMode & AM , Type * Ty , unsigned AS , Instruction * I ) const {


<s> SDValue Chain = Op . getOperand ( <NUM_LIT> ) ; <STR_LIT> CC = cast < CondCodeSDNode > ( Op . getOperand ( <NUM_LIT> ) ) -> get ( ) ; SDValue LHS = Op . getOperand ( <NUM_LIT> ) ; SDValue RHS = Op . getOperand ( <NUM_LIT> ) ; SDValue Dest = Op . getOperand ( <NUM_LIT> ) ; SDLoc dl ( Op ) ; <STR_LIT> arcCC = ISDCCto<ISA_LIT>CC ( CC ) ; assert ( LHS . getValueType ( ) == <STR_LIT> && <STR_LIT> ) ; return DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , Chain , Dest , LHS , RHS , DAG . getConstant ( arcCC , dl , <STR_LIT> ) ) ;


<s> SDValue PtrOff = DAG . getNode ( <STR_LIT> , dl , getPointerTy ( DAG . getDataLayout ( ) ) , StackPtr , SOffset ) ; SDValue Store = DAG . getStore ( Chain , dl , Arg , PtrOff , MachinePointerInfo ( ) ) ; MemOpChains . push_back ( Store ) ; IsTailCall = false ; } } if ( ! MemOpChains . empty ( ) ) Chain = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , MemOpChains ) ; SDValue Glue ; for ( unsigned i = <NUM_LIT> , e = RegsToPass . size ( ) ; i != e ; ++ i ) { Chain = DAG . getCopyToReg ( Chain , dl , RegsToPass [ i ] . first , RegsToPass [ i ] . second , Glue ) ; Glue = Chain . getValue ( <NUM_LIT> ) ; } bool IsDirect = true ; if ( auto * G = dyn_cast < GlobalAddressSDNode > ( Callee ) ) Callee = DAG . getTargetGlobalAddress ( G -> getGlobal ( ) , dl , <STR_LIT> ) ; else if ( auto * E = dyn_cast < ExternalSymbolSDNode > ( Callee ) ) Callee = DAG . getTargetExternalSymbol ( E -> getSymbol ( ) , <STR_LIT> ) ; else IsDirect = false ; SDVTList NodeTys = DAG . getVTList ( <STR_LIT> , <STR_LIT> ) ; SmallVector < SDValue , <NUM_LIT> > Ops ; Ops . push_back ( Chain ) ; Ops . push_back ( Callee ) ;

for ( unsigned i = <NUM_LIT> , e = RegsToPass . size ( ) ; i != e ; ++ i ) Ops . push_back ( DAG . getRegister ( RegsToPass [ i ] . first , RegsToPass [ i ] . second . getValueType ( ) ) ) ;


<s> llvm_unreachable ( <STR_LIT> ) ; case CallingConv :: C : case CallingConv :: Fast : return LowerCallArguments ( Chain , CallConv , IsVarArg , Ins , dl , DAG , InVals ) ; }


<s> MFI . setFrameAddressIsTaken ( true ) ; EVT VT = Op . getValueType ( ) ; SDLoc dl ( Op ) ; assert ( cast < ConstantSDNode > ( Op . getOperand ( <NUM_LIT> ) ) -> getZExtValue ( ) == <NUM_LIT> && <STR_LIT> ) ; unsigned FrameReg = ARI . getFrameRegister ( MF ) ; return DAG . getCopyFromReg ( DAG . getEntryNode ( ) , dl , FrameReg , VT ) ;


<s> const <ISA_LIT>RegisterInfo & ARI = * Subtarget . getRegisterInfo ( ) ; MachineFunction & MF = DAG . getMachineFunction ( ) ; MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; MFI . setFrameAddressIsTaken ( true ) ;


<s> const GlobalValue * GV = GN -> getGlobal ( ) ; SDLoc dl ( GN ) ; int64_t Offset = GN -> getOffset ( ) ; SDValue GA = DAG . getTargetGlobalAddress ( GV , dl , <STR_LIT> , Offset ) ; return DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , GA ) ;


<s> int64_t Offset = GN -> getOffset ( ) ; SDValue GA = DAG . getTargetGlobalAddress ( GV , dl , <STR_LIT> , Offset ) ;

return DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , GA ) ;


<s> auto * N = cast < JumpTableSDNode > ( Op ) ; SDValue GA = DAG . getTargetJumpTable ( N -> getIndex ( ) , <STR_LIT> ) ; return DAG . getNode ( <STR_LIT> , SDLoc ( N ) , <STR_LIT> , GA ) ;


<s> switch ( Op . getOpcode ( ) ) { case <STR_LIT> : return LowerGlobalAddress ( Op , DAG ) ; case <STR_LIT> : return LowerFRAMEADDR ( Op , DAG ) ; case <STR_LIT> : return LowerSELECT_CC ( Op , DAG ) ; case <STR_LIT> :


<s> CCValAssign & VA = RVLocs [ i ] ; if ( VA . isRegLoc ( ) ) continue ; assert ( VA . isMemLoc ( ) ) ; if ( IsVarArg ) { report_fatal_error ( <STR_LIT> ) ; } int Offset = VA . getLocMemOffset ( ) ; unsigned ObjSize = VA . getLocVT ( ) . getStoreSize ( ) ; int FI = MFI . CreateFixedObject ( ObjSize , Offset , false ) ; SDValue FIN = DAG . getFrameIndex ( FI , <STR_LIT> ) ; MemOpChains . push_back ( DAG . getStore ( Chain , dl , OutVals [ i ] , FIN , MachinePointerInfo :: getFixedStack ( DAG . getMachineFunction ( ) , FI ) ) ) ; }

if ( ! MemOpChains . empty ( ) ) Chain = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , MemOpChains ) ;