ground_truth: <s> void KudeyarAsmPrinter :: emitFrameDirective ( ) { const TargetRegisterInfo & RI = * TM . getRegisterInfo ( ) ; unsigned stackReg = RI . getFrameRegister ( * MF ) ; unsigned returnReg = RI . getRARegister ( ) ; unsigned stackSize = MF -> getFrameInfo ( ) -> getStackSize ( ) ; if ( OutStreamer . hasRawTextSupport ( ) ) OutStreamer . EmitRawText ( "\t.frame\t$" + StringRef ( KudeyarInstPrinter :: getRegisterName ( stackReg ) ) . lower ( ) + "," + Twine ( stackSize ) ) ; } </s>

natrual_language: Frame Directive .

TS_V_token: Kudeyar Kudeyar "\t.frame\t$" Kudeyar ","

File: KudeyarAsmPrinter

Func: emitFrameDirective

Target: Kudeyar

Target_Clf: CPU

Compiler_Type: LLVM


ground_truth: <s> void KudeyarAsmPrinter :: EmitInstruction ( const MachineInstr * MI ) { if ( MI -> isDebugValue ( ) ) { SmallString < 128 > Str ; raw_svector_ostream OS ( Str ) ; PrintDebugValueComment ( MI , OS ) ; return ; } MCInst TmpInst0 ; MCInstLowering . Lower ( MI , TmpInst0 ) ; OutStreamer . EmitInstruction ( TmpInst0 ) ; } </s>

natrual_language: EmitInstruction - This callback is invoked when an instruction is emitted , to advance the hazard state .

TS_V_token: Kudeyar Kudeyar 128

Func: EmitInstruction


ground_truth: <s> const char * KudeyarAsmPrinter :: getCurrentABIString ( ) const { { } return "abi32" ; } </s>

natrual_language: Emit Set directives .

TS_V_token: Kudeyar Kudeyar "abi32"

Func: getCurrentABIString


ground_truth:
<s>
virtual
const
char
*
getPassName
(
)
const
{
return
"Kudeyar Assembly Printer"
;
}
</s>

natrual_language: getPassName - Return a nice clean name for a pass .

TS_V_token:
Kudeyar
"Kudeyar Assembly Printer"

Func: getPassName


ground_truth: <s> bool KudeyarAsmPrinter :: runOnMachineFunction ( MachineFunction & MF ) { KudeyarFI = MF . getInfo < KudeyarMachineFunctionInfo > ( ) ; AsmPrinter :: runOnMachineFunction ( MF ) ; return true ; } </s>

natrual_language: runOnMachineFunction - Emit the function body .

TS_V_token: Kudeyar Kudeyar Kudeyar Kudeyar

Func: runOnMachineFunction


ground_truth: "Can only insert epilog into returning blocks"

natrual_language: Insert epilog code into the function .

File: KudeyarFrameLowering

Func: emitEpilogue


ground_truth: <s> void KudeyarFrameLowering :: emitPrologue ( MachineFunction & MF ) const { MachineBasicBlock & MBB = MF . front ( ) ; MachineFrameInfo * MFI = MF . getFrameInfo ( ) ; KudeyarMachineFunctionInfo * KudeyarFI = MF . getInfo < KudeyarMachineFunctionInfo > ( ) ; const KudeyarInstrInfo & TII = * static_cast < const KudeyarInstrInfo * > ( MF . getTarget ( ) . getInstrInfo ( ) ) ; MachineBasicBlock :: iterator MBBI = MBB . begin ( ) ; DebugLoc DL = MBBI != MBB . end ( ) ? MBBI -> getDebugLoc ( ) : DebugLoc ( ) ; uint64_t StackSize = MFI -> getStackSize ( ) ; uint64_t NumBytes = 0 ; if ( hasFP ( MF ) ) { uint64_t FrameSize = StackSize - 4 ; NumBytes = FrameSize - KudeyarFI -> getCalleeSavedFrameSize ( ) ; MFI -> setOffsetAdjustment ( - NumBytes ) ; BuildMI ( MBB , MBBI , DL , TII . get ( Kudeyar :: PUSH_R ) ) . addReg ( Kudeyar :: FP , RegState :: Kill ) ; BuildMI ( MBB , MBBI , DL , TII . get ( Kudeyar :: MOV_RR ) , Kudeyar :: FP ) . addReg ( Kudeyar :: SP ) ; for ( MachineFunction :: iterator I = llvm :: next ( MF . begin ( ) ) , E = MF . end ( ) ; I != E ; ++ I ) I -> addLiveIn ( Kudeyar :: FP ) ; } else NumBytes = StackSize - KudeyarFI -> getCalleeSavedFrameSize ( ) ; while ( MBBI != MBB . end ( ) && ( MBBI -> getOpcode ( ) == Kudeyar :: PUSH_R ) ) ++ MBBI ; if ( MBBI != MBB . end ( ) ) DL = MBBI -> getDebugLoc ( ) ; if ( NumBytes ) { if ( NumBytes ) { MachineInstr * MI = BuildMI ( MBB , MBBI , DL , TII . get ( Kudeyar :: SUB_RI32 ) , Kudeyar :: SP ) . addReg ( Kudeyar :: SP ) . addImm ( NumBytes ) ; } } } </s>

natrual_language: emitProlog/emitEpilog - These methods insert prolog and epilog code into the function .

TS_V_token: Kudeyar Kudeyar Kudeyar Kudeyar Kudeyar Kudeyar Kudeyar 0 4 Kudeyar Kudeyar::PUSH_R Kudeyar::FP Kudeyar::MOV_RR Kudeyar::FP Kudeyar::SP Kudeyar::FP Kudeyar Kudeyar::PUSH_R Kudeyar::SUB_RI32 Kudeyar::SP Kudeyar::SP

Func: emitPrologue


ground_truth: <s> bool KudeyarFrameLowering :: hasFP ( const MachineFunction & MF ) const { const MachineFrameInfo * MFI = MF . getFrameInfo ( ) ; return ( MF . getTarget ( ) . Options . DisableFramePointerElim ( MF ) || MF . getFrameInfo ( ) -> hasVarSizedObjects ( ) || MFI -> isFrameAddressTaken ( ) ) ; } </s>

natrual_language: hasFP - Return true if the specified function should have a dedicated frame pointer register .

TS_V_token: Kudeyar Kudeyar

Func: hasFP


ground_truth: <s> bool KudeyarFrameLowering :: hasReservedCallFrame ( const MachineFunction & MF ) const { return ! MF . getFrameInfo ( ) -> hasVarSizedObjects ( ) ; } </s>

natrual_language: hasReservedCallFrame - Under normal circumstances , when a frame pointer is not required , we reserve argument space for call sites in the function immediately on entry to the current function .

Func: hasReservedCallFrame


ground_truth: "Slot for FP register must be last in order to be found!"

natrual_language: processFunctionBeforeFrameFinalized - This method is called immediately before the specified function 's frame layout ( MF.getFrameInfo ( ) ) is finalized .

Func: processFunctionBeforeFrameFinalized


ground_truth: <s> bool KudeyarFrameLowering :: restoreCalleeSavedRegisters ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator MI , const std :: vector < CalleeSavedInfo > & CSI , const TargetRegisterInfo * TRI ) const { if ( CSI . empty ( ) ) return false ; DebugLoc DL ; if ( MI != MBB . end ( ) ) DL = MI -> getDebugLoc ( ) ; MachineFunction & MF = * MBB . getParent ( ) ; const TargetInstrInfo & TII = * MF . getTarget ( ) . getInstrInfo ( ) ; if ( CSI . size ( ) > 1 ) { MachineInstrBuilder MIB = BuildMI ( MBB , MI , DL , TII . get ( Kudeyar :: POPA ) ) ; for ( unsigned i = CSI . size ( ) ; i != 0 ; -- i ) { unsigned Reg = CSI [ i - 1 ] . getReg ( ) ; MIB . addReg ( Reg , getDefRegState ( true ) ) ; } } else { unsigned Reg = CSI [ 0 ] . getReg ( ) ; BuildMI ( MBB , MI , DL , TII . get ( Kudeyar :: POP_R ) , Reg ) ; } for ( unsigned i = 0 , e = CSI . size ( ) ; i != e ; ++ i ) BuildMI ( MBB , MI , DL , TII . get ( Kudeyar :: POP_R ) , CSI [ i ] . getReg ( ) ) ; return true ; } </s>

natrual_language: restoreCalleeSavedRegisters - Issues instruction ( s ) to restore all callee saved registers and returns true if it is n't possible / profitable to do so by issuing a series of load instructions via loadRegToStackSlot ( ) .

Func: restoreCalleeSavedRegisters


ground_truth: <s> bool KudeyarFrameLowering :: spillCalleeSavedRegisters ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator MI , const std :: vector < CalleeSavedInfo > & CSI , const TargetRegisterInfo * TRI ) const { if ( CSI . empty ( ) ) return false ; DebugLoc DL ; if ( MI != MBB . end ( ) ) DL = MI -> getDebugLoc ( ) ; MachineFunction & MF = * MBB . getParent ( ) ; const TargetInstrInfo & TII = * MF . getTarget ( ) . getInstrInfo ( ) ; KudeyarMachineFunctionInfo * MFI = MF . getInfo < KudeyarMachineFunctionInfo > ( ) ; MFI -> setCalleeSavedFrameSize ( CSI . size ( ) * 4 ) ; if ( CSI . size ( ) > 1 ) { MachineInstrBuilder MIB = BuildMI ( MBB , MI , DL , TII . get ( Kudeyar :: PUSHA ) ) ; for ( unsigned i = CSI . size ( ) ; i != 0 ; -- i ) { unsigned Reg = CSI [ i - 1 ] . getReg ( ) ; bool isKill = true ; if ( isKill ) MBB . addLiveIn ( Reg ) ; MIB . addReg ( Reg , getKillRegState ( isKill ) ) ; } MIB . setMIFlags ( MachineInstr :: FrameSetup ) ; } else { unsigned Reg = CSI [ 0 ] . getReg ( ) ; MBB . addLiveIn ( Reg ) ; BuildMI ( MBB , MI , DL , TII . get ( Kudeyar :: PUSH_R ) ) . addReg ( Reg , RegState :: Kill ) ; } for ( unsigned i = CSI . size ( ) ; i != 0 ; -- i ) { unsigned Reg = CSI [ i - 1 ] . getReg ( ) ; MBB . addLiveIn ( Reg ) ; BuildMI ( MBB , MI , DL , TII . get ( Kudeyar :: PUSH_R ) ) . addReg ( Reg , RegState :: Kill ) ; } return true ; } </s>

natrual_language: spillCalleeSavedRegisters - Issues instruction ( s ) to spill all callee saved registers and returns true if it is n't possible / profitable to do so by issuing a series of store instructions via storeRegToStackSlot ( ) .

Func: spillCalleeSavedRegisters


ground_truth: <s> void KudeyarInstPrinter :: printInst ( const MCInst * MI , raw_ostream & O , StringRef Annot ) { printInstruction ( MI , O ) ; printAnnotation ( O , Annot ) ; } </s>

natrual_language: Print the specified MCInst to the specified raw_ostream .

File: KudeyarInstPrinter

Func: printInst


ground_truth: <s> void KudeyarInstPrinter :: printRegName ( raw_ostream & OS , unsigned RegNo ) const { OS << markup ( "<reg:" ) << getRegisterName ( RegNo ) << markup ( ">" ) ; } </s>

natrual_language: Print the assembler register name .

TS_V_token: Kudeyar Kudeyar "<reg:" ">"

Func: printRegName


ground_truth: <s> void KudeyarInstrInfo :: copyPhysReg ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator I , DebugLoc DL , unsigned DestReg , unsigned SrcReg , bool KillSrc ) const { unsigned Opc ; Opc = Kudeyar :: MOV_RR ; BuildMI ( MBB , I , DL , get ( Opc ) , DestReg ) . addReg ( SrcReg , getKillRegState ( KillSrc ) ) ; } </s>

natrual_language: } Branch Analysis & Modification

TS_V_token: Kudeyar Kudeyar Kudeyar::MOV_RR

File: KudeyarInstrInfo

Func: copyPhysReg


ground_truth: <s> const KudeyarRegisterInfo & KudeyarInstrInfo :: getRegisterInfo ( ) const { return RI ; } </s>

natrual_language: getRegisterInfo - TargetInstrInfo is a superset of MRegister info .

TS_V_token: Kudeyar Kudeyar Kudeyar

Func: getRegisterInfo


ground_truth: <s> void KudeyarInstrInfo :: loadRegFromStackSlot ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator MI , unsigned DestReg , int FrameIdx , const TargetRegisterClass * RC , const TargetRegisterInfo * TRI ) const { DebugLoc DL ; if ( MI != MBB . end ( ) ) DL = MI -> getDebugLoc ( ) ; MachineFunction & MF = * MBB . getParent ( ) ; MachineFrameInfo & MFI = * MF . getFrameInfo ( ) ; MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( FrameIdx ) , MachineMemOperand :: MOLoad , MFI . getObjectSize ( FrameIdx ) , MFI . getObjectAlignment ( FrameIdx ) ) ; BuildMI ( MBB , MI , DL , get ( Kudeyar :: MOV_RM32 ) ) . addReg ( DestReg ) . addFrameIndex ( FrameIdx ) . addImm ( 0 ) . addMemOperand ( MMO ) ; } </s>

natrual_language: Load the specified register of the given register class from the specified stack frame index .

Func: loadRegFromStackSlot


ground_truth: <s> void KudeyarInstrInfo :: storeRegToStackSlot ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator MI , unsigned SrcReg , bool isKill , int FrameIdx , const TargetRegisterClass * RC , const TargetRegisterInfo * TRI ) const { DebugLoc DL ; if ( MI != MBB . end ( ) ) DL = MI -> getDebugLoc ( ) ; MachineFunction & MF = * MBB . getParent ( ) ; MachineFrameInfo & MFI = * MF . getFrameInfo ( ) ; MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( FrameIdx ) , MachineMemOperand :: MOStore , MFI . getObjectSize ( FrameIdx ) , MFI . getObjectAlignment ( FrameIdx ) ) ; BuildMI ( MBB , MI , DL , get ( Kudeyar :: MOV_MR32 ) ) . addFrameIndex ( FrameIdx ) . addImm ( 0 ) . addReg ( SrcReg , getKillRegState ( isKill ) ) . addMemOperand ( MMO ) ; } </s>

natrual_language: Store the specified register of the given register class to the specified stack frame index .

Func: storeRegToStackSlot


ground_truth:
<s>
void
dump
(
)
{
errs
(
)
<<
"KudeyarISelAddressMode "
<<
this
<<
'\n'
;
if
(
BaseType
==
RegBase
&&
Base
.
Reg
.
getNode
(
)
!=
0
)
{
errs
(
)
<<
"Base.Reg "
;
Base
.
Reg
.
getNode
(
)
->
dump
(
)
;
}
else
if
(
BaseType
==
FrameIndexBase
)
{
errs
(
)
<<
" Base.FrameIndex "
<<
Base
.
FrameIndex
<<
'\n'
;
}
errs
(
)
<<
" Disp "
<<
Disp
<<
'\n'
;
if
(
GV
)
{
errs
(
)
<<
"GV "
;
GV
->
dump
(
)
;
}
else
if
(
CP
)
{
errs
(
)
<<
" CP "
;
CP
->
dump
(
)
;
errs
(
)
<<
" Align"
<<
Align
<<
'\n'
;
}
else
if
(
ES
)
{
errs
(
)
<<
"ES "
;
errs
(
)
<<
ES
<<
'\n'
;
}
else
if
(
JT
!=
1
)
errs
(
)
<<
" JT"
<<
JT
<<
" Align"
<<
Align
<<
'\n'
;
}
</s>

natrual_language: Dump the plan to stderr ( for debugging ) .

TS_V_token:
Kudeyar
"KudeyarISelAddressMode "
0
"Base.Reg "
" Base.FrameIndex "
" Disp "
"GV "
" CP "
" Align"
"ES "
1
" JT"
" Align"

File: KudeyarISelDAGToDAG

Func: dump


ground_truth: <s> const KudeyarInstrInfo * getInstrInfo ( ) { return getTargetMachine ( ) . getInstrInfo ( ) ; } </s>

natrual_language: TargetInstrInfo getter .

Func: getInstrInfo


ground_truth: "Kudeyar DAG->DAG Pattern Instruction Selection"

natrual_language: getPassName - Return a nice clean name for a pass .

Func: getPassName


ground_truth: <s> const KudeyarTargetMachine & getTargetMachine ( ) { return static_cast < const KudeyarTargetMachine & > ( TM ) ; } </s>

natrual_language: Return the target machine ( if available ) .

Func: getTargetMachine


ground_truth: <s> bool KudeyarDAGToDAGISel :: runOnMachineFunction ( MachineFunction & MF ) { bool Ret = SelectionDAGISel :: runOnMachineFunction ( MF ) ; return Ret ; } </s>

natrual_language: runOnMachineFunction - Emit the function body .

Func: runOnMachineFunction


ground_truth:
<s>
MachineBasicBlock
*
KudeyarTargetLowering
::
EmitInstrWithCustomInserter
(
MachineInstr
*
MI
,
MachineBasicBlock
*
BB
)
const
{
unsigned
Opc
=
MI
->
getOpcode
(
)
;
const
TargetInstrInfo
&
TII
=
*
getTargetMachine
(
)
.
getInstrInfo
(
)
;
DebugLoc
dl
=
MI
->
getDebugLoc
(
)
;
assert
(
(
Opc
==
Kudeyar
::
Select32T
||
Opc
==
Kudeyar
::
Select32F
)
&&
"Unexpected instr type to insert"
)
;
const
BasicBlock
*
LLVM_BB
=
BB
->
getBasicBlock
(
)
;
MachineFunction
::
iterator
I
=
BB
;
++
I
;
MachineBasicBlock
*
thisMBB
=
BB
;
MachineFunction
*
F
=
BB
->
getParent
(
)
;
MachineBasicBlock
*
copy0MBB
=
F
->
CreateMachineBasicBlock
(
LLVM_BB
)
;
MachineBasicBlock
*
copy1MBB
=
F
->
CreateMachineBasicBlock
(
LLVM_BB
)
;
F
->
insert
(
I
,
copy0MBB
)
;
F
->
insert
(
I
,
copy1MBB
)
;
copy1MBB
->
splice
(
copy1MBB
->
begin
(
)
,
BB
,
llvm
::
next
(
MachineBasicBlock
::
iterator
(
MI
)
)
,
BB
->
end
(
)
)
;
copy1MBB
->
transferSuccessorsAndUpdatePHIs
(
BB
)
;
BB
->
addSuccessor
(
copy0MBB
)
;
BB
->
addSuccessor
(
copy1MBB
)
;
int
br_code
;
switch
(
Opc
)
{
case
Kudeyar
::
Select32T
:
br_code
=
Kudeyar
::
BTs
;
break
;
case
Kudeyar
::
Select32F
:
br_code
=
Kudeyar
::
BFs
;
break
;
default
:
br_code
=
0
;
}
BuildMI
(
BB
,
dl
,
TII
.
get
(
br_code
)
)
.
addMBB
(
copy1MBB
)
;
BB
=
copy0MBB
;
BB
->
addSuccessor
(
copy1MBB
)
;
BB
=
copy1MBB
;
BuildMI
(
*
BB
,
BB
->
begin
(
)
,
dl
,
TII
.
get
(
Kudeyar
::
PHI
)
,
MI
->
getOperand
(
0
)
.
getReg
(
)
)
.
addReg
(
MI
->
getOperand
(
2
)
.
getReg
(
)
)
.
addMBB
(
copy0MBB
)
.
addReg
(
MI
->
getOperand
(
1
)
.
getReg
(
)
)
.
addMBB
(
thisMBB
)
;
MI
->
eraseFromParent
(
)
;
return
BB
;
}
</s>

natrual_language: This method should be implemented by targets that mark instructions with the 'usesCustomInserter ' flag .

File: KudeyarISelLowering

Func: EmitInstrWithCustomInserter


ground_truth: <s> bool KudeyarTargetLowering :: getPostIndexedAddressParts ( SDNode * N , SDNode * Op , SDValue & Base , SDValue & Offset , ISD :: MemIndexedMode & AM , SelectionDAG & DAG ) const { EVT VT ; if ( N -> getOpcode ( ) == ISD :: LOAD ) { LoadSDNode * LD = cast < LoadSDNode > ( N ) ; VT = LD -> getMemoryVT ( ) ; } else if ( N -> getOpcode ( ) == ISD :: STORE ) { StoreSDNode * ST = cast < StoreSDNode > ( N ) ; VT = ST -> getMemoryVT ( ) ; } else return false ; if ( VT != MVT :: i8 && VT != MVT :: i16 && VT != MVT :: i32 ) return false ; if ( Op -> getOpcode ( ) != ISD :: ADD ) return false ; if ( ConstantSDNode * RHS = dyn_cast < ConstantSDNode > ( Op -> getOperand ( 1 ) ) ) { uint64_t RHSC = RHS -> getZExtValue ( ) ; if ( ( VT == MVT :: i32 && RHSC != 4 ) || ( VT == MVT :: i16 && RHSC != 2 ) || ( VT == MVT :: i8 && RHSC != 1 ) ) return false ; Base = Op -> getOperand ( 0 ) ; Offset = DAG . getConstant ( RHSC , VT ) ; AM = ISD :: POST_INC ; return true ; } return false ; } </s>

natrual_language: Returns true by value , base pointer and offset pointer and addressing mode by reference if this node can be combined with a load / store to form a post-indexed load / store .

Func: getPostIndexedAddressParts


ground_truth: <s> virtual MVT getShiftAmountTy ( EVT LHSTy ) const { return MVT :: i32 ; } </s>

natrual_language: Returns the type for the shift amount of a shift opcode .

Func: getShiftAmountTy


ground_truth: <s> const char * KudeyarTargetLowering :: getTargetNodeName ( unsigned Opcode ) const { switch ( Opcode ) { case KudeyarISD :: BR_CC_T : return "KudeyarISD::BR_CC_T" ; case KudeyarISD :: BR_CC_F : return "KudeyarISD::BR_CC_F" ; case KudeyarISD :: SELECT_CC_T : return "KudeyarISD::SELECT_CC_T" ; case KudeyarISD :: SELECT_CC_F : return "KudeyarISD::SELECT_CC_f" ; case KudeyarISD :: CMPEQ : return "KudeyarISD::CMPEQ" ; case KudeyarISD :: CMPGT : return "KudeyarISD::CMPGT" ; case KudeyarISD :: CMPLT : return "KudeyarISD::CMPLT" ; case KudeyarISD :: CMPGTU : return "KudeyarISD::CMPGTU" ; case KudeyarISD :: CMPLTU : return "KudeyarISD::CMPLTU" ; case KudeyarISD :: CALL : return "KudeyarISD::CALL" ; case KudeyarISD :: RET_FLAG : return "KudeyarISD::RET_FLAG" ; case KudeyarISD :: RETI_FLAG : return "KudeyarISD::RETI_FLAG" ; case KudeyarISD :: Wrapper : return "KudeyarISD::Wrapper" ; default : return NULL ; } } </s>

natrual_language: getTargetNodeName - This method returns the name of a target specific

Func: getTargetNodeName


ground_truth:
<s>
SDValue
KudeyarTargetLowering
::
LowerCall
(
TargetLowering
::
CallLoweringInfo
&
CLI
,
SmallVectorImpl
<
SDValue
>
&
InVals
)
const
{
SelectionDAG
&
DAG
=
CLI
.
DAG
;
DebugLoc
&
dl
=
CLI
.
DL
;
SmallVector
<
ISD
::
OutputArg
,
32
>
&
Outs
=
CLI
.
Outs
;
SmallVector
<
SDValue
,
32
>
&
OutVals
=
CLI
.
OutVals
;
SmallVector
<
ISD
::
InputArg
,
32
>
&
Ins
=
CLI
.
Ins
;
SDValue
Chain
=
CLI
.
Chain
;
SDValue
Callee
=
CLI
.
Callee
;
bool
&
isTailCall
=
CLI
.
IsTailCall
;
CallingConv
::
ID
CallConv
=
CLI
.
CallConv
;
bool
isVarArg
=
CLI
.
IsVarArg
;
isTailCall
=
false
;
switch
(
CallConv
)
{
default
:
llvm_unreachable
(
"Unsupported calling convention"
)
;
case
CallingConv
::
Fast
:
case
CallingConv
::
C
:
return
LowerCCCCallTo
(
Chain
,
Callee
,
CallConv
,
isVarArg
,
isTailCall
,
Outs
,
OutVals
,
Ins
,
dl
,
DAG
,
InVals
)
;
case
CallingConv
::
Kudeyar_INTR
:
report_fatal_error
(
"ISRs cannot be called directly"
)
;
}
}
</s>

natrual_language: This hook must be implemented to lower calls into the specified DAG .

TS_V_token:
Kudeyar
Kudeyar
ISD::OutputArg
32
32
ISD::InputArg
32
"Unsupported calling convention"
Kudeyar
"ISRs cannot be called directly"

Func: LowerCall


ground_truth: <s> SDValue KudeyarTargetLowering :: LowerCallResult ( SDValue Chain , SDValue InFlag , CallingConv :: ID CallConv , bool isVarArg , const SmallVectorImpl < ISD :: InputArg > & Ins , DebugLoc dl , SelectionDAG & DAG , SmallVectorImpl < SDValue > & InVals ) const { SmallVector < CCValAssign , 16 > RVLocs ; CCState CCInfo ( CallConv , isVarArg , DAG . getMachineFunction ( ) , getTargetMachine ( ) , RVLocs , * DAG . getContext ( ) ) ; CCInfo . AnalyzeCallResult ( Ins , RetCC_Kudeyar ) ; for ( unsigned i = 0 ; i != RVLocs . size ( ) ; ++ i ) { Chain = DAG . getCopyFromReg ( Chain , dl , RVLocs [ i ] . getLocReg ( ) , RVLocs [ i ] . getValVT ( ) , InFlag ) . getValue ( 1 ) ; InFlag = Chain . getValue ( 2 ) ; InVals . push_back ( Chain . getValue ( 0 ) ) ; } return Chain ; } </s>

natrual_language: LowerCallResult - Lower the result values of an ISD : :CALL into the appropriate copies out of appropriate physical registers .

Func: LowerCallResult


ground_truth:
<s>
SDValue
KudeyarTargetLowering
::
LowerFormalArguments
(
SDValue
Chain
,
CallingConv
::
ID
CallConv
,
bool
isVarArg
,
const
SmallVectorImpl
<
ISD
::
InputArg
>
&
Ins
,
DebugLoc
dl
,
SelectionDAG
&
DAG
,
SmallVectorImpl
<
SDValue
>
&
InVals
)
const
{
switch
(
CallConv
)
{
default
:
llvm_unreachable
(
"Unsupported calling convention"
)
;
case
CallingConv
::
C
:
case
CallingConv
::
Fast
:
return
LowerCCCArguments
(
Chain
,
CallConv
,
isVarArg
,
Ins
,
dl
,
DAG
,
InVals
)
;
case
CallingConv
::
Kudeyar_INTR
:
if
(
Ins
.
empty
(
)
)
return
Chain
;
report_fatal_error
(
"ISRs cannot have arguments"
)
;
}
}
</s>

natrual_language: This hook must be implemented to lower the incoming ( formal ) arguments , described by the Ins array , into the specified DAG .

TS_V_token:
Kudeyar
Kudeyar
ISD::InputArg
"Unsupported calling convention"
Kudeyar
"ISRs cannot have arguments"

Func: LowerFormalArguments


ground_truth: <s> SDValue KudeyarTargetLowering :: LowerOperation ( SDValue Op , SelectionDAG & DAG ) const { switch ( Op . getOpcode ( ) ) { case ISD :: SIGN_EXTEND : return LowerSIGN_EXTEND ( Op , DAG ) ; case ISD :: GlobalAddress : return LowerGlobalAddress ( Op , DAG ) ; case ISD :: ExternalSymbol : return LowerExternalSymbol ( Op , DAG ) ; case ISD :: BlockAddress : return LowerBlockAddress ( Op , DAG ) ; case ISD :: JumpTable : return LowerJumpTable ( Op , DAG ) ; case ISD :: SETCC : return LowerSETCC ( Op , DAG ) ; case ISD :: BR_CC : return LowerBR_CC ( Op , DAG ) ; case ISD :: SELECT_CC : return LowerSELECT_CC ( Op , DAG ) ; default : break ; } return SDValue ( ) ; } </s>

natrual_language: LowerOperation - Provide custom lowering hooks for some operations .

TS_V_token: Kudeyar Kudeyar ISD::SIGN_EXTEND ISD::GlobalAddress ISD::ExternalSymbol ISD::BlockAddress ISD::JumpTable ISD::SETCC ISD::BR_CC ISD::SELECT_CC

Func: LowerOperation


ground_truth:
<s>
SDValue
KudeyarTargetLowering
::
LowerReturn
(
SDValue
Chain
,
CallingConv
::
ID
CallConv
,
bool
isVarArg
,
const
SmallVectorImpl
<
ISD
::
OutputArg
>
&
Outs
,
const
SmallVectorImpl
<
SDValue
>
&
OutVals
,
DebugLoc
dl
,
SelectionDAG
&
DAG
)
const
{
SmallVector
<
CCValAssign
,
16
>
RVLocs
;
if
(
CallConv
==
CallingConv
::
Kudeyar_INTR
&&
!
Outs
.
empty
(
)
)
report_fatal_error
(
"ISRs cannot return any value"
)
;
CCState
CCInfo
(
CallConv
,
isVarArg
,
DAG
.
getMachineFunction
(
)
,
getTargetMachine
(
)
,
RVLocs
,
*
DAG
.
getContext
(
)
)
;
CCInfo
.
AnalyzeReturn
(
Outs
,
RetCC_Kudeyar
)
;
if
(
DAG
.
getMachineFunction
(
)
.
getRegInfo
(
)
.
liveout_empty
(
)
)
{
for
(
unsigned
i
=
0
;
i
!=
RVLocs
.
size
(
)
;
++
i
)
if
(
RVLocs
[
i
]
.
isRegLoc
(
)
)
DAG
.
getMachineFunction
(
)
.
getRegInfo
(
)
.
addLiveOut
(
RVLocs
[
i
]
.
getLocReg
(
)
)
;
}
SDValue
Flag
;
for
(
unsigned
i
=
0
;
i
!=
RVLocs
.
size
(
)
;
++
i
)
{
CCValAssign
&
VA
=
RVLocs
[
i
]
;
assert
(
VA
.
isRegLoc
(
)
&&
"Can only return in registers!"
)
;
Chain
=
DAG
.
getCopyToReg
(
Chain
,
dl
,
VA
.
getLocReg
(
)
,
OutVals
[
i
]
,
Flag
)
;
Flag
=
Chain
.
getValue
(
1
)
;
}
unsigned
Opc
=
(
CallConv
==
CallingConv
::
Kudeyar_INTR
KudeyarISD
::
RETI_FLAG
:
KudeyarISD
::
RET_FLAG
)
;
if
(
Flag
.
getNode
(
)
)
return
DAG
.
getNode
(
Opc
,
dl
,
MVT
::
Other
,
Chain
,
Flag
)
;
return
DAG
.
getNode
(
Opc
,
dl
,
MVT
::
Other
,
Chain
)
;
}
</s>

natrual_language: This hook must be implemented to lower outgoing return values , described by the Outs array , into the specified DAG .

Func: LowerReturn


ground_truth:
<s>
MCSymbol
*
KudeyarMCInstLower
::
GetBlockAddressSymbol
(
const
MachineOperand
&
MO
)
const
{
switch
(
MO
.
getTargetFlags
(
)
)
{
default
:
llvm_unreachable
(
"Unknown target flag on GV operand"
)
;
case
0
:
break
;
}
return
Printer
.
GetBlockAddressSymbol
(
MO
.
getBlockAddress
(
)
)
;
}
</s>

natrual_language: Return the MCSymbol used to satisfy BlockAddress uses of the specified basic block .

TS_V_token:
Kudeyar
Kudeyar
"Unknown target flag on GV operand"
0

File: KudeyarMCInstLower

Func: GetBlockAddressSymbol


ground_truth: <s> class LLVM_LIBRARY_VISIBILITY KudeyarMCInstLower { typedef MachineOperand :: MachineOperandType MachineOperandType ; KudeyarAsmPrinter & Printer ; public : KudeyarMCInstLower ( KudeyarAsmPrinter & asmprinter ) ; void Lower ( const MachineInstr * MI , MCInst & OutMI ) const ; private : MCSymbol * GetGlobalAddressSymbol ( const MachineOperand & MO ) const ; MCSymbol * GetExternalSymbolSymbol ( const MachineOperand & MO ) const ; MCSymbol * GetJumpTableSymbol ( const MachineOperand & MO ) const ; MCSymbol * GetConstantPoolIndexSymbol ( const MachineOperand & MO ) const ; MCSymbol * GetBlockAddressSymbol ( const MachineOperand & MO ) const ; MCOperand LowerSymbolOperand ( const MachineOperand & MO , MCSymbol * Sym ) const ; MCOperand LowerOperand ( const MachineOperand & MO , unsigned offset = 0 ) const ; } </s>

natrual_language: Return the MCSymbol for the specified ExternalSymbol .

TS_V_token: Kudeyar Kudeyar Kudeyar Kudeyar Kudeyar 0

Func: GetExternalSymbolSymbol


ground_truth: <s> void KudeyarRegisterInfo :: eliminateCallFramePseudoInstr ( MachineFunction & MF , MachineBasicBlock & MBB , MachineBasicBlock :: iterator I ) const { const TargetFrameLowering * TFI = MF . getTarget ( ) . getFrameLowering ( ) ; if ( ! TFI -> hasReservedCallFrame ( MF ) ) { MachineInstr * Old = I ; uint64_t Amount = Old -> getOperand ( 0 ) . getImm ( ) ; if ( Amount != 0 ) { Amount = ( Amount + StackAlign - 1 ) / StackAlign * StackAlign ; MachineInstr * New = 0 ; if ( Old -> getOpcode ( ) == TII . getCallFrameSetupOpcode ( ) ) { New = BuildMI ( MF , Old -> getDebugLoc ( ) , TII . get ( Kudeyar :: SUB_RR ) , Kudeyar :: SP ) . addReg ( Kudeyar :: SP ) . addImm ( Amount ) ; } else { assert ( Old -> getOpcode ( ) == TII . getCallFrameDestroyOpcode ( ) ) ; uint64_t CalleeAmt = Old -> getOperand ( 1 ) . getImm ( ) ; Amount -= CalleeAmt ; if ( Amount ) New = BuildMI ( MF , Old -> getDebugLoc ( ) , TII . get ( Kudeyar :: ADD_RR ) , Kudeyar :: SP ) . addReg ( Kudeyar :: SP ) . addImm ( Amount ) ; } if ( New ) { New -> getOperand ( 3 ) . setIsDead ( ) ; MBB . insert ( I , New ) ; } } } else if ( I -> getOpcode ( ) == TII . getCallFrameDestroyOpcode ( ) ) { if ( uint64_t CalleeAmt = I -> getOperand ( 1 ) . getImm ( ) ) { MachineInstr * Old = I ; MachineInstr * New = BuildMI ( MF , Old -> getDebugLoc ( ) , TII . get ( Kudeyar :: SUB_RR ) , Kudeyar :: SP ) . addReg ( Kudeyar :: SP ) . addImm ( CalleeAmt ) ; New -> getOperand ( 3 ) . setIsDead ( ) ; MBB . insert ( I , New ) ; } } MBB . erase ( I ) ; } </s>

natrual_language: This method is called during prolog/epilog code insertion to eliminate call frame setup and destroy pseudo instructions ( but only if the Target is using them ) .

File: KudeyarRegisterInfo

Func: eliminateCallFramePseudoInstr


ground_truth: "Instr doesn't have FrameIndex operand!"

natrual_language: This method must be overriden to eliminate abstract frame indices from instructions which may use them .

Func: eliminateFrameIndex


ground_truth: <s> const uint16_t * KudeyarRegisterInfo :: getCalleeSavedRegs ( const MachineFunction * MF ) const { const TargetFrameLowering * TFI = MF -> getTarget ( ) . getFrameLowering ( ) ; const Function * F = MF -> getFunction ( ) ; if ( TFI -> hasFP ( * MF ) ) return ( F -> getCallingConv ( ) == CallingConv :: Kudeyar_INTR ? CSR_FP_INTR_SaveList : CSR_FP_SaveList ) ; else return ( F -> getCallingConv ( ) == CallingConv :: Kudeyar_INTR ? CSR_NoFP_INTR_SaveList : CSR_NoFP_SaveList ) ; } </s>

natrual_language: Code Generation virtual methods ...

Func: getCalleeSavedRegs


ground_truth: <s> unsigned KudeyarRegisterInfo :: getFrameRegister ( const MachineFunction & MF ) const { const TargetFrameLowering * TFI = MF . getTarget ( ) . getFrameLowering ( ) ; return TFI -> hasFP ( MF ) ? Kudeyar :: FP : Kudeyar :: SP ; } </s>

natrual_language: Debug information queries .

TS_V_token: Kudeyar Kudeyar Kudeyar::FP Kudeyar::SP

Func: getFrameRegister


ground_truth: <s> const TargetRegisterClass * KudeyarRegisterInfo :: getPointerRegClass ( const MachineFunction & MF , unsigned Kind ) const { return & Kudeyar :: GPRRegClass ; } </s>

natrual_language: getPointerRegClass - Returns a TargetRegisterClass used for pointer values .

TS_V_token: Kudeyar Kudeyar Kudeyar::GPRRegClass

Func: getPointerRegClass


ground_truth: <s> BitVector KudeyarRegisterInfo :: getReservedRegs ( const MachineFunction & MF ) const { BitVector Reserved ( getNumRegs ( ) ) ; const TargetFrameLowering * TFI = MF . getTarget ( ) . getFrameLowering ( ) ; Reserved . set ( Kudeyar :: SP ) ; if ( TFI -> hasFP ( MF ) ) Reserved . set ( Kudeyar :: FP ) ; return Reserved ; } </s>

natrual_language: getReservedRegs - Returns a bitset indexed by physical register number indicating if a register is a special register that has particular uses and should be considered unavailable at all times , e.g .

TS_V_token: Kudeyar Kudeyar Kudeyar::SP Kudeyar::FP

Func: getReservedRegs


ground_truth: <s> bool KudeyarPassConfig :: addInstSelector ( ) { addPass ( createKudeyarISelDag ( getKudeyarTargetMachine ( ) , getOptLevel ( ) ) ) ; return false ; } </s>

natrual_language: addInstSelector - This method should install an instruction selector pass , which converts from LLVM code to machine instructions .

File: KudeyarTargetMachine

Func: addInstSelector


ground_truth: <s> bool KudeyarPassConfig :: addPreEmitPass ( ) { return false ; } </s>

natrual_language: This pass may be implemented by targets that want to run passes immediately before machine code is emitted .

Func: addPreEmitPass


ground_truth: <s> TargetPassConfig * KudeyarTargetMachine :: createPassConfig ( PassManagerBase & PM ) { return new KudeyarPassConfig ( this , PM ) ; } </s>

natrual_language: Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of CodeGen passes .

Func: createPassConfig


ground_truth: <s> virtual const DataLayout * getDataLayout ( ) const { return & DL ; } </s>

natrual_language: Return the DataLayout associated with the module this SCEV instance is operating on .

Func: getDataLayout


ground_truth: <s> virtual const KudeyarInstrInfo * getInstrInfo ( ) const { return & InstrInfo ; } </s>

natrual_language: TargetInstrInfo getter .

Func: getInstrInfo


ground_truth: <s> virtual const TargetRegisterInfo * getRegisterInfo ( ) const { return & InstrInfo . getRegisterInfo ( ) ; } </s>

natrual_language: getRegisterInfo - TargetInstrInfo is a superset of MRegister info .

Func: getRegisterInfo


ground_truth: <s> virtual const KudeyarSubtarget * getSubtargetImpl ( ) const { return & Subtarget ; } </s>

natrual_language: Virtual method implemented by subclasses that returns a reference to that target 's TargetSubtargetInfo-derived member variable .

Func: getSubtargetImpl


ground_truth: <s> void KudeyarTargetObjectFile :: Initialize ( MCContext & Ctx , const TargetMachine & TM ) { TargetLoweringObjectFileELF :: Initialize ( Ctx , TM ) ; SmallDataSection = getContext ( ) . getELFSection ( ".sdata" , ELF :: SHT_PROGBITS , ELF :: SHF_WRITE | ELF :: SHF_ALLOC , SectionKind :: getDataRel ( ) ) ; SmallBSSSection = getContext ( ) . getELFSection ( ".sbss" , ELF :: SHT_NOBITS , ELF :: SHF_WRITE | ELF :: SHF_ALLOC , SectionKind :: getBSS ( ) ) ; } </s>

natrual_language: This method must be called before any actual lowering is done .

File: KudeyarTargetObjectFile

Func: Initialize


ground_truth: <s> bool KudeyarTargetObjectFile :: IsGlobalInSmallSection ( const GlobalValue * GV , const TargetMachine & TM , SectionKind Kind ) const { const KudeyarSubtarget & Subtarget = TM . getSubtarget < KudeyarSubtarget > ( ) ; if ( Subtarget . isLinux ( ) ) return false ; const GlobalVariable * GVA = dyn_cast < GlobalVariable > ( GV ) ; if ( ! GVA ) return false ; if ( ! Kind . isBSS ( ) && ! Kind . isDataRel ( ) ) return false ; if ( Kind . isMergeable1ByteCString ( ) ) return false ; Type * Ty = GV -> getType ( ) -> getElementType ( ) ; return IsInSmallSection ( TM . getDataLayout ( ) -> getTypeAllocSize ( Ty ) ) ; } </s>

natrual_language: Return true if this global address should be placed into small data/bss section .

Func: IsGlobalInSmallSection