2012-12-11 21:25:42 +00: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
|
|
|
|
/// \brief R600 DAG Lowering interface definition
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef R600ISELLOWERING_H
|
|
|
|
#define R600ISELLOWERING_H
|
|
|
|
|
|
|
|
#include "AMDGPUISelLowering.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class R600InstrInfo;
|
|
|
|
|
|
|
|
class R600TargetLowering : public AMDGPUTargetLowering {
|
|
|
|
public:
|
|
|
|
R600TargetLowering(TargetMachine &TM);
|
2014-04-29 07:57:24 +00:00
|
|
|
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr *MI,
|
|
|
|
MachineBasicBlock * BB) const override;
|
|
|
|
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;
|
|
|
|
SDValue LowerFormalArguments(
|
|
|
|
SDValue Chain,
|
|
|
|
CallingConv::ID CallConv,
|
|
|
|
bool isVarArg,
|
|
|
|
const SmallVectorImpl<ISD::InputArg> &Ins,
|
|
|
|
SDLoc DL, SelectionDAG &DAG,
|
|
|
|
SmallVectorImpl<SDValue> &InVals) const override;
|
|
|
|
EVT getSetCCResultType(LLVMContext &, EVT VT) const override;
|
2012-12-11 21:25:42 +00:00
|
|
|
private:
|
2013-07-09 15:03:11 +00:00
|
|
|
unsigned Gen;
|
2012-12-11 21:25:42 +00: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-24 17:20:08 +00:00
|
|
|
/// lowered to load instructions which retrieve the values from the Vertex
|
2012-12-11 21:25:42 +00:00
|
|
|
/// Buffer.
|
|
|
|
SDValue LowerImplicitParameter(SelectionDAG &DAG, EVT VT,
|
2013-05-25 02:42:55 +00:00
|
|
|
SDLoc DL, unsigned DwordOffset) const;
|
2012-12-11 21:25:42 +00:00
|
|
|
|
|
|
|
void lowerImplicitParameter(MachineInstr *MI, MachineBasicBlock &BB,
|
|
|
|
MachineRegisterInfo & MRI, unsigned dword_offset) const;
|
2013-06-04 15:04:53 +00:00
|
|
|
SDValue OptimizeSwizzle(SDValue BuildVector, SDValue Swz[], SelectionDAG &DAG) const;
|
2014-06-17 16:53:14 +00:00
|
|
|
SDValue vectorToVerticalVector(SelectionDAG &DAG, SDValue Vector) const;
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2014-06-17 16:53:14 +00:00
|
|
|
SDValue LowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue LowerINSERT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
|
2012-12-11 21:25:42 +00:00
|
|
|
SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
SDValue LowerFPTOUINT(SDValue Op, SelectionDAG &DAG) const;
|
2013-01-23 02:09:06 +00:00
|
|
|
SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG) const;
|
2013-07-09 15:03:11 +00:00
|
|
|
SDValue LowerTrig(SDValue Op, SelectionDAG &DAG) const;
|
2014-06-18 12:27:13 +00:00
|
|
|
SDValue LowerSHLParts(SDValue Op, SelectionDAG &DAG) const;
|
2014-06-18 12:27:15 +00:00
|
|
|
SDValue LowerSRXParts(SDValue Op, SelectionDAG &DAG) const;
|
2013-02-06 17:32:29 +00:00
|
|
|
|
|
|
|
SDValue stackPtrToRegIndex(SDValue Ptr, unsigned StackWidth,
|
|
|
|
SelectionDAG &DAG) const;
|
|
|
|
void getStackAddress(unsigned StackWidth, unsigned ElemIdx,
|
|
|
|
unsigned &Channel, unsigned &PtrIncr) const;
|
2012-12-11 21:25:42 +00:00
|
|
|
bool isZero(SDValue Op) const;
|
2014-04-29 07:57:24 +00:00
|
|
|
SDNode *PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const override;
|
2012-12-11 21:25:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End namespace llvm;
|
|
|
|
|
|
|
|
#endif // R600ISELLOWERING_H
|