OpenASIP
2.0
|
#include <TCEISelLowering.hh>
Public Member Functions | |
TCETargetLowering (TargetMachine &TM, const TCESubtarget &subt) | |
virtual SDValue | LowerOperation (SDValue Op, SelectionDAG &DAG) const override |
virtual SDValue | PerformDAGCombine (SDNode *N, DAGCombinerInfo &DCI) const override |
int | getVarArgsFrameOffset () const |
virtual const char * | getTargetNodeName (unsigned opcode) const override |
ConstraintType | getConstraintType (StringRef Constraint) const override |
getConstraintType - Given a constraint letter, return the type of constraint it is for this target. More... | |
std::pair< unsigned, const TargetRegisterClass * > | getRegForInlineAsmConstraint (const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const override |
void | LowerAsmOperandForConstraint (SDValue Op, std::string &Constraint, std::vector< SDValue > &Ops, SelectionDAG &DAG) const override |
std::vector< unsigned > | getRegClassForInlineAsmConstraint (const std::string &Constraint, EVT VT) const |
virtual bool | isOffsetFoldingLegal (const GlobalAddressSDNode *GA) 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. More... | |
SDValue | LowerTRAP (SDValue Op, SelectionDAG &DAG) const |
SDValue | LowerVASTART (SDValue Op, SelectionDAG &DAG) const |
SDValue | LowerBlockAddress (SDValue Op, SelectionDAG &DAG) const |
SDValue | LowerConstant (SDValue Op, SelectionDAG &DAG) const |
SDValue | LowerBuildVector (SDValue Op, SelectionDAG &DAG) const |
SDValue | LowerINLINEASM (SDValue Op, SelectionDAG &DAG) const |
SDValue | LowerShift (SDValue op, SelectionDAG &dag) const |
SDValue | LowerBuildBooleanVectorVector (SDValue Op, MVT newElementVT, int elemCount, SelectionDAG &DAG) const |
SDValue | lowerHWLoops (SDValue op, SelectionDAG &dag) const |
SDValue | lowerExtOrBoolLoad (SDValue op, SelectionDAG &DAG) const |
std::pair< int, TCEString > | getConstShiftNodeAndTCEOP (SDValue op) const |
virtual SDValue | LowerCall (TargetLowering::CallLoweringInfo &CLI, SmallVectorImpl< SDValue > &InVals) 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 |
bool | isConstantOrUndefBuild (const SDNode &node) const |
bool | canEncodeConstantOperands (const SDNode &node) const |
bool | canEncodeImmediate (const ConstantSDNode &node) const |
bool | shouldLoadFromConstantPool (unsigned addressSpace) const |
SDValue | LowerGLOBALADDRESS (SDValue Op, SelectionDAG &DAG) const |
llvm::EVT | getSetCCResultType (const DataLayout &DL, LLVMContext &Context, EVT VT) const override |
virtual bool | isFPImmLegal (const APFloat &apf, EVT VT, bool forCodeSize) const override |
SDValue | ExpandLibCall (RTLIB::Libcall LC, SDNode *Node, bool isSigned, SelectionDAG &DAG) const |
void | ReplaceNodeResults (SDNode *node, SmallVectorImpl< SDValue > &, SelectionDAG &) const override |
Static Public Member Functions | |
static bool | isBroadcast (SDNode *n) |
Private Member Functions | |
bool | hasI1RegisterClass () const |
const TargetRegisterClass * | getVectorRegClassForInlineAsmConstraint (const TargetRegisterInfo *TRI, MVT VT) const |
void | addVectorRegisterClasses () |
Implementation generated to Backend.inc from TDGenSIMD.cc. More... | |
std::pair< unsigned, const TargetRegisterClass * > | associatedVectorRegClass (const EVT &vt) const |
Implementation generated to Backend.inc from TDGenSIMD.cc. More... | |
virtual llvm::EVT | getSetCCResultVT (const EVT &VT) const |
Implementation generated to Backend.inc from TDGenSIMD.cc. More... | |
void | addVectorLowerings () |
Implementation generated to Backend.inc from TDGenSIMD.cc. More... | |
Private Attributes | |
int | VarArgsFrameOffset |
bool | hasI1RC_ = false |
Tells if the target machine has boolean register file. More... | |
TCETargetMachine & | tm_ |
std::map< unsigned, bool > | loadGAFromConstantPool_ |
Predicates to tell whenever the addresses belonging to a address space should be loaded from constant pool instead of immediates. Address space as index maps to the predicate. More... | |
Lowers LLVM code to SelectionDAG for the TCE backend.
Definition at line 83 of file TCEISelLowering.hh.
TCETargetLowering::TCETargetLowering | ( | TargetMachine & | TM, |
const TCESubtarget & | subt | ||
) |
The Constructor.
Initializes the target lowering.
Definition at line 528 of file TCEISelLowering.cc.
References TTAMachine::Machine::addressSpaceNavigator(), addVectorLowerings(), addVectorRegisterClasses(), Application::cmdLineOptions(), LLVMTCECmdLineOptions::conservativePreRAScheduler(), llvm::TCETargetMachine::customLegalizedOperations(), DEFAULT_TYPE, LLVMTCECmdLineOptions::disableHWLoops(), llvm::TCESubtarget::getRegisterInfo(), llvm::TCETargetMachine::has16bitLoads(), llvm::TCETargetMachine::has8bitLoads(), hasI1RC_, hasI1RegisterClass(), llvm::TCETargetMachine::largestImmValue(), loadGAFromConstantPool_, Application::logStream(), llvm::TCETargetMachine::missingOperations(), llvm::TCETargetMachine::promotedOperations(), MachineInfo::supportsBoolRegisterGuardedJumps(), MachineInfo::supportsPortGuardedJumps(), tm_, llvm::TCETargetMachine::ttaMachine(), and Application::verboseLevel().
|
private |
Implementation generated to Backend.inc from TDGenSIMD.cc.
Referenced by TCETargetLowering().
|
private |
Implementation generated to Backend.inc from TDGenSIMD.cc.
Referenced by TCETargetLowering().
|
private |
Implementation generated to Backend.inc from TDGenSIMD.cc.
Referenced by getRegForInlineAsmConstraint().
bool TCETargetLowering::canEncodeConstantOperands | ( | const SDNode & | node | ) | const |
Check if constant operands used by the SDNode can be encoded as immediate on the target machine.
Definition at line 1694 of file TCEISelLowering.cc.
References canEncodeImmediate().
Referenced by LowerBuildVector().
bool TCETargetLowering::canEncodeImmediate | ( | const ConstantSDNode & | node | ) | const |
Check if the constant can be generally encoded as immediate on the target machine.
Definition at line 1709 of file TCEISelLowering.cc.
References llvm::TCETargetMachine::canEncodeAsMOVI(), llvm::TCETargetMachine::canMaterializeConstant(), and tm_.
Referenced by canEncodeConstantOperands(), LowerAsmOperandForConstraint(), and LowerConstant().
SDValue TCETargetLowering::ExpandLibCall | ( | RTLIB::Libcall | LC, |
SDNode * | Node, | ||
bool | isSigned, | ||
SelectionDAG & | DAG | ||
) | const |
|
override |
getConstraintType - Given a constraint letter, return the type of constraint it is for this target.
Definition at line 1508 of file TCEISelLowering.cc.
std::pair< int, TCEString > TCETargetLowering::getConstShiftNodeAndTCEOP | ( | SDValue | op | ) | const |
Definition at line 1260 of file TCEISelLowering.cc.
References TCEISD::SHL_Const, TCEISD::SRA_Const, and TCEISD::SRL_Const.
Referenced by LowerShift().
std::vector< unsigned > TCETargetLowering::getRegClassForInlineAsmConstraint | ( | const std::string & | Constraint, |
EVT | VT | ||
) | const |
Definition at line 1644 of file TCEISelLowering.cc.
|
override |
Returns proper register class for given value type.
Constraint | A constraint defined for an inline asm operation operand. |
Definition at line 1544 of file TCEISelLowering.cc.
References associatedVectorRegClass(), DEFAULT_REG_CLASS, getVectorRegClassForInlineAsmConstraint(), llvm::TCETargetMachine::llvmRegisterId(), and tm_.
|
override |
Returns the preferred result type of comparison operations.
VT | Result type of the comparison operation. |
Definition at line 1183 of file TCEISelLowering.cc.
References getSetCCResultVT(), and hasI1RC_.
|
privatevirtual |
Implementation generated to Backend.inc from TDGenSIMD.cc.
Referenced by getSetCCResultType().
|
overridevirtual |
Returns target node opcode names for debugging purposes.
opcode | Opcode to convert to string. |
Definition at line 873 of file TCEISelLowering.cc.
References TCEISD::CALL, TCEISD::CONST_POOL, TCEISD::FTOI, TCEISD::GLOBAL_ADDR, TCEISD::ITOF, TCEISD::RET_FLAG, TCEISD::SELECT_F16, TCEISD::SELECT_F32, TCEISD::SELECT_F64, TCEISD::SELECT_I1, TCEISD::SELECT_I16, TCEISD::SELECT_I32, TCEISD::SELECT_I64, and TCEISD::SELECT_I8.
|
inline |
Definition at line 92 of file TCEISelLowering.hh.
References VarArgsFrameOffset.
Referenced by LowerVASTART().
|
private |
|
private |
Returns true if the target machine has register class for i1 types.
Definition at line 1756 of file TCEISelLowering.cc.
References llvm::TCETargetMachine::rfName(), and tm_.
Referenced by TCETargetLowering().
|
static |
bool TCETargetLowering::isConstantOrUndefBuild | ( | const SDNode & | node | ) | const |
Returns true if all operands of the SDNode are constants or undefined.
Definition at line 1679 of file TCEISelLowering.cc.
Referenced by LowerBuildVector().
|
overridevirtual |
Check the FP in bits can be fit in machine's immediates.
Definition at line 1773 of file TCEISelLowering.cc.
References llvm::TCETargetMachine::canEncodeAsMOVF(), and tm_.
|
overridevirtual |
Definition at line 1661 of file TCEISelLowering.cc.
|
override |
Definition at line 1620 of file TCEISelLowering.cc.
References canEncodeImmediate().
SDValue TCETargetLowering::LowerBlockAddress | ( | SDValue | Op, |
SelectionDAG & | DAG | ||
) | const |
Definition at line 956 of file TCEISelLowering.cc.
References TCEISD::BLOCK_ADDR, and DEFAULT_TYPE.
Referenced by LowerOperation().
SDValue TCETargetLowering::LowerBuildBooleanVectorVector | ( | SDValue | Op, |
MVT | newElementVT, | ||
int | elemCount, | ||
SelectionDAG & | DAG | ||
) | const |
SDValue TCETargetLowering::LowerBuildVector | ( | SDValue | Op, |
SelectionDAG & | DAG | ||
) | const |
Definition at line 1033 of file TCEISelLowering.cc.
References assert, llvm::TCETargetMachine::canEncodeAsMOVI(), canEncodeConstantOperands(), llvm::TCETargetMachine::hasOperation(), isBroadcast(), isConstantOrUndefBuild(), LowerBuildBooleanVectorVector(), tm_, and Application::verboseLevel().
Referenced by LowerOperation().
|
overridevirtual |
Definition at line 323 of file TCEISelLowering.cc.
References assert, TCEISD::CALL, DEFAULT_TYPE, llvm::TCETargetMachine::stackAlignment(), and tm_.
SDValue TCETargetLowering::LowerConstant | ( | SDValue | Op, |
SelectionDAG & | DAG | ||
) | const |
Definition at line 985 of file TCEISelLowering.cc.
References assert, canEncodeImmediate(), and Application::verboseLevel().
Referenced by LowerOperation().
SDValue TCETargetLowering::lowerExtOrBoolLoad | ( | SDValue | op, |
SelectionDAG & | DAG | ||
) | const |
Lowers extension load of 8- or 16-bit load to 32-bit little-endian load.
Definition at line 1982 of file TCEISelLowering.cc.
References assert.
Referenced by LowerOperation().
|
overridevirtual |
getFunctionAlignment - Return the Log2 alignment of this function.
Lowers formal arguments.
Definition at line 145 of file TCEISelLowering.cc.
References assert, DEFAULT_REG_CLASS, DEFAULT_SIZE, DEFAULT_TYPE, llvm::TCETargetMachine::stackAlignment(), tm_, and VarArgsFrameOffset.
SDValue TCETargetLowering::LowerGLOBALADDRESS | ( | SDValue | Op, |
SelectionDAG & | DAG | ||
) | const |
Definition at line 923 of file TCEISelLowering.cc.
References DEFAULT_TYPE, TCEISD::GLOBAL_ADDR, shouldLoadFromConstantPool(), and Application::verboseLevel().
Referenced by LowerOperation().
SDValue TCETargetLowering::lowerHWLoops | ( | SDValue | op, |
SelectionDAG & | dag | ||
) | const |
Definition at line 1340 of file TCEISelLowering.cc.
References assert.
Referenced by LowerOperation().
SDValue llvm::TCETargetLowering::LowerINLINEASM | ( | SDValue | Op, |
SelectionDAG & | DAG | ||
) | const |
|
overridevirtual |
Handles custom operation lowerings.
Definition at line 1414 of file TCEISelLowering.cc.
References assert, LowerBlockAddress(), LowerBuildVector(), LowerConstant(), LowerCONSTANTPOOL(), lowerExtOrBoolLoad(), LowerGLOBALADDRESS(), lowerHWLoops(), LowerShift(), LowerTRAP(), and LowerVASTART().
|
overridevirtual |
SDValue TCETargetLowering::LowerShift | ( | SDValue | op, |
SelectionDAG & | dag | ||
) | const |
Definition at line 1274 of file TCEISelLowering.cc.
References assert, ExpandLibCall(), getConstShiftNodeAndTCEOP(), llvm::TCETargetMachine::hasOperation(), R(), and tm_.
Referenced by LowerOperation().
SDValue TCETargetLowering::LowerTRAP | ( | SDValue | Op, |
SelectionDAG & | DAG | ||
) | const |
SDValue TCETargetLowering::LowerVASTART | ( | SDValue | Op, |
SelectionDAG & | DAG | ||
) | const |
Definition at line 1160 of file TCEISelLowering.cc.
References getVarArgsFrameOffset().
Referenced by LowerOperation().
|
overridevirtual |
Replace the decrement use chain with it predecessor The decrement should connect to BRCOND node directly or via TokeneFactor. If it is connected via TokenFactor, move the decrement close to BRCOND by updating the chain
Definition at line 1441 of file TCEISelLowering.cc.
References assert.
|
override |
bool TCETargetLowering::shouldLoadFromConstantPool | ( | unsigned | addressSpace | ) | const |
Returns true if the address values should be loaded from constant pool due to limited immediate support.
Definition at line 1742 of file TCEISelLowering.cc.
References assert, and loadGAFromConstantPool_.
Referenced by LowerGLOBALADDRESS().
|
private |
Tells if the target machine has boolean register file.
Definition at line 174 of file TCEISelLowering.hh.
Referenced by getSetCCResultType(), and TCETargetLowering().
|
private |
Predicates to tell whenever the addresses belonging to a address space should be loaded from constant pool instead of immediates. Address space as index maps to the predicate.
Definition at line 181 of file TCEISelLowering.hh.
Referenced by shouldLoadFromConstantPool(), and TCETargetLowering().
|
private |
Definition at line 176 of file TCEISelLowering.hh.
Referenced by canEncodeImmediate(), getRegForInlineAsmConstraint(), hasI1RegisterClass(), isFPImmLegal(), LowerBuildVector(), LowerCall(), LowerFormalArguments(), LowerShift(), and TCETargetLowering().
|
mutableprivate |
Definition at line 84 of file TCEISelLowering.hh.
Referenced by getVarArgsFrameOffset(), and LowerFormalArguments().