33#ifndef TCE_TARGET_LOWERING_H
34#define TCE_TARGET_LOWERING_H
36#include <llvm/CodeGen/TargetLowering.h>
39#include "tce_config.h"
76#define SDLOC_PARAM_TYPE const SDLoc&
78 class TCETargetMachine;
88 virtual SDValue
LowerOperation(SDValue Op, SelectionDAG &DAG)
const override;
90 SDNode *N, DAGCombinerInfo &DCI)
const override;
97 std::pair<unsigned, const TargetRegisterClass *>
99 StringRef Constraint, MVT VT)
const override;
103 std::string& Constraint,
104 std::vector<SDValue>& Ops,
105 SelectionDAG& DAG)
const override;
108 std::vector<unsigned>
117 CallingConv::ID CallConv,
119 const SmallVectorImpl<ISD::InputArg> &Ins,
121 SmallVectorImpl<SDValue> &InVals)
const override;
123 SDValue
LowerTRAP(SDValue Op, SelectionDAG &DAG)
const;
124 SDValue
LowerVASTART(SDValue Op, SelectionDAG &DAG)
const;
129 SDValue
LowerShift(SDValue op, SelectionDAG& dag)
const;
131 SDValue Op, MVT newElementVT,
int elemCount, SelectionDAG &DAG)
const;
132 SDValue
lowerHWLoops(SDValue op, SelectionDAG &dag)
const;
133 SDValue
lowerFABS(SDValue op, SelectionDAG &dag)
const;
140 LowerCall(TargetLowering::CallLoweringInfo &CLI,
141 SmallVectorImpl<SDValue> &InVals)
const override;
145 CallingConv::ID CallConv,
bool isVarArg,
146 const SmallVectorImpl<ISD::OutputArg> &Outs,
147 const SmallVectorImpl<SDValue> &OutVals,
184 const TargetRegisterClass*
186 const TargetRegisterInfo* TRI, MVT VT)
const;
192 std::pair<unsigned, const TargetRegisterClass *>
203 const DataLayout &DL, LLVMContext &Context,
204 EVT VT)
const override;
207 const APFloat& apf, EVT VT,
bool forCodeSize)
const override;
210 RTLIB::Libcall LC, SDNode *Node,
bool isSigned, SelectionDAG &DAG)
214 SmallVectorImpl< SDValue > &,
215 SelectionDAG &)
const override;
bool hasI1RegisterClass() const
SDValue LowerVASTART(SDValue Op, SelectionDAG &DAG) const
SDValue lowerFABS(SDValue op, SelectionDAG &dag) const
static bool isBroadcast(SDNode *n)
SDValue LowerShift(SDValue op, SelectionDAG &dag) const
void ReplaceNodeResults(SDNode *node, SmallVectorImpl< SDValue > &, SelectionDAG &) const override
virtual SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl< ISD::InputArg > &Ins, SDLOC_PARAM_TYPE dl, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals) const override
getFunctionAlignment - Return the Log2 alignment of this function.
int getVarArgsFrameOffset() const
virtual bool isFPImmLegal(const APFloat &apf, EVT VT, bool forCodeSize) const override
SDValue LowerTRAP(SDValue Op, SelectionDAG &DAG) const
SDValue LowerConstant(SDValue Op, SelectionDAG &DAG) const
virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override
virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override
llvm::EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const override
SDValue LowerGLOBALADDRESS(SDValue Op, SelectionDAG &DAG) const
virtual const char * getTargetNodeName(unsigned opcode) const override
std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const override
bool hasI1RC_
Tells if the target machine has boolean register file.
std::pair< unsigned, const TargetRegisterClass * > associatedVectorRegClass(const EVT &vt) const
Implementation generated to Backend.inc from TDGenSIMD.cc.
const TargetRegisterClass * getVectorRegClassForInlineAsmConstraint(const TargetRegisterInfo *TRI, MVT VT) const
void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint, std::vector< SDValue > &Ops, SelectionDAG &DAG) const override
void addVectorRegisterClasses()
Implementation generated to Backend.inc from TDGenSIMD.cc.
bool canEncodeImmediate(const ConstantSDNode &node) const
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
virtual SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl< ISD::OutputArg > &Outs, const SmallVectorImpl< SDValue > &OutVals, SDLOC_PARAM_TYPE dl, SelectionDAG &DAG) const override
virtual SDValue LowerCall(TargetLowering::CallLoweringInfo &CLI, SmallVectorImpl< SDValue > &InVals) const override
SDValue lowerExtOrBoolLoad(SDValue op, SelectionDAG &DAG) const
std::vector< unsigned > getRegClassForInlineAsmConstraint(const std::string &Constraint, EVT VT) const
SDValue LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const
SDValue LowerINLINEASM(SDValue Op, SelectionDAG &DAG) const
bool canEncodeConstantOperands(const SDNode &node) const
SDValue lowerHWLoops(SDValue op, SelectionDAG &dag) const
SDValue LowerBuildVector(SDValue Op, SelectionDAG &DAG) const
virtual llvm::EVT getSetCCResultVT(const EVT &VT) const
Implementation generated to Backend.inc from TDGenSIMD.cc.
bool isConstantOrUndefBuild(const SDNode &node) const
ConstraintType getConstraintType(StringRef Constraint) const override
getConstraintType - Given a constraint letter, return the type of constraint it is for this target.
bool shouldLoadFromConstantPool(unsigned addressSpace) const
SDValue LowerBuildBooleanVectorVector(SDValue Op, MVT newElementVT, int elemCount, SelectionDAG &DAG) const
std::map< unsigned, bool > loadGAFromConstantPool_
Predicates to tell whenever the addresses belonging to a address space should be loaded from constant...
SDValue ExpandLibCall(RTLIB::Libcall LC, SDNode *Node, bool isSigned, SelectionDAG &DAG) const
void addVectorLowerings()
Implementation generated to Backend.inc from TDGenSIMD.cc.
std::pair< int, TCEString > getConstShiftNodeAndTCEOP(SDValue op) const