d0978e76a8bc50472fb92675007dbd14630e71d4
[oota-llvm.git] / 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     EXIT
28   };
29 } // namespace PTXISD
30
31 class PTXTargetLowering : public TargetLowering {
32   public:
33     explicit PTXTargetLowering(TargetMachine &TM);
34
35     virtual const char *getTargetNodeName(unsigned Opcode) const;
36
37     virtual unsigned getFunctionAlignment(const Function *F) const {
38       return 2; }
39
40     virtual SDValue
41       LowerFormalArguments(SDValue Chain,
42                            CallingConv::ID CallConv,
43                            bool isVarArg,
44                            const SmallVectorImpl<ISD::InputArg> &Ins,
45                            DebugLoc dl,
46                            SelectionDAG &DAG,
47                            SmallVectorImpl<SDValue> &InVals) const;
48
49     virtual SDValue
50       LowerReturn(SDValue Chain,
51                   CallingConv::ID CallConv,
52                   bool isVarArg,
53                   const SmallVectorImpl<ISD::OutputArg> &Outs,
54                   const SmallVectorImpl<SDValue> &OutVals,
55                   DebugLoc dl,
56                   SelectionDAG &DAG) const;
57 }; // class PTXTargetLowering
58 } // namespace llvm
59
60 #endif // PTX_ISEL_LOWERING_H