LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIISelLowering.h
Go to the documentation of this file.
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 
24  SDValue LowerParameter(SelectionDAG &DAG, EVT VT, EVT MemVT, SDLoc DL,
25  SDValue Chain, unsigned Offset) const;
26  SDValue LowerSampleIntrinsic(unsigned Opcode, const SDValue &Op,
27  SelectionDAG &DAG) const;
28  SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG) const;
29  SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
30  SDValue LowerSIGN_EXTEND(SDValue Op, SelectionDAG &DAG) const;
31  SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG) const;
32  SDValue LowerZERO_EXTEND(SDValue Op, SelectionDAG &DAG) const;
33  SDValue LowerADD(SDValue Op, SelectionDAG &DAG) const;
34  SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG) const;
35 
36  SDValue ResourceDescriptorToi128(SDValue Op, SelectionDAG &DAG) const;
37  bool foldImm(SDValue &Operand, int32_t &Immediate,
38  bool &ScalarSlotUsed) const;
39  const TargetRegisterClass *getRegClassForNode(SelectionDAG &DAG,
40  const SDValue &Op) const;
41  bool fitsRegClass(SelectionDAG &DAG, const SDValue &Op,
42  unsigned RegClass) const;
43  void ensureSRegLimit(SelectionDAG &DAG, SDValue &Operand,
44  unsigned RegClass, bool &ScalarSlotUsed) const;
45 
46  SDNode *foldOperands(MachineSDNode *N, SelectionDAG &DAG) const;
47  void adjustWritemask(MachineSDNode *&N, SelectionDAG &DAG) const;
48  MachineSDNode *AdjustRegClass(MachineSDNode *N, SelectionDAG &DAG) const;
49 
50 public:
52  bool allowsUnalignedMemoryAccesses(EVT VT, bool *IsFast) const;
53  virtual bool shouldSplitVectorElementType(EVT VT) const;
54 
56  bool isVarArg,
58  SDLoc DL, SelectionDAG &DAG,
59  SmallVectorImpl<SDValue> &InVals) const;
60 
62  MachineBasicBlock * BB) const;
63  virtual EVT getSetCCResultType(LLVMContext &Context, EVT VT) const;
64  virtual MVT getScalarShiftAmountTy(EVT VT) const;
65  virtual bool isFMAFasterThanFMulAndFAdd(EVT VT) const;
66  virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
67  virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
68  virtual SDNode *PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const;
70  SDNode *Node) const;
71 
72  int32_t analyzeImmediate(const SDNode *N) const;
74  unsigned Reg, EVT VT) const;
75 };
76 
77 } // End namespace llvm
78 
79 #endif //SIISELLOWERING_H
virtual EVT getSetCCResultType(LLVMContext &Context, EVT VT) const
SITargetLowering(TargetMachine &tm)
virtual bool shouldSplitVectorElementType(EVT VT) const
int32_t analyzeImmediate(const SDNode *N) const
Analyze the possible immediate value Op.
bool allowsUnalignedMemoryAccesses(EVT VT, bool *IsFast) const
Determine if the target supports unaligned memory accesses.
ID
LLVM Calling Convention Representation.
Definition: CallingConv.h:26
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const
virtual MVT getScalarShiftAmountTy(EVT VT) const
virtual bool isFMAFasterThanFMulAndFAdd(EVT VT) const
virtual MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *BB) const
virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const
virtual void AdjustInstrPostInstrSelection(MachineInstr *MI, SDNode *Node) const
Assign the register class depending on the number of bits set in the writemask.
Interface definition of the TargetLowering class that is common to all AMD GPUs.
SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl< ISD::InputArg > &Ins, SDLoc DL, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals) const
Interface definition for SIInstrInfo.
#define N
virtual SDNode * PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const
Fold the instructions after slecting them.
SDValue CreateLiveInRegister(SelectionDAG &DAG, const TargetRegisterClass *RC, unsigned Reg, EVT VT) const
Helper function that adds Reg to the LiveIn list of the DAG's MachineFunction.