blob: 43185416e1fc7fca8e4a5ed5c85e986b72c4f58d [file] [log] [blame]
Eric Christopher50880d02010-09-18 18:52:28 +00001//==-- PTXISelLowering.h - PTX DAG Lowering Interface ------------*- C++ -*-==//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the interfaces that PTX uses to lower LLVM code into a
11// selection DAG.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef PTX_ISEL_LOWERING_H
16#define PTX_ISEL_LOWERING_H
17
18#include "llvm/Target/TargetLowering.h"
19
20namespace llvm {
21class PTXSubtarget;
22class PTXTargetMachine;
23
24namespace PTXISD {
25 enum NodeType {
26 FIRST_NUMBER = ISD::BUILTIN_OP_END,
Justin Holewinskia5ccb4e2011-06-23 18:10:05 +000027 LOAD_PARAM,
Justin Holewinski67a91842011-06-23 18:10:03 +000028 STORE_PARAM,
Che-Liang Chiouf9930da2010-09-25 07:46:17 +000029 EXIT,
Justin Holewinski8af78c92011-03-18 19:24:28 +000030 RET,
31 COPY_ADDRESS
Eric Christopher50880d02010-09-18 18:52:28 +000032 };
Justin Holewinski67a91842011-06-23 18:10:03 +000033} // namespace PTXISD
Eric Christopher50880d02010-09-18 18:52:28 +000034
35class PTXTargetLowering : public TargetLowering {
36 public:
37 explicit PTXTargetLowering(TargetMachine &TM);
38
39 virtual const char *getTargetNodeName(unsigned Opcode) const;
40
Che-Liang Chioufc7072c2010-12-22 10:38:51 +000041 virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
42
Justin Holewinski2d525c52011-04-28 00:19:56 +000043 virtual SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const;
Justin Holewinskiec3141b2011-06-16 15:17:11 +000044
Eric Christopher50880d02010-09-18 18:52:28 +000045 virtual SDValue
46 LowerFormalArguments(SDValue Chain,
47 CallingConv::ID CallConv,
48 bool isVarArg,
49 const SmallVectorImpl<ISD::InputArg> &Ins,
50 DebugLoc dl,
51 SelectionDAG &DAG,
52 SmallVectorImpl<SDValue> &InVals) const;
53
54 virtual SDValue
55 LowerReturn(SDValue Chain,
56 CallingConv::ID CallConv,
57 bool isVarArg,
58 const SmallVectorImpl<ISD::OutputArg> &Outs,
59 const SmallVectorImpl<SDValue> &OutVals,
60 DebugLoc dl,
61 SelectionDAG &DAG) const;
Justin Holewinskiec3141b2011-06-16 15:17:11 +000062
Justin Holewinski2d525c52011-04-28 00:19:56 +000063 virtual MVT::SimpleValueType getSetCCResultType(EVT VT) const;
Justin Holewinskiec3141b2011-06-16 15:17:11 +000064
Che-Liang Chioufc7072c2010-12-22 10:38:51 +000065 private:
66 SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
Eric Christopher50880d02010-09-18 18:52:28 +000067}; // class PTXTargetLowering
68} // namespace llvm
69
70#endif // PTX_ISEL_LOWERING_H