2012-12-12 05:25:42 +08:00
|
|
|
//===-- R600ISelLowering.h - R600 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
|
2018-05-01 23:54:18 +08:00
|
|
|
/// R600 DAG Lowering interface definition
|
2012-12-12 05:25:42 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2016-03-11 16:00:27 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_AMDGPU_R600ISELLOWERING_H
|
|
|
|
#define LLVM_LIB_TARGET_AMDGPU_R600ISELLOWERING_H
|
2012-12-12 05:25:42 +08:00
|
|
|
|
|
|
|
#include "AMDGPUISelLowering.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class R600InstrInfo;
|
2016-06-24 14:30:11 +08:00
|
|
|
class R600Subtarget;
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2016-03-11 16:00:27 +08:00
|
|
|
class R600TargetLowering final : public AMDGPUTargetLowering {
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
|
|
|
|
const R600Subtarget *Subtarget;
|
2012-12-12 05:25:42 +08:00
|
|
|
public:
|
2016-06-24 14:30:11 +08:00
|
|
|
R600TargetLowering(const TargetMachine &TM, const R600Subtarget &STI);
|
|
|
|
|
|
|
|
const R600Subtarget *getSubtarget() const;
|
|
|
|
|
2016-07-01 06:52:52 +08:00
|
|
|
MachineBasicBlock *
|
|
|
|
EmitInstrWithCustomInserter(MachineInstr &MI,
|
|
|
|
MachineBasicBlock *BB) const override;
|
2014-04-29 15:57:24 +08:00
|
|
|
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
|
|
|
|
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
|
|
|
|
void ReplaceNodeResults(SDNode * N,
|
|
|
|
SmallVectorImpl<SDValue> &Results,
|
|
|
|
SelectionDAG &DAG) const override;
|
AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc. This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself. This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.
Reviewers: arsenm, nhaehnle, jvesely
Reviewed By: arsenm
Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46365
llvm-svn: 335942
2018-06-29 07:47:12 +08:00
|
|
|
CCAssignFn *CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg) const;
|
2016-06-12 23:39:02 +08:00
|
|
|
SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv,
|
|
|
|
bool isVarArg,
|
|
|
|
const SmallVectorImpl<ISD::InputArg> &Ins,
|
|
|
|
const SDLoc &DL, SelectionDAG &DAG,
|
|
|
|
SmallVectorImpl<SDValue> &InVals) const override;
|
2015-07-09 10:09:04 +08:00
|
|
|
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &,
|
|
|
|
EVT VT) const override;
|
2016-02-23 05:04:16 +08:00
|
|
|
|
2017-07-11 04:25:54 +08:00
|
|
|
bool canMergeStoresTo(unsigned AS, EVT MemVT,
|
|
|
|
const SelectionDAG &DAG) const override;
|
2017-05-24 23:59:09 +08:00
|
|
|
|
2016-02-23 05:04:16 +08:00
|
|
|
bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AS,
|
|
|
|
unsigned Align,
|
|
|
|
bool *IsFast) const override;
|
2015-07-09 10:09:04 +08:00
|
|
|
|
2012-12-12 05:25:42 +08:00
|
|
|
private:
|
2013-07-09 23:03:11 +08:00
|
|
|
unsigned Gen;
|
2012-12-12 05:25:42 +08:00
|
|
|
/// Each OpenCL kernel has nine implicit parameters that are stored in the
|
|
|
|
/// first nine dwords of a Vertex Buffer. These implicit parameters are
|
2014-01-25 01:20:08 +08:00
|
|
|
/// lowered to load instructions which retrieve the values from the Vertex
|
2012-12-12 05:25:42 +08:00
|
|
|
/// Buffer.
|
2016-06-12 23:39:02 +08:00
|
|
|
SDValue LowerImplicitParameter(SelectionDAG &DAG, EVT VT, const SDLoc &DL,
|
|
|
|
unsigned DwordOffset) const;
|
2012-12-12 05:25:42 +08:00
|
|
|
|
|
|
|
void lowerImplicitParameter(MachineInstr *MI, MachineBasicBlock &BB,
|
|
|
|
MachineRegisterInfo & MRI, unsigned dword_offset) const;
|
2015-04-28 22:05:47 +08:00
|
|
|
SDValue OptimizeSwizzle(SDValue BuildVector, SDValue Swz[], SelectionDAG &DAG,
|
2016-06-12 23:39:02 +08:00
|
|
|
const SDLoc &DL) const;
|
2014-06-18 00:53:14 +08:00
|
|
|
SDValue vectorToVerticalVector(SelectionDAG &DAG, SDValue Vector) const;
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2016-03-08 05:10:13 +08:00
|
|
|
SDValue lowerFrameIndex(SDValue Op, SelectionDAG &DAG) const;
|
2014-06-18 00:53:14 +08:00
|
|
|
SDValue LowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue LowerINSERT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
|
2016-05-03 02:05:17 +08:00
|
|
|
SDValue LowerGlobalAddress(AMDGPUMachineFunction *MFI, SDValue Op,
|
2016-05-03 03:45:10 +08:00
|
|
|
SelectionDAG &DAG) const override;
|
2012-12-12 05:25:42 +08:00
|
|
|
SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
|
2016-02-11 13:32:46 +08:00
|
|
|
|
|
|
|
SDValue lowerPrivateTruncStore(StoreSDNode *Store, SelectionDAG &DAG) const;
|
2012-12-12 05:25:42 +08:00
|
|
|
SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG) const;
|
2016-07-23 01:01:21 +08:00
|
|
|
SDValue lowerFP_TO_UINT(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue lowerFP_TO_SINT(SDValue Op, SelectionDAG &DAG) const;
|
2016-02-11 02:21:39 +08:00
|
|
|
|
|
|
|
SDValue lowerPrivateExtLoad(SDValue Op, SelectionDAG &DAG) const;
|
2013-01-23 10:09:06 +08:00
|
|
|
SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG) const;
|
2014-06-24 02:00:55 +08:00
|
|
|
SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG) const;
|
2013-07-09 23:03:11 +08:00
|
|
|
SDValue LowerTrig(SDValue Op, SelectionDAG &DAG) const;
|
2014-06-18 20:27:13 +08:00
|
|
|
SDValue LowerSHLParts(SDValue Op, SelectionDAG &DAG) const;
|
2014-06-18 20:27:15 +08:00
|
|
|
SDValue LowerSRXParts(SDValue Op, SelectionDAG &DAG) const;
|
2015-05-01 01:15:56 +08:00
|
|
|
SDValue LowerUADDSUBO(SDValue Op, SelectionDAG &DAG,
|
|
|
|
unsigned mainop, unsigned ovf) const;
|
2013-02-07 01:32:29 +08:00
|
|
|
|
|
|
|
SDValue stackPtrToRegIndex(SDValue Ptr, unsigned StackWidth,
|
|
|
|
SelectionDAG &DAG) const;
|
|
|
|
void getStackAddress(unsigned StackWidth, unsigned ElemIdx,
|
|
|
|
unsigned &Channel, unsigned &PtrIncr) const;
|
2012-12-12 05:25:42 +08:00
|
|
|
bool isZero(SDValue Op) const;
|
2016-03-11 16:00:27 +08:00
|
|
|
bool isHWTrueValue(SDValue Op) const;
|
|
|
|
bool isHWFalseValue(SDValue Op) const;
|
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
bool FoldOperand(SDNode *ParentNode, unsigned SrcIdx, SDValue &Src,
|
|
|
|
SDValue &Neg, SDValue &Abs, SDValue &Sel, SDValue &Imm,
|
|
|
|
SelectionDAG &DAG) const;
|
|
|
|
|
2014-04-29 15:57:24 +08:00
|
|
|
SDNode *PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const override;
|
2012-12-12 05:25:42 +08:00
|
|
|
};
|
|
|
|
|
2015-06-23 17:49:53 +08:00
|
|
|
} // End namespace llvm;
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#endif
|