1 //===-- SIISelLowering.h - SI DAG Lowering Interface ------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief SI DAG Lowering interface definition
13 //===----------------------------------------------------------------------===//
15 #ifndef SIISELLOWERING_H
16 #define SIISELLOWERING_H
18 #include "AMDGPUISelLowering.h"
19 #include "SIInstrInfo.h"
23 class SITargetLowering : public AMDGPUTargetLowering {
24 SDValue LowerParameter(SelectionDAG &DAG, EVT VT, SDLoc DL,
25 SDValue Chain, unsigned Offset) const;
26 SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
27 SDValue LowerSIGN_EXTEND(SDValue Op, SelectionDAG &DAG) const;
28 SDValue LowerZERO_EXTEND(SDValue Op, SelectionDAG &DAG) const;
29 SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG) const;
31 bool foldImm(SDValue &Operand, int32_t &Immediate,
32 bool &ScalarSlotUsed) const;
33 const TargetRegisterClass *getRegClassForNode(SelectionDAG &DAG,
34 const SDValue &Op) const;
35 bool fitsRegClass(SelectionDAG &DAG, const SDValue &Op,
36 unsigned RegClass) const;
37 void ensureSRegLimit(SelectionDAG &DAG, SDValue &Operand,
38 unsigned RegClass, bool &ScalarSlotUsed) const;
40 SDNode *foldOperands(MachineSDNode *N, SelectionDAG &DAG) const;
41 void adjustWritemask(MachineSDNode *&N, SelectionDAG &DAG) const;
42 MachineSDNode *AdjustRegClass(MachineSDNode *N, SelectionDAG &DAG) const;
45 SITargetLowering(TargetMachine &tm);
46 bool allowsUnalignedMemoryAccesses(EVT VT, bool *IsFast) const;
48 SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv,
50 const SmallVectorImpl<ISD::InputArg> &Ins,
51 SDLoc DL, SelectionDAG &DAG,
52 SmallVectorImpl<SDValue> &InVals) const;
54 virtual MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr * MI,
55 MachineBasicBlock * BB) const;
56 virtual EVT getSetCCResultType(LLVMContext &Context, EVT VT) const;
57 virtual MVT getScalarShiftAmountTy(EVT VT) const;
58 virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
59 virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
60 virtual SDNode *PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const;
61 virtual void AdjustInstrPostInstrSelection(MachineInstr *MI,
64 int32_t analyzeImmediate(const SDNode *N) const;
65 SDValue CreateLiveInRegister(SelectionDAG &DAG, const TargetRegisterClass *RC,
66 unsigned Reg, EVT VT) const;
69 } // End namespace llvm
71 #endif //SIISELLOWERING_H