cf655a1dce7b5a0b44d382137973a9a8fd85f2bf
[mesa.git] / src / gallium / drivers / radeon / 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 // SI DAG Lowering interface definition
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef SIISELLOWERING_H
15 #define SIISELLOWERING_H
16
17 #include "AMDGPUISelLowering.h"
18 #include "SIInstrInfo.h"
19
20 namespace llvm {
21
22 class SITargetLowering : public AMDGPUTargetLowering
23 {
24 const SIInstrInfo * TII;
25
26 /// AppendS_WAITCNT - Memory reads and writes are syncronized using the
27 /// S_WAITCNT instruction. This function takes the most conservative
28 /// approach and inserts an S_WAITCNT instruction after every read and
29 /// write.
30 void AppendS_WAITCNT(MachineInstr *MI, MachineBasicBlock &BB,
31 MachineBasicBlock::iterator I) const;
32 void LowerSI_INTERP(MachineInstr *MI, MachineBasicBlock &BB,
33 MachineBasicBlock::iterator I, MachineRegisterInfo & MRI) const;
34 void LowerSI_INTERP_CONST(MachineInstr *MI, MachineBasicBlock &BB,
35 MachineBasicBlock::iterator I) const;
36 void LowerSI_V_CNDLT(MachineInstr *MI, MachineBasicBlock &BB,
37 MachineBasicBlock::iterator I, MachineRegisterInfo & MRI) const;
38
39 SDValue Loweri1ContextSwitch(SDValue Op, SelectionDAG &DAG,
40 unsigned VCCNode) const;
41 SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG) const;
42 SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG) const;
43 SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
44
45 public:
46 SITargetLowering(TargetMachine &tm);
47 virtual MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr * MI,
48 MachineBasicBlock * BB) const;
49 virtual EVT getSetCCResultType(EVT VT) const;
50 virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
51 virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
52 virtual const char* getTargetNodeName(unsigned Opcode) const;
53 };
54
55 } // End namespace llvm
56
57 #endif //SIISELLOWERING_H