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
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef SIISELLOWERING_H
|
|
|
|
#define SIISELLOWERING_H
|
|
|
|
|
|
|
|
#include "AMDGPUISelLowering.h"
|
|
|
|
#include "SIInstrInfo.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class SITargetLowering : public AMDGPUTargetLowering {
|
|
|
|
const SIInstrInfo * TII;
|
2013-02-26 17:52:23 +00:00
|
|
|
const TargetRegisterInfo * TRI;
|
2012-12-11 21:25:42 +00:00
|
|
|
|
|
|
|
SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
|
2013-06-03 17:40:03 +00:00
|
|
|
SDValue LowerSIGN_EXTEND(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-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;
|
|
|
|
|
2013-04-10 08:39:08 +00:00
|
|
|
SDNode *foldOperands(MachineSDNode *N, SelectionDAG &DAG) const;
|
|
|
|
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
|
|
|
|
2012-12-11 21:25:42 +00:00
|
|
|
public:
|
|
|
|
SITargetLowering(TargetMachine &tm);
|
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,
|
2013-03-07 09:03:52 +00:00
|
|
|
SmallVectorImpl<SDValue> &InVals) const;
|
|
|
|
|
2012-12-11 21:25:42 +00:00
|
|
|
virtual MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr * MI,
|
|
|
|
MachineBasicBlock * BB) const;
|
2013-05-18 00:21:46 +00:00
|
|
|
virtual EVT getSetCCResultType(LLVMContext &Context, EVT VT) const;
|
2013-03-18 11:34:05 +00:00
|
|
|
virtual MVT getScalarShiftAmountTy(EVT VT) const;
|
2012-12-11 21:25:42 +00:00
|
|
|
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
|
|
|
|
virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
|
2013-02-26 17:52:16 +00:00
|
|
|
virtual SDNode *PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const;
|
2013-04-10 08:39:16 +00:00
|
|
|
virtual void AdjustInstrPostInstrSelection(MachineInstr *MI,
|
|
|
|
SDNode *Node) const;
|
2013-02-26 17:52:23 +00:00
|
|
|
|
|
|
|
int32_t analyzeImmediate(const SDNode *N) const;
|
2012-12-11 21:25:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End namespace llvm
|
|
|
|
|
|
|
|
#endif //SIISELLOWERING_H
|