]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/lib/Target/PTX/PTXISelLowering.h
Copy head to stable/9 as part of 9.0-RELEASE release cycle.
[FreeBSD/stable/9.git] / contrib / llvm / lib / Target / PTX / PTXISelLowering.h
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,
27     LOAD_PARAM,
28     STORE_PARAM,
29     EXIT,
30     RET,
31     COPY_ADDRESS
32   };
33 }                               // namespace PTXISD
34
35 class PTXTargetLowering : public TargetLowering {
36   public:
37     explicit PTXTargetLowering(TargetMachine &TM);
38
39     virtual const char *getTargetNodeName(unsigned Opcode) const;
40
41     virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
42
43     virtual SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const;
44
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;
62
63     virtual MVT::SimpleValueType getSetCCResultType(EVT VT) const;
64
65   private:
66     SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
67 }; // class PTXTargetLowering
68 } // namespace llvm
69
70 #endif // PTX_ISEL_LOWERING_H