2012-12-11 21:25:42 +00:00
|
|
|
//===-- SIISelLowering.h - SI DAG Lowering Interface ------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
/// \file
|
|
|
|
/// \brief SI DAG Lowering interface definition
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef SIISELLOWERING_H
|
|
|
|
#define SIISELLOWERING_H
|
|
|
|
|
|
|
|
#include "AMDGPUISelLowering.h"
|
|
|
|
#include "SIInstrInfo.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class SITargetLowering : public AMDGPUTargetLowering {
|
2013-06-03 17:40:18 +00:00
|
|
|
SDValue LowerParameter(SelectionDAG &DAG, EVT VT, SDLoc DL,
|
|
|
|
SDValue Chain, unsigned Offset) const;
|
2013-08-14 23:24:45 +00:00
|
|
|
SDValue LowerSampleIntrinsic(unsigned Opcode, const SDValue &Op,
|
|
|
|
SelectionDAG &DAG) const;
|
2012-12-11 21:25:42 +00:00
|
|
|
SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
|
2013-06-03 17:40:03 +00:00
|
|
|
SDValue LowerSIGN_EXTEND(SDValue Op, SelectionDAG &DAG) const;
|
2013-08-01 15:23:26 +00:00
|
|
|
SDValue LowerZERO_EXTEND(SDValue Op, SelectionDAG &DAG) const;
|
2012-12-19 22:10:31 +00:00
|
|
|
SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG) const;
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2013-08-14 23:24:45 +00:00
|
|
|
SDValue ResourceDescriptorToi128(SDValue Op, SelectionDAG &DAG) const;
|
2013-02-26 17:52:23 +00:00
|
|
|
bool foldImm(SDValue &Operand, int32_t &Immediate,
|
|
|
|
bool &ScalarSlotUsed) const;
|
2013-08-06 23:08:18 +00:00
|
|
|
const TargetRegisterClass *getRegClassForNode(SelectionDAG &DAG,
|
|
|
|
const SDValue &Op) const;
|
2013-05-20 15:02:01 +00:00
|
|
|
bool fitsRegClass(SelectionDAG &DAG, const SDValue &Op,
|
|
|
|
unsigned RegClass) const;
|
2013-05-18 00:21:46 +00:00
|
|
|
void ensureSRegLimit(SelectionDAG &DAG, SDValue &Operand,
|
2013-02-26 17:52:23 +00:00
|
|
|
unsigned RegClass, bool &ScalarSlotUsed) const;
|
|
|
|
|
2013-04-10 08:39:08 +00:00
|
|
|
SDNode *foldOperands(MachineSDNode *N, SelectionDAG &DAG) const;
|
|
|
|
void adjustWritemask(MachineSDNode *&N, SelectionDAG &DAG) const;
|
2013-06-03 17:39:58 +00:00
|
|
|
MachineSDNode *AdjustRegClass(MachineSDNode *N, SelectionDAG &DAG) const;
|
2013-04-10 08:39:08 +00:00
|
|
|
|
2012-12-11 21:25:42 +00:00
|
|
|
public:
|
|
|
|
SITargetLowering(TargetMachine &tm);
|
2013-06-25 02:39:35 +00:00
|
|
|
bool allowsUnalignedMemoryAccesses(EVT VT, bool *IsFast) const;
|
2013-08-14 23:25:00 +00:00
|
|
|
virtual bool shouldSplitVectorElementType(EVT VT) const;
|
2013-03-07 09:03:52 +00:00
|
|
|
|
|
|
|
SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv,
|
|
|
|
bool isVarArg,
|
|
|
|
const SmallVectorImpl<ISD::InputArg> &Ins,
|
2013-05-25 02:42:55 +00:00
|
|
|
SDLoc DL, SelectionDAG &DAG,
|
2013-03-07 09:03:52 +00:00
|
|
|
SmallVectorImpl<SDValue> &InVals) const;
|
|
|
|
|
2012-12-11 21:25:42 +00:00
|
|
|
virtual MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr * MI,
|
|
|
|
MachineBasicBlock * BB) const;
|
2013-05-18 00:21:46 +00:00
|
|
|
virtual EVT getSetCCResultType(LLVMContext &Context, EVT VT) const;
|
2013-03-18 11:34:05 +00:00
|
|
|
virtual MVT getScalarShiftAmountTy(EVT VT) const;
|
2013-08-10 10:38:54 +00:00
|
|
|
virtual bool isFMAFasterThanFMulAndFAdd(EVT VT) const;
|
2012-12-11 21:25:42 +00:00
|
|
|
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
|
2013-02-26 17:52:16 +00:00
|
|
|
virtual SDNode *PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const;
|
2013-04-10 08:39:16 +00:00
|
|
|
virtual void AdjustInstrPostInstrSelection(MachineInstr *MI,
|
|
|
|
SDNode *Node) const;
|
2013-02-26 17:52:23 +00:00
|
|
|
|
|
|
|
int32_t analyzeImmediate(const SDNode *N) const;
|
2013-06-03 17:40:18 +00:00
|
|
|
SDValue CreateLiveInRegister(SelectionDAG &DAG, const TargetRegisterClass *RC,
|
|
|
|
unsigned Reg, EVT VT) const;
|
2012-12-11 21:25:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End namespace llvm
|
|
|
|
|
|
|
|
#endif //SIISELLOWERING_H
|