blob: d65622526f205ec4225d381d2237c41152f85620 [file] [log] [blame]
Tom Stellard75aadc22012-12-11 21:25:42 +00001//===-- 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
21namespace llvm {
22
23class SITargetLowering : public AMDGPUTargetLowering {
24 const SIInstrInfo * TII;
Christian Konigf82901a2013-02-26 17:52:23 +000025 const TargetRegisterInfo * TRI;
Tom Stellard75aadc22012-12-11 21:25:42 +000026
Tom Stellard75aadc22012-12-11 21:25:42 +000027 void LowerSI_WQM(MachineInstr *MI, MachineBasicBlock &BB,
28 MachineBasicBlock::iterator I, MachineRegisterInfo & MRI) const;
Tom Stellard75aadc22012-12-11 21:25:42 +000029
Tom Stellard75aadc22012-12-11 21:25:42 +000030 SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
Tom Stellardf8794352012-12-19 22:10:31 +000031 SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG) const;
Tom Stellard75aadc22012-12-11 21:25:42 +000032
Christian Konigf82901a2013-02-26 17:52:23 +000033 bool foldImm(SDValue &Operand, int32_t &Immediate,
34 bool &ScalarSlotUsed) const;
35 bool fitsRegClass(SelectionDAG &DAG, SDValue &Op, unsigned RegClass) const;
36 void ensureSRegLimit(SelectionDAG &DAG, SDValue &Operand,
37 unsigned RegClass, bool &ScalarSlotUsed) const;
38
Tom Stellard75aadc22012-12-11 21:25:42 +000039public:
40 SITargetLowering(TargetMachine &tm);
Christian Konig2c8f6d52013-03-07 09:03:52 +000041
42 SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv,
43 bool isVarArg,
44 const SmallVectorImpl<ISD::InputArg> &Ins,
45 DebugLoc DL, SelectionDAG &DAG,
46 SmallVectorImpl<SDValue> &InVals) const;
47
Tom Stellard75aadc22012-12-11 21:25:42 +000048 virtual MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr * MI,
49 MachineBasicBlock * BB) const;
50 virtual EVT getSetCCResultType(EVT VT) const;
Christian Konig082a14a2013-03-18 11:34:05 +000051 virtual MVT getScalarShiftAmountTy(EVT VT) const;
Tom Stellard75aadc22012-12-11 21:25:42 +000052 virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
53 virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Christian Konigd910b7d2013-02-26 17:52:16 +000054 virtual SDNode *PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const;
Christian Konigf82901a2013-02-26 17:52:23 +000055
56 int32_t analyzeImmediate(const SDNode *N) const;
Tom Stellard75aadc22012-12-11 21:25:42 +000057};
58
59} // End namespace llvm
60
61#endif //SIISELLOWERING_H