If a global variable has a specified alignment that is less than the preferred
[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     READ_PARAM,
28     EXIT,
29     RET,
30     COPY_ADDRESS
31   };
32 } // namespace PTXISD
33
34 class PTXTargetLowering : public TargetLowering {
35   public:
36     explicit PTXTargetLowering(TargetMachine &TM);
37
38     virtual const char *getTargetNodeName(unsigned Opcode) const;
39
40     virtual unsigned getFunctionAlignment(const Function *F) const {
41       return 2; }
42
43     virtual SDValue LowerOperation(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   private:
64     SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
65 }; // class PTXTargetLowering
66 } // namespace llvm
67
68 #endif // PTX_ISEL_LOWERING_H