2012-12-12 05:25:42 +08: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-10-23 08:44:32 +08:00
|
|
|
SDValue LowerParameter(SelectionDAG &DAG, EVT VT, EVT MemVT, SDLoc DL,
|
2014-04-12 04:59:54 +08:00
|
|
|
SDValue Chain, unsigned Offset, bool Signed) const;
|
2013-08-15 07:24:45 +08:00
|
|
|
SDValue LowerSampleIntrinsic(unsigned Opcode, const SDValue &Op,
|
|
|
|
SelectionDAG &DAG) const;
|
2014-07-21 22:01:14 +08:00
|
|
|
SDValue LowerGlobalAddress(AMDGPUMachineFunction *MFI, SDValue Op,
|
|
|
|
SelectionDAG &DAG) const override;
|
2013-11-14 07:36:50 +08:00
|
|
|
SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG) const;
|
2014-02-05 01:18:40 +08:00
|
|
|
SDValue LowerSELECT(SDValue Op, SelectionDAG &DAG) const;
|
2014-07-16 07:50:10 +08:00
|
|
|
SDValue LowerFastFDIV(SDValue Op, SelectionDAG &DAG) const;
|
2014-07-16 04:18:31 +08:00
|
|
|
SDValue LowerFDIV32(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue LowerFDIV64(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue LowerFDIV(SDValue Op, SelectionDAG &DAG) const;
|
2013-11-14 07:36:50 +08:00
|
|
|
SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG) const;
|
2014-07-20 02:44:39 +08:00
|
|
|
SDValue LowerTrig(SDValue Op, SelectionDAG &DAG) const;
|
2012-12-20 06:10:31 +08:00
|
|
|
SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG) const;
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2013-02-27 01:52:23 +08:00
|
|
|
bool foldImm(SDValue &Operand, int32_t &Immediate,
|
|
|
|
bool &ScalarSlotUsed) const;
|
2013-08-07 07:08:18 +08:00
|
|
|
const TargetRegisterClass *getRegClassForNode(SelectionDAG &DAG,
|
|
|
|
const SDValue &Op) const;
|
2013-05-20 23:02:01 +08:00
|
|
|
bool fitsRegClass(SelectionDAG &DAG, const SDValue &Op,
|
|
|
|
unsigned RegClass) const;
|
2013-05-18 08:21:46 +08:00
|
|
|
void ensureSRegLimit(SelectionDAG &DAG, SDValue &Operand,
|
2013-02-27 01:52:23 +08:00
|
|
|
unsigned RegClass, bool &ScalarSlotUsed) const;
|
|
|
|
|
2013-04-10 16:39:08 +08:00
|
|
|
SDNode *foldOperands(MachineSDNode *N, SelectionDAG &DAG) const;
|
|
|
|
void adjustWritemask(MachineSDNode *&N, SelectionDAG &DAG) const;
|
2013-06-04 01:39:58 +08:00
|
|
|
MachineSDNode *AdjustRegClass(MachineSDNode *N, SelectionDAG &DAG) const;
|
2013-04-10 16:39:08 +08:00
|
|
|
|
2014-06-12 01:50:44 +08:00
|
|
|
static SDValue performUCharToFloatCombine(SDNode *N,
|
|
|
|
DAGCombinerInfo &DCI);
|
|
|
|
|
2012-12-12 05:25:42 +08:00
|
|
|
public:
|
|
|
|
SITargetLowering(TargetMachine &tm);
|
2014-04-29 15:57:24 +08:00
|
|
|
bool allowsUnalignedMemoryAccesses(EVT VT, unsigned AS,
|
|
|
|
bool *IsFast) const override;
|
2014-07-03 08:23:43 +08:00
|
|
|
|
|
|
|
TargetLoweringBase::LegalizeTypeAction
|
|
|
|
getPreferredVectorAction(EVT VT) const override;
|
2013-03-07 17:03:52 +08:00
|
|
|
|
2014-04-29 15:57:24 +08:00
|
|
|
bool shouldConvertConstantLoadToIntImm(const APInt &Imm,
|
|
|
|
Type *Ty) const override;
|
2014-04-01 03:54:27 +08:00
|
|
|
|
2013-03-07 17:03:52 +08:00
|
|
|
SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv,
|
|
|
|
bool isVarArg,
|
|
|
|
const SmallVectorImpl<ISD::InputArg> &Ins,
|
2013-05-25 10:42:55 +08:00
|
|
|
SDLoc DL, SelectionDAG &DAG,
|
2014-04-29 15:57:24 +08:00
|
|
|
SmallVectorImpl<SDValue> &InVals) const override;
|
2013-03-07 17:03:52 +08:00
|
|
|
|
2014-04-29 15:57:24 +08: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-27 01:52:23 +08:00
|
|
|
|
|
|
|
int32_t analyzeImmediate(const SDNode *N) const;
|
2013-06-04 01:40:18 +08:00
|
|
|
SDValue CreateLiveInRegister(SelectionDAG &DAG, const TargetRegisterClass *RC,
|
2014-04-29 15:57:24 +08:00
|
|
|
unsigned Reg, EVT VT) const override;
|
2012-12-12 05:25:42 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End namespace llvm
|
|
|
|
|
|
|
|
#endif //SIISELLOWERING_H
|