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
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-13 16:26:38 +00:00
|
|
|
#ifndef LLVM_LIB_TARGET_R600_SIISELLOWERING_H
|
|
|
|
#define LLVM_LIB_TARGET_R600_SIISELLOWERING_H
|
2012-12-11 21:25:42 +00:00
|
|
|
|
|
|
|
#include "AMDGPUISelLowering.h"
|
|
|
|
#include "SIInstrInfo.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class SITargetLowering : public AMDGPUTargetLowering {
|
2013-10-23 00:44:32 +00:00
|
|
|
SDValue LowerParameter(SelectionDAG &DAG, EVT VT, EVT MemVT, SDLoc DL,
|
2014-04-11 20:59:54 +00:00
|
|
|
SDValue Chain, unsigned Offset, bool Signed) const;
|
2013-08-14 23:24:45 +00:00
|
|
|
SDValue LowerSampleIntrinsic(unsigned Opcode, const SDValue &Op,
|
|
|
|
SelectionDAG &DAG) const;
|
2014-07-21 14:01:14 +00:00
|
|
|
SDValue LowerGlobalAddress(AMDGPUMachineFunction *MFI, SDValue Op,
|
|
|
|
SelectionDAG &DAG) const override;
|
2014-07-26 06:23:37 +00:00
|
|
|
|
|
|
|
SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue LowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG) const;
|
2014-07-21 15:45:01 +00:00
|
|
|
SDValue LowerFrameIndex(SDValue Op, SelectionDAG &DAG) const;
|
2013-11-13 23:36:50 +00:00
|
|
|
SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG) const;
|
2014-02-04 17:18:40 +00:00
|
|
|
SDValue LowerSELECT(SDValue Op, SelectionDAG &DAG) const;
|
2014-07-15 23:50:10 +00:00
|
|
|
SDValue LowerFastFDIV(SDValue Op, SelectionDAG &DAG) const;
|
2014-07-15 20:18:31 +00:00
|
|
|
SDValue LowerFDIV32(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue LowerFDIV64(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue LowerFDIV(SDValue Op, SelectionDAG &DAG) const;
|
2013-11-13 23:36:50 +00:00
|
|
|
SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG) const;
|
2014-07-19 18:44:39 +00:00
|
|
|
SDValue LowerTrig(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-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;
|
|
|
|
|
2014-09-17 15:35:43 +00:00
|
|
|
SDNode *legalizeOperands(MachineSDNode *N, SelectionDAG &DAG) const;
|
2013-04-10 08:39:08 +00:00
|
|
|
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
|
|
|
|
2014-06-11 17:50:44 +00:00
|
|
|
static SDValue performUCharToFloatCombine(SDNode *N,
|
|
|
|
DAGCombinerInfo &DCI);
|
2014-08-15 17:49:05 +00:00
|
|
|
SDValue performSHLPtrCombine(SDNode *N,
|
|
|
|
unsigned AS,
|
|
|
|
DAGCombinerInfo &DCI) const;
|
2014-06-11 17:50:44 +00:00
|
|
|
|
2012-12-11 21:25:42 +00:00
|
|
|
public:
|
|
|
|
SITargetLowering(TargetMachine &tm);
|
2014-08-15 17:17:07 +00:00
|
|
|
|
|
|
|
bool isLegalAddressingMode(const AddrMode &AM,
|
|
|
|
Type *Ty) const override;
|
|
|
|
|
2014-07-27 17:46:40 +00:00
|
|
|
bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AS,
|
|
|
|
unsigned Align,
|
|
|
|
bool *IsFast) const override;
|
2014-07-03 00:23:43 +00:00
|
|
|
|
2014-07-28 17:49:26 +00:00
|
|
|
EVT getOptimalMemOpType(uint64_t Size, unsigned DstAlign,
|
|
|
|
unsigned SrcAlign, bool IsMemset,
|
|
|
|
bool ZeroMemset,
|
|
|
|
bool MemcpyStrSrc,
|
|
|
|
MachineFunction &MF) const override;
|
|
|
|
|
2014-07-03 00:23:43 +00:00
|
|
|
TargetLoweringBase::LegalizeTypeAction
|
|
|
|
getPreferredVectorAction(EVT VT) const override;
|
2013-03-07 09:03:52 +00:00
|
|
|
|
2014-04-29 07:57:24 +00:00
|
|
|
bool shouldConvertConstantLoadToIntImm(const APInt &Imm,
|
|
|
|
Type *Ty) const override;
|
2014-03-31 19:54:27 +00:00
|
|
|
|
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,
|
2014-04-29 07:57:24 +00:00
|
|
|
SmallVectorImpl<SDValue> &InVals) const override;
|
2013-03-07 09:03:52 +00:00
|
|
|
|
2014-04-29 07:57:24 +00:00
|
|
|
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr * MI,
|
|
|
|
MachineBasicBlock * BB) const override;
|
|
|
|
EVT getSetCCResultType(LLVMContext &Context, EVT VT) const override;
|
|
|
|
MVT getScalarShiftAmountTy(EVT VT) const override;
|
|
|
|
bool isFMAFasterThanFMulAndFAdd(EVT VT) const override;
|
|
|
|
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
|
|
|
|
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
|
|
|
|
SDNode *PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const override;
|
|
|
|
void AdjustInstrPostInstrSelection(MachineInstr *MI,
|
|
|
|
SDNode *Node) const override;
|
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,
|
2014-04-29 07:57:24 +00:00
|
|
|
unsigned Reg, EVT VT) const override;
|
2012-12-11 21:25:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End namespace llvm
|
|
|
|
|
2014-08-13 16:26:38 +00:00
|
|
|
#endif
|