2010-09-18 18:52:28 +00:00
|
|
|
//==-- PTXISelLowering.h - PTX DAG Lowering Interface ------------*- C++ -*-==//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines the interfaces that PTX uses to lower LLVM code into a
|
|
|
|
// selection DAG.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef PTX_ISEL_LOWERING_H
|
|
|
|
#define PTX_ISEL_LOWERING_H
|
|
|
|
|
|
|
|
#include "llvm/Target/TargetLowering.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class PTXSubtarget;
|
|
|
|
class PTXTargetMachine;
|
|
|
|
|
|
|
|
namespace PTXISD {
|
|
|
|
enum NodeType {
|
|
|
|
FIRST_NUMBER = ISD::BUILTIN_OP_END,
|
2011-06-23 18:10:05 +00:00
|
|
|
LOAD_PARAM,
|
2011-06-23 18:10:03 +00:00
|
|
|
STORE_PARAM,
|
2011-09-22 16:45:46 +00:00
|
|
|
READ_PARAM,
|
|
|
|
WRITE_PARAM,
|
2010-09-25 07:46:17 +00:00
|
|
|
EXIT,
|
2011-03-18 19:24:28 +00:00
|
|
|
RET,
|
2011-08-09 17:36:31 +00:00
|
|
|
COPY_ADDRESS,
|
|
|
|
CALL
|
2010-09-18 18:52:28 +00:00
|
|
|
};
|
2011-06-23 18:10:03 +00:00
|
|
|
} // namespace PTXISD
|
2010-09-18 18:52:28 +00:00
|
|
|
|
|
|
|
class PTXTargetLowering : public TargetLowering {
|
|
|
|
public:
|
|
|
|
explicit PTXTargetLowering(TargetMachine &TM);
|
|
|
|
|
|
|
|
virtual const char *getTargetNodeName(unsigned Opcode) const;
|
|
|
|
|
2010-12-22 10:38:51 +00:00
|
|
|
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
|
2011-04-28 00:19:56 +00:00
|
|
|
virtual SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const;
|
2011-06-16 15:17:11 +00:00
|
|
|
|
2010-09-18 18:52:28 +00:00
|
|
|
virtual SDValue
|
|
|
|
LowerFormalArguments(SDValue Chain,
|
|
|
|
CallingConv::ID CallConv,
|
|
|
|
bool isVarArg,
|
|
|
|
const SmallVectorImpl<ISD::InputArg> &Ins,
|
|
|
|
DebugLoc dl,
|
|
|
|
SelectionDAG &DAG,
|
|
|
|
SmallVectorImpl<SDValue> &InVals) const;
|
|
|
|
|
|
|
|
virtual SDValue
|
|
|
|
LowerReturn(SDValue Chain,
|
|
|
|
CallingConv::ID CallConv,
|
|
|
|
bool isVarArg,
|
|
|
|
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
|
|
|
const SmallVectorImpl<SDValue> &OutVals,
|
|
|
|
DebugLoc dl,
|
|
|
|
SelectionDAG &DAG) const;
|
2011-06-16 15:17:11 +00:00
|
|
|
|
2011-08-09 17:36:31 +00:00
|
|
|
virtual SDValue
|
|
|
|
LowerCall(SDValue Chain, SDValue Callee,
|
|
|
|
CallingConv::ID CallConv, bool isVarArg,
|
|
|
|
bool &isTailCall,
|
|
|
|
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
|
|
|
const SmallVectorImpl<SDValue> &OutVals,
|
|
|
|
const SmallVectorImpl<ISD::InputArg> &Ins,
|
|
|
|
DebugLoc dl, SelectionDAG &DAG,
|
|
|
|
SmallVectorImpl<SDValue> &InVals) const;
|
|
|
|
|
2011-09-06 19:07:46 +00:00
|
|
|
virtual EVT getSetCCResultType(EVT VT) const;
|
2011-06-16 15:17:11 +00:00
|
|
|
|
2011-10-09 15:42:02 +00:00
|
|
|
virtual unsigned getNumRegisters(LLVMContext &Context, EVT VT);
|
|
|
|
|
2010-12-22 10:38:51 +00:00
|
|
|
private:
|
|
|
|
SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
|
2010-09-18 18:52:28 +00:00
|
|
|
}; // class PTXTargetLowering
|
|
|
|
} // namespace llvm
|
|
|
|
|
|
|
|
#endif // PTX_ISEL_LOWERING_H
|