]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/llvm/lib/Target/R600/SIISelLowering.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / llvm / lib / Target / R600 / SIISelLowering.h
1 //===-- SIISelLowering.h - SI 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 /// \file
11 /// \brief SI DAG Lowering interface definition
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef SIISELLOWERING_H
16 #define SIISELLOWERING_H
17
18 #include "AMDGPUISelLowering.h"
19 #include "SIInstrInfo.h"
20
21 namespace llvm {
22
23 class SITargetLowering : public AMDGPUTargetLowering {
24   const SIInstrInfo * TII;
25   const TargetRegisterInfo * TRI;
26
27   SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG) const;
28   SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
29   SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG) const;
30
31   bool foldImm(SDValue &Operand, int32_t &Immediate,
32                bool &ScalarSlotUsed) const;
33   bool fitsRegClass(SelectionDAG &DAG, SDValue &Op, unsigned RegClass) const;
34   void ensureSRegLimit(SelectionDAG &DAG, SDValue &Operand, 
35                        unsigned RegClass, bool &ScalarSlotUsed) const;
36
37   SDNode *foldOperands(MachineSDNode *N, SelectionDAG &DAG) const;
38   void adjustWritemask(MachineSDNode *&N, SelectionDAG &DAG) const;
39
40 public:
41   SITargetLowering(TargetMachine &tm);
42
43   SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv,
44                                bool isVarArg,
45                                const SmallVectorImpl<ISD::InputArg> &Ins,
46                                DebugLoc DL, SelectionDAG &DAG,
47                                SmallVectorImpl<SDValue> &InVals) const;
48
49   virtual MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr * MI,
50                                               MachineBasicBlock * BB) const;
51   virtual EVT getSetCCResultType(EVT VT) const;
52   virtual MVT getScalarShiftAmountTy(EVT VT) const;
53   virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
54   virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
55   virtual SDNode *PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const;
56   virtual void AdjustInstrPostInstrSelection(MachineInstr *MI,
57                                              SDNode *Node) const;
58
59   int32_t analyzeImmediate(const SDNode *N) const;
60 };
61
62 } // End namespace llvm
63
64 #endif //SIISELLOWERING_H