2012-12-11 22:25:42 +01: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 18:26:38 +02:00
|
|
|
#ifndef LLVM_LIB_TARGET_R600_SIISELLOWERING_H
|
|
|
|
#define LLVM_LIB_TARGET_R600_SIISELLOWERING_H
|
2012-12-11 22:25:42 +01:00
|
|
|
|
|
|
|
#include "AMDGPUISelLowering.h"
|
|
|
|
#include "SIInstrInfo.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class SITargetLowering : public AMDGPUTargetLowering {
|
2013-10-23 02:44:32 +02:00
|
|
|
SDValue LowerParameter(SelectionDAG &DAG, EVT VT, EVT MemVT, SDLoc DL,
|
2014-04-11 22:59:54 +02:00
|
|
|
SDValue Chain, unsigned Offset, bool Signed) const;
|
2013-08-15 01:24:45 +02:00
|
|
|
SDValue LowerSampleIntrinsic(unsigned Opcode, const SDValue &Op,
|
|
|
|
SelectionDAG &DAG) const;
|
2014-07-21 16:01:14 +02:00
|
|
|
SDValue LowerGlobalAddress(AMDGPUMachineFunction *MFI, SDValue Op,
|
|
|
|
SelectionDAG &DAG) const override;
|
2014-07-26 08:23:37 +02:00
|
|
|
|
2015-11-30 22:15:45 +01:00
|
|
|
SDValue lowerImplicitZextParam(SelectionDAG &DAG, SDValue Op,
|
|
|
|
MVT VT, unsigned Offset) const;
|
|
|
|
|
2014-07-26 08:23:37 +02:00
|
|
|
SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue LowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG) const;
|
2014-07-21 17:45:01 +02:00
|
|
|
SDValue LowerFrameIndex(SDValue Op, SelectionDAG &DAG) const;
|
2013-11-14 00:36:50 +01:00
|
|
|
SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG) const;
|
2014-02-04 18:18:40 +01:00
|
|
|
SDValue LowerSELECT(SDValue Op, SelectionDAG &DAG) const;
|
2014-07-16 01:50:10 +02:00
|
|
|
SDValue LowerFastFDIV(SDValue Op, SelectionDAG &DAG) const;
|
2014-07-15 22:18:31 +02:00
|
|
|
SDValue LowerFDIV32(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue LowerFDIV64(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue LowerFDIV(SDValue Op, SelectionDAG &DAG) const;
|
2014-10-04 01:54:41 +02:00
|
|
|
SDValue LowerINT_TO_FP(SDValue Op, SelectionDAG &DAG, bool Signed) const;
|
2013-11-14 00:36:50 +01:00
|
|
|
SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG) const;
|
2014-07-19 20:44:39 +02:00
|
|
|
SDValue LowerTrig(SDValue Op, SelectionDAG &DAG) const;
|
2012-12-19 23:10:31 +01:00
|
|
|
SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG) const;
|
2012-12-11 22:25:42 +01:00
|
|
|
|
2013-04-10 10:39:08 +02:00
|
|
|
void adjustWritemask(MachineSDNode *&N, SelectionDAG &DAG) const;
|
|
|
|
|
2015-01-14 02:35:22 +01:00
|
|
|
SDValue performUCharToFloatCombine(SDNode *N,
|
|
|
|
DAGCombinerInfo &DCI) const;
|
2014-08-15 19:49:05 +02:00
|
|
|
SDValue performSHLPtrCombine(SDNode *N,
|
|
|
|
unsigned AS,
|
|
|
|
DAGCombinerInfo &DCI) const;
|
2015-01-07 00:00:46 +01:00
|
|
|
SDValue performAndCombine(SDNode *N, DAGCombinerInfo &DCI) const;
|
2015-01-07 00:00:39 +01:00
|
|
|
SDValue performOrCombine(SDNode *N, DAGCombinerInfo &DCI) const;
|
|
|
|
SDValue performClassCombine(SDNode *N, DAGCombinerInfo &DCI) const;
|
2014-06-11 19:50:44 +02:00
|
|
|
|
2014-11-14 21:08:52 +01:00
|
|
|
SDValue performMin3Max3Combine(SDNode *N, DAGCombinerInfo &DCI) const;
|
2015-01-07 00:00:41 +01:00
|
|
|
SDValue performSetCCCombine(SDNode *N, DAGCombinerInfo &DCI) const;
|
2014-11-14 21:08:52 +01:00
|
|
|
|
2015-07-20 16:28:41 +02:00
|
|
|
bool isLegalFlatAddressingMode(const AddrMode &AM) const;
|
2015-08-07 22:18:34 +02:00
|
|
|
bool isLegalMUBUFAddressingMode(const AddrMode &AM) const;
|
2012-12-11 22:25:42 +01:00
|
|
|
public:
|
2015-01-31 00:24:40 +01:00
|
|
|
SITargetLowering(TargetMachine &tm, const AMDGPUSubtarget &STI);
|
2014-08-15 19:17:07 +02:00
|
|
|
|
2014-10-21 18:25:08 +02:00
|
|
|
bool isShuffleMaskLegal(const SmallVectorImpl<int> &/*Mask*/,
|
|
|
|
EVT /*VT*/) const override;
|
|
|
|
|
2015-07-09 04:09:40 +02:00
|
|
|
bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty,
|
|
|
|
unsigned AS) const override;
|
2014-08-15 19:17:07 +02:00
|
|
|
|
2014-07-27 19:46:40 +02:00
|
|
|
bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AS,
|
|
|
|
unsigned Align,
|
|
|
|
bool *IsFast) const override;
|
2014-07-03 02:23:43 +02:00
|
|
|
|
2014-07-28 19:49:26 +02:00
|
|
|
EVT getOptimalMemOpType(uint64_t Size, unsigned DstAlign,
|
|
|
|
unsigned SrcAlign, bool IsMemset,
|
|
|
|
bool ZeroMemset,
|
|
|
|
bool MemcpyStrSrc,
|
|
|
|
MachineFunction &MF) const override;
|
|
|
|
|
2015-12-15 21:55:55 +01:00
|
|
|
bool isMemOpUniform(const SDNode *N) const;
|
2015-12-02 00:04:00 +01:00
|
|
|
bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override;
|
|
|
|
|
2014-07-03 02:23:43 +02:00
|
|
|
TargetLoweringBase::LegalizeTypeAction
|
|
|
|
getPreferredVectorAction(EVT VT) const override;
|
2013-03-07 10:03:52 +01:00
|
|
|
|
2014-04-29 09:57:24 +02:00
|
|
|
bool shouldConvertConstantLoadToIntImm(const APInt &Imm,
|
|
|
|
Type *Ty) const override;
|
2014-03-31 21:54:27 +02:00
|
|
|
|
2013-03-07 10:03:52 +01:00
|
|
|
SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv,
|
|
|
|
bool isVarArg,
|
|
|
|
const SmallVectorImpl<ISD::InputArg> &Ins,
|
2013-05-25 04:42:55 +02:00
|
|
|
SDLoc DL, SelectionDAG &DAG,
|
2014-04-29 09:57:24 +02:00
|
|
|
SmallVectorImpl<SDValue> &InVals) const override;
|
2013-03-07 10:03:52 +01:00
|
|
|
|
2014-04-29 09:57:24 +02:00
|
|
|
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr * MI,
|
|
|
|
MachineBasicBlock * BB) const override;
|
2015-01-29 20:34:32 +01:00
|
|
|
bool enableAggressiveFMAFusion(EVT VT) const override;
|
2015-07-09 04:09:04 +02:00
|
|
|
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context,
|
|
|
|
EVT VT) const override;
|
2015-07-09 17:12:23 +02:00
|
|
|
MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override;
|
2014-04-29 09:57:24 +02:00
|
|
|
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 18:52:23 +01:00
|
|
|
|
|
|
|
int32_t analyzeImmediate(const SDNode *N) const;
|
2013-06-03 19:40:18 +02:00
|
|
|
SDValue CreateLiveInRegister(SelectionDAG &DAG, const TargetRegisterClass *RC,
|
2014-04-29 09:57:24 +02:00
|
|
|
unsigned Reg, EVT VT) const override;
|
2014-10-09 21:06:00 +02:00
|
|
|
void legalizeTargetIndependentNode(SDNode *Node, SelectionDAG &DAG) const;
|
2014-11-05 20:01:17 +01:00
|
|
|
|
|
|
|
MachineSDNode *wrapAddr64Rsrc(SelectionDAG &DAG, SDLoc DL, SDValue Ptr) const;
|
2014-11-05 20:01:19 +01:00
|
|
|
MachineSDNode *buildRSRC(SelectionDAG &DAG,
|
|
|
|
SDLoc DL,
|
|
|
|
SDValue Ptr,
|
|
|
|
uint32_t RsrcDword1,
|
|
|
|
uint64_t RsrcDword2And3) const;
|
2015-07-05 21:29:18 +02:00
|
|
|
std::pair<unsigned, const TargetRegisterClass *>
|
|
|
|
getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
|
|
|
|
StringRef Constraint, MVT VT) const override;
|
2015-12-10 03:12:53 +01:00
|
|
|
ConstraintType getConstraintType(StringRef Constraint) const override;
|
2015-05-12 16:18:14 +02:00
|
|
|
SDValue copyToM0(SelectionDAG &DAG, SDValue Chain, SDLoc DL, SDValue V) const;
|
2012-12-11 22:25:42 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End namespace llvm
|
|
|
|
|
2014-08-13 18:26:38 +02:00
|
|
|
#endif
|