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