Eric Christopher | 50880d0 | 2010-09-18 18:52:28 +0000 | [diff] [blame] | 1 | //==-- 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 | |
| 20 | namespace llvm { |
| 21 | class PTXSubtarget; |
| 22 | class PTXTargetMachine; |
| 23 | |
| 24 | namespace PTXISD { |
| 25 | enum NodeType { |
| 26 | FIRST_NUMBER = ISD::BUILTIN_OP_END, |
Justin Holewinski | a5ccb4e | 2011-06-23 18:10:05 +0000 | [diff] [blame^] | 27 | LOAD_PARAM, |
Justin Holewinski | 67a9184 | 2011-06-23 18:10:03 +0000 | [diff] [blame] | 28 | STORE_PARAM, |
Che-Liang Chiou | f9930da | 2010-09-25 07:46:17 +0000 | [diff] [blame] | 29 | EXIT, |
Justin Holewinski | 8af78c9 | 2011-03-18 19:24:28 +0000 | [diff] [blame] | 30 | RET, |
| 31 | COPY_ADDRESS |
Eric Christopher | 50880d0 | 2010-09-18 18:52:28 +0000 | [diff] [blame] | 32 | }; |
Justin Holewinski | 67a9184 | 2011-06-23 18:10:03 +0000 | [diff] [blame] | 33 | } // namespace PTXISD |
Eric Christopher | 50880d0 | 2010-09-18 18:52:28 +0000 | [diff] [blame] | 34 | |
| 35 | class PTXTargetLowering : public TargetLowering { |
| 36 | public: |
| 37 | explicit PTXTargetLowering(TargetMachine &TM); |
| 38 | |
| 39 | virtual const char *getTargetNodeName(unsigned Opcode) const; |
| 40 | |
Che-Liang Chiou | fc7072c | 2010-12-22 10:38:51 +0000 | [diff] [blame] | 41 | virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const; |
| 42 | |
Justin Holewinski | 2d525c5 | 2011-04-28 00:19:56 +0000 | [diff] [blame] | 43 | virtual SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const; |
Justin Holewinski | ec3141b | 2011-06-16 15:17:11 +0000 | [diff] [blame] | 44 | |
Eric Christopher | 50880d0 | 2010-09-18 18:52:28 +0000 | [diff] [blame] | 45 | 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 Holewinski | ec3141b | 2011-06-16 15:17:11 +0000 | [diff] [blame] | 62 | |
Justin Holewinski | 2d525c5 | 2011-04-28 00:19:56 +0000 | [diff] [blame] | 63 | virtual MVT::SimpleValueType getSetCCResultType(EVT VT) const; |
Justin Holewinski | ec3141b | 2011-06-16 15:17:11 +0000 | [diff] [blame] | 64 | |
Che-Liang Chiou | fc7072c | 2010-12-22 10:38:51 +0000 | [diff] [blame] | 65 | private: |
| 66 | SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const; |
Eric Christopher | 50880d0 | 2010-09-18 18:52:28 +0000 | [diff] [blame] | 67 | }; // class PTXTargetLowering |
| 68 | } // namespace llvm |
| 69 | |
| 70 | #endif // PTX_ISEL_LOWERING_H |