LLVM API Documentation

llvm::PIC16TargetLowering Class Reference

#include <PIC16ISelLowering.h>

Inheritance diagram for llvm::PIC16TargetLowering:
[legend]
Collaboration diagram for llvm::PIC16TargetLowering:
[legend]

List of all members.

Public Member Functions

 PIC16TargetLowering (PIC16TargetMachine &TM)
virtual const char * getTargetNodeName (unsigned Opcode) const
virtual MVT::SimpleValueType getSetCCResultType (EVT ValType) const
 getSetCCResultType - Return the ISD::SETCC ValueType
SDValue LowerShift (SDValue Op, SelectionDAG &DAG)
SDValue LowerMUL (SDValue Op, SelectionDAG &DAG)
SDValue LowerADD (SDValue Op, SelectionDAG &DAG)
SDValue LowerSUB (SDValue Op, SelectionDAG &DAG)
SDValue LowerBinOp (SDValue Op, SelectionDAG &DAG)
SDValue LowerDirectCallReturn (SDValue RetLabel, SDValue Chain, SDValue InFlag, const SmallVectorImpl< ISD::InputArg > &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals)
SDValue LowerIndirectCallReturn (SDValue Chain, SDValue InFlag, SDValue DataAddr_Lo, SDValue DataAddr_Hi, const SmallVectorImpl< ISD::InputArg > &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals)
SDValue LowerDirectCallArguments (SDValue ArgLabel, SDValue Chain, SDValue InFlag, const SmallVectorImpl< ISD::OutputArg > &Outs, DebugLoc dl, SelectionDAG &DAG)
SDValue LowerIndirectCallArguments (SDValue Chain, SDValue InFlag, SDValue DataAddr_Lo, SDValue DataAddr_Hi, const SmallVectorImpl< ISD::OutputArg > &Outs, const SmallVectorImpl< ISD::InputArg > &Ins, DebugLoc dl, SelectionDAG &DAG)
SDValue LowerBR_CC (SDValue Op, SelectionDAG &DAG)
SDValue LowerSELECT_CC (SDValue Op, SelectionDAG &DAG)
SDValue getPIC16Cmp (SDValue LHS, SDValue RHS, unsigned OrigCC, SDValue &CC, SelectionDAG &DAG, DebugLoc dl)
virtual MachineBasicBlock * EmitInstrWithCustomInserter (MachineInstr *MI, MachineBasicBlock *MBB) const
virtual SDValue LowerOperation (SDValue Op, SelectionDAG &DAG)
virtual void ReplaceNodeResults (SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG)
virtual void LowerOperationWrapper (SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG)
virtual SDValue LowerFormalArguments (SDValue Chain, unsigned CallConv, bool isVarArg, const SmallVectorImpl< ISD::InputArg > &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals)
virtual SDValue LowerCall (SDValue Chain, SDValue Callee, unsigned CallConv, bool isVarArg, bool isTailCall, const SmallVectorImpl< ISD::OutputArg > &Outs, const SmallVectorImpl< ISD::InputArg > &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals)
virtual SDValue LowerReturn (SDValue Chain, unsigned CallConv, bool isVarArg, const SmallVectorImpl< ISD::OutputArg > &Outs, DebugLoc dl, SelectionDAG &DAG)
SDValue ExpandStore (SDNode *N, SelectionDAG &DAG)
SDValue ExpandLoad (SDNode *N, SelectionDAG &DAG)
SDValue ExpandGlobalAddress (SDNode *N, SelectionDAG &DAG)
SDValue ExpandExternalSymbol (SDNode *N, SelectionDAG &DAG)
SDValue ExpandFrameIndex (SDNode *N, SelectionDAG &DAG)
SDValue PerformDAGCombine (SDNode *N, DAGCombinerInfo &DCI) const
SDValue PerformPIC16LoadCombine (SDNode *N, DAGCombinerInfo &DCI) const
SDValue PerformStoreCombine (SDNode *N, DAGCombinerInfo &DCI) const
unsigned GetTmpOffsetForFI (unsigned FI, unsigned slot_size)
void ResetTmpOffsetMap ()
void InitReservedFrameCount (const Function *F)
unsigned GetTmpSize ()
void SetTmpSize (unsigned Size)
virtual unsigned getFunctionAlignment (const Function *) const
 getFunctionAlignment - Return the Log2 alignment of this function.


Detailed Description

Definition at line 77 of file PIC16ISelLowering.h.


Constructor & Destructor Documentation

PIC16TargetLowering::PIC16TargetLowering ( PIC16TargetMachine &  TM  )  [explicit]

Definition at line 145 of file PIC16ISelLowering.cpp.

References llvm::ISD::ADD, llvm::RTLIB::ADD_F32, llvm::ISD::ADDC, llvm::ISD::ADDE, llvm::TargetLowering::addRegisterClass(), llvm::ISD::AND, llvm::ISD::BR_CC, llvm::ISD::BRCOND, llvm::ISD::BRIND, llvm::TargetLowering::computeRegisterProperties(), llvm::RTLIB::COS_F32, llvm::TargetLowering::Custom, llvm::RTLIB::DIV_F32, llvm::TargetLowering::Expand, llvm::ISD::ExternalSymbol, llvm::RTLIB::FPTOSINT_F32_I16, llvm::RTLIB::FPTOSINT_F32_I32, llvm::RTLIB::FPTOSINT_F32_I8, llvm::RTLIB::FPTOUINT_F32_I16, llvm::RTLIB::FPTOUINT_F32_I32, llvm::RTLIB::FPTOUINT_F32_I8, llvm::ISD::FrameIndex, getIntrinsicName(), getStdLibCallName(), llvm::TargetMachine::getSubtarget(), llvm::ISD::GlobalAddress, llvm::MVT::i1, llvm::MVT::i16, llvm::MVT::i32, llvm::MVT::i64, llvm::MVT::i8, llvm::TargetLowering::Legal, llvm::ISD::LOAD, llvm::RTLIB::MEMCPY, llvm::RTLIB::MEMMOVE, llvm::RTLIB::MEMSET, llvm::ISD::MUL, llvm::RTLIB::MUL_F32, llvm::RTLIB::MUL_I16, llvm::RTLIB::MUL_I32, llvm::PIC16ISD::MUL_I8, llvm::ISD::MULHS, llvm::ISD::MULHU, llvm::RTLIB::O_F32, llvm::RTLIB::OEQ_F32, llvm::RTLIB::OGE_F32, llvm::RTLIB::OGT_F32, llvm::RTLIB::OLE_F32, llvm::RTLIB::OLT_F32, llvm::ISD::OR, llvm::MVT::Other, llvm::ISD::ROTL, llvm::ISD::ROTR, llvm::RTLIB::SDIV_I16, llvm::RTLIB::SDIV_I32, llvm::ISD::SELECT, llvm::ISD::SELECT_CC, llvm::ISD::SETCC, llvm::TargetLowering::setCmpLibcallCC(), llvm::ISD::SETEQ, llvm::TargetLowering::setLibcallName(), llvm::ISD::SETNE, llvm::TargetLowering::setOperationAction(), llvm::TargetLowering::setShiftAmountType(), llvm::TargetLowering::setTruncStoreAction(), llvm::ISD::SHL, llvm::RTLIB::SHL_I16, llvm::RTLIB::SHL_I32, llvm::ISD::SHL_PARTS, llvm::ISD::SIGN_EXTEND_INREG, llvm::RTLIB::SIN_F32, llvm::RTLIB::SINTTOFP_I32_F32, llvm::PIC16ISD::SLL_I8, llvm::ISD::SMUL_LOHI, llvm::ISD::SRA, llvm::RTLIB::SRA_I16, llvm::RTLIB::SRA_I32, llvm::PIC16ISD::SRA_I8, llvm::ISD::SRA_PARTS, llvm::RTLIB::SREM_I16, llvm::RTLIB::SREM_I32, llvm::ISD::SRL, llvm::RTLIB::SRL_I16, llvm::RTLIB::SRL_I32, llvm::PIC16ISD::SRL_I8, llvm::ISD::SRL_PARTS, llvm::ISD::STORE, llvm::ISD::SUB, llvm::RTLIB::SUB_F32, llvm::ISD::SUBC, llvm::ISD::SUBE, llvm::RTLIB::UDIV_I16, llvm::RTLIB::UDIV_I32, llvm::RTLIB::UINTTOFP_I32_F32, llvm::ISD::UMUL_LOHI, llvm::RTLIB::UNE_F32, llvm::RTLIB::UO_F32, llvm::RTLIB::UREM_I16, llvm::RTLIB::UREM_I32, and llvm::ISD::XOR.


Member Function Documentation

const char * PIC16TargetLowering::getTargetNodeName ( unsigned  Opcode  )  const [virtual]

MVT::SimpleValueType PIC16TargetLowering::getSetCCResultType ( EVT  ValType  )  const [virtual]

getSetCCResultType - Return the ISD::SETCC ValueType

Reimplemented from llvm::TargetLowering.

Definition at line 369 of file PIC16ISelLowering.cpp.

References llvm::MVT::i8.

SDValue PIC16TargetLowering::LowerShift ( SDValue  Op,
SelectionDAG &  DAG 
)

SDValue PIC16TargetLowering::LowerMUL ( SDValue  Op,
SelectionDAG &  DAG 
)

SDValue PIC16TargetLowering::LowerADD ( SDValue  Op,
SelectionDAG &  DAG 
)

SDValue PIC16TargetLowering::LowerSUB ( SDValue  Op,
SelectionDAG &  DAG 
)

SDValue PIC16TargetLowering::LowerBinOp ( SDValue  Op,
SelectionDAG &  DAG 
)

SDValue PIC16TargetLowering::LowerDirectCallReturn ( SDValue  RetLabel,
SDValue  Chain,
SDValue  InFlag,
const SmallVectorImpl< ISD::InputArg > &  Ins,
DebugLoc  dl,
SelectionDAG &  DAG,
SmallVectorImpl< SDValue > &  InVals 
)

SDValue PIC16TargetLowering::LowerIndirectCallReturn ( SDValue  Chain,
SDValue  InFlag,
SDValue  DataAddr_Lo,
SDValue  DataAddr_Hi,
const SmallVectorImpl< ISD::InputArg > &  Ins,
DebugLoc  dl,
SelectionDAG &  DAG,
SmallVectorImpl< SDValue > &  InVals 
)

SDValue PIC16TargetLowering::LowerDirectCallArguments ( SDValue  ArgLabel,
SDValue  Chain,
SDValue  InFlag,
const SmallVectorImpl< ISD::OutputArg > &  Outs,
DebugLoc  dl,
SelectionDAG &  DAG 
)

SDValue PIC16TargetLowering::LowerIndirectCallArguments ( SDValue  Chain,
SDValue  InFlag,
SDValue  DataAddr_Lo,
SDValue  DataAddr_Hi,
const SmallVectorImpl< ISD::OutputArg > &  Outs,
const SmallVectorImpl< ISD::InputArg > &  Ins,
DebugLoc  dl,
SelectionDAG &  DAG 
)

SDValue PIC16TargetLowering::LowerBR_CC ( SDValue  Op,
SelectionDAG &  DAG 
)

SDValue PIC16TargetLowering::LowerSELECT_CC ( SDValue  Op,
SelectionDAG &  DAG 
)

SDValue PIC16TargetLowering::getPIC16Cmp ( SDValue  LHS,
SDValue  RHS,
unsigned  OrigCC,
SDValue &  CC,
SelectionDAG &  DAG,
DebugLoc  dl 
)

MachineBasicBlock * PIC16TargetLowering::EmitInstrWithCustomInserter ( MachineInstr *  MI,
MachineBasicBlock *  MBB 
) const [virtual]

SDValue PIC16TargetLowering::LowerOperation ( SDValue  Op,
SelectionDAG &  DAG 
) [virtual]

LowerOperation - This callback is invoked for operations that are unsupported by the target, which are registered to use 'custom' lowering, and whose defined values are all legal. If the target has no operations that require custom lowering, it need not implement this. The default implementation of this aborts.

Reimplemented from llvm::TargetLowering.

Definition at line 1019 of file PIC16ISelLowering.cpp.

References llvm::ISD::ADD, llvm::ISD::ADDC, llvm::ISD::ADDE, llvm::ISD::AND, llvm::ISD::BR_CC, ExpandLoad(), ExpandStore(), llvm::SDValue::getNode(), llvm::SDValue::getOpcode(), llvm::ISD::LOAD, LowerADD(), LowerBinOp(), LowerBR_CC(), LowerMUL(), LowerSELECT_CC(), LowerShift(), LowerSUB(), llvm::ISD::MUL, llvm::ISD::OR, llvm::ISD::SELECT_CC, llvm::ISD::SHL, llvm::ISD::SRA, llvm::ISD::SRL, llvm::ISD::STORE, llvm::ISD::SUB, llvm::ISD::SUBC, llvm::ISD::SUBE, and llvm::ISD::XOR.

Referenced by LowerOperationWrapper().

void PIC16TargetLowering::ReplaceNodeResults ( SDNode *  N,
SmallVectorImpl< SDValue > &  Results,
SelectionDAG &  DAG 
) [virtual]

ReplaceNodeResults - This callback is invoked when a node result type is illegal for the target, and the operation was registered to use 'custom' lowering for that result type. The target places new result values for the node in Results (their number and types must exactly match those of the original return values of the node), or leaves Results empty, which indicates that the node is not to be custom lowered after all.

If the target has no operations that require custom lowering, it need not implement this. The default implementation aborts.

Reimplemented from llvm::TargetLowering.

Definition at line 450 of file PIC16ISelLowering.cpp.

References llvm::ISD::ADD, ExpandExternalSymbol(), ExpandFrameIndex(), ExpandGlobalAddress(), ExpandLoad(), ExpandStore(), llvm::ISD::ExternalSymbol, llvm::ISD::FrameIndex, llvm::SDNode::getOpcode(), llvm::ISD::GlobalAddress, llvm::ISD::LOAD, PopulateResults(), llvm::SmallVectorImpl< T >::push_back(), and llvm::ISD::STORE.

void PIC16TargetLowering::LowerOperationWrapper ( SDNode *  N,
SmallVectorImpl< SDValue > &  Results,
SelectionDAG &  DAG 
) [virtual]

LowerOperationWrapper - This callback is invoked by the type legalizer to legalize nodes with an illegal operand type but legal result types. It replaces the LowerOperation callback in the type Legalizer. The reason we can not do away with LowerOperation entirely is that LegalizeDAG isn't yet ready to use this callback. TODO: Consider merging with ReplaceNodeResults. The target places new result values for the node in Results (their number and types must exactly match those of the original return values of the node), or leaves Results empty, which indicates that the node is not to be custom lowered after all. The default implementation calls LowerOperation.

Reimplemented from llvm::TargetLowering.

Definition at line 993 of file PIC16ISelLowering.cpp.

References ExpandLoad(), llvm::SDValue::getNode(), llvm::SDNode::getNumValues(), llvm::SDValue::getOpcode(), llvm::ISD::LOAD, LowerOperation(), and llvm::SmallVectorImpl< T >::push_back().

SDValue PIC16TargetLowering::LowerFormalArguments ( SDValue  Chain,
unsigned  CallConv,
bool  isVarArg,
const SmallVectorImpl< ISD::InputArg > &  Ins,
DebugLoc  dl,
SelectionDAG &  DAG,
SmallVectorImpl< SDValue > &  InVals 
) [virtual]

LowerFormalArguments - This hook must be implemented to lower the incoming (formal) arguments, described by the Ins array, into the specified DAG. The implementation should fill in the InVals array with legal-type argument values, and return the resulting token chain value.

Reimplemented from llvm::TargetLowering.

Definition at line 1597 of file PIC16ISelLowering.cpp.

References llvm::createESName(), F, llvm::PAN::getArgsLabel(), getChain(), llvm::SelectionDAG::getConstant(), llvm::MachineFunction::getFunction(), llvm::SelectionDAG::getMachineFunction(), llvm::Value::getName(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getTargetExternalSymbol(), llvm::SelectionDAG::getVTList(), llvm::MVT::i8, InitReservedFrameCount(), llvm::MVT::Other, llvm::PIC16ISD::PIC16LdArg, llvm::SmallVectorImpl< T >::push_back(), ResetTmpOffsetMap(), llvm::SmallVectorImpl< T >::size(), and VTs.

SDValue PIC16TargetLowering::LowerCall ( SDValue  Chain,
SDValue  Callee,
unsigned  CallConv,
bool  isVarArg,
bool  isTailCall,
const SmallVectorImpl< ISD::OutputArg > &  Outs,
const SmallVectorImpl< ISD::InputArg > &  Ins,
DebugLoc  dl,
SelectionDAG &  DAG,
SmallVectorImpl< SDValue > &  InVals 
) [virtual]

LowerCall - This hook must be implemented to lower calls into the the specified DAG. The outgoing arguments to the call are described by the Outs array, and the values to be returned by the call are described by the Ins array. The implementation should fill in the InVals array with legal-type return values from the call, and return the resulting token chain value.

The isTailCall flag here is normative. If it is true, the implementation must emit a tail call. The IsEligibleForTailCallOptimization hook should be used to catch cases that cannot be handled.

Reimplemented from llvm::TargetLowering.

Definition at line 1341 of file PIC16ISelLowering.cpp.

References llvm::PIC16ISD::CALL, llvm::createESName(), llvm::dyn_cast(), llvm::MVT::Flag, G, llvm::PAN::getArgsLabel(), llvm::SelectionDAG::getCALLSEQ_END(), llvm::SelectionDAG::getCALLSEQ_START(), getChain(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOperand(), getOutFlag(), llvm::PAN::getRetvalLabel(), llvm::ExternalSymbolSDNode::getSymbol(), llvm::SelectionDAG::getTargetExternalSymbol(), llvm::SelectionDAG::getTargetGlobalAddress(), llvm::SDValue::getValueType(), llvm::SelectionDAG::getVTList(), GV, llvm::MVT::i16, llvm::MVT::i8, LowerDirectCallArguments(), LowerDirectCallReturn(), LowerIndirectCallArguments(), LowerIndirectCallReturn(), llvm::PIC16ISD::MTPCLATH, llvm::MVT::Other, llvm::PIC16ISD::PIC16Connect, and llvm::SmallVectorImpl< T >::size().

SDValue PIC16TargetLowering::LowerReturn ( SDValue  Chain,
unsigned  CallConv,
bool  isVarArg,
const SmallVectorImpl< ISD::OutputArg > &  Outs,
DebugLoc  dl,
SelectionDAG &  DAG 
) [virtual]

LowerReturn - This hook must be implemented to lower outgoing return values, described by the Outs array, into the specified DAG. The implementation should return the resulting token chain value.

Reimplemented from llvm::TargetLowering.

Definition at line 1249 of file PIC16ISelLowering.cpp.

References llvm::createESName(), F, llvm::SelectionDAG::getConstant(), llvm::PAN::getFrameLabel(), llvm::MachineFunction::getFunction(), llvm::SelectionDAG::getMachineFunction(), llvm::Value::getName(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getTargetExternalSymbol(), llvm::SelectionDAG::getVTList(), llvm::MVT::i8, llvm::MVT::Other, llvm::PIC16ISD::PIC16Store, llvm::PIC16ISD::RET, llvm::SmallVectorImpl< T >::size(), and VTs.

SDValue PIC16TargetLowering::ExpandStore ( SDNode *  N,
SelectionDAG &  DAG 
)

SDValue PIC16TargetLowering::ExpandLoad ( SDNode *  N,
SelectionDAG &  DAG 
)

SDValue PIC16TargetLowering::ExpandGlobalAddress ( SDNode *  N,
SelectionDAG &  DAG 
)

SDValue PIC16TargetLowering::ExpandExternalSymbol ( SDNode *  N,
SelectionDAG &  DAG 
)

SDValue PIC16TargetLowering::ExpandFrameIndex ( SDNode *  N,
SelectionDAG &  DAG 
)

SDValue PIC16TargetLowering::PerformDAGCombine ( SDNode *  N,
DAGCombinerInfo &  DCI 
) const [virtual]

PerformDAGCombine - This method will be invoked for all target nodes and for any target-independent nodes that the target has registered with invoke it for.

The semantics are as follows: Return Value: SDValue.Val == 0 - No change was made SDValue.Val == N - N was replaced, is dead, and is already handled. otherwise - N should be replaced by the returned Operand.

In addition, methods provided by DAGCombinerInfo may be used to perform more complex transformations.

Reimplemented from llvm::TargetLowering.

Definition at line 1666 of file PIC16ISelLowering.cpp.

References llvm::SDNode::getOpcode(), PerformPIC16LoadCombine(), PerformStoreCombine(), llvm::PIC16ISD::PIC16Load, and llvm::ISD::STORE.

SDValue PIC16TargetLowering::PerformPIC16LoadCombine ( SDNode *  N,
DAGCombinerInfo &  DCI 
) const

SDValue PIC16TargetLowering::PerformStoreCombine ( SDNode *  N,
DAGCombinerInfo &  DCI 
) const

Definition at line 1654 of file PIC16ISelLowering.cpp.

Referenced by PerformDAGCombine().

unsigned PIC16TargetLowering::GetTmpOffsetForFI ( unsigned  FI,
unsigned  slot_size 
)

void llvm::PIC16TargetLowering::ResetTmpOffsetMap (  )  [inline]

Definition at line 169 of file PIC16ISelLowering.h.

References SetTmpSize().

Referenced by LowerFormalArguments().

void PIC16TargetLowering::InitReservedFrameCount ( const Function *  F  ) 

unsigned llvm::PIC16TargetLowering::GetTmpSize (  )  [inline]

Definition at line 173 of file PIC16ISelLowering.h.

void llvm::PIC16TargetLowering::SetTmpSize ( unsigned  Size  )  [inline]

Definition at line 174 of file PIC16ISelLowering.h.

Referenced by ResetTmpOffsetMap().

virtual unsigned llvm::PIC16TargetLowering::getFunctionAlignment ( const Function *   )  const [inline, virtual]

getFunctionAlignment - Return the Log2 alignment of this function.

Implements llvm::TargetLowering.

Definition at line 177 of file PIC16ISelLowering.h.


The documentation for this class was generated from the following files: