OpenASIP 2.2
|
#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. | |
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. | |
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 | lowerFABS (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. | |
std::pair< unsigned, const TargetRegisterClass * > | associatedVectorRegClass (const EVT &vt) const |
Implementation generated to Backend.inc from TDGenSIMD.cc. | |
virtual llvm::EVT | getSetCCResultVT (const EVT &VT) const |
Implementation generated to Backend.inc from TDGenSIMD.cc. | |
void | addVectorLowerings () |
Implementation generated to Backend.inc from TDGenSIMD.cc. | |
Private Attributes | |
int | VarArgsFrameOffset |
bool | hasI1RC_ = false |
Tells if the target machine has boolean register file. | |
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. | |
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 532 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 1725 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 1740 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 |
Definition at line 1834 of file TCEISelLowering.cc.
Referenced by LowerShift().
|
override |
getConstraintType - Given a constraint letter, return the type of constraint it is for this target.
Definition at line 1539 of file TCEISelLowering.cc.
std::pair< int, TCEString > TCETargetLowering::getConstShiftNodeAndTCEOP | ( | SDValue | op | ) | const |
Definition at line 1267 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 1674 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 1575 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 1190 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 880 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 |
Definition at line 1550 of file TCEISelLowering.cc.
Referenced by getRegForInlineAsmConstraint().
|
private |
Returns true if the target machine has register class for i1 types.
Definition at line 1787 of file TCEISelLowering.cc.
References llvm::TCETargetMachine::rfName(), and tm_.
Referenced by TCETargetLowering().
|
static |
Definition at line 1813 of file TCEISelLowering.cc.
Referenced by TCEDAGToDAGISel::isBroadcast(), and LowerBuildVector().
bool TCETargetLowering::isConstantOrUndefBuild | ( | const SDNode & | node | ) | const |
Returns true if all operands of the SDNode are constants or undefined.
Definition at line 1710 of file TCEISelLowering.cc.
Referenced by LowerBuildVector().
|
overridevirtual |
Check the FP in bits can be fit in machine's immediates.
Definition at line 1804 of file TCEISelLowering.cc.
References llvm::TCETargetMachine::canEncodeAsMOVF(), and tm_.
|
overridevirtual |
Definition at line 1692 of file TCEISelLowering.cc.
|
override |
Definition at line 1651 of file TCEISelLowering.cc.
References canEncodeImmediate().
SDValue TCETargetLowering::LowerBlockAddress | ( | SDValue | Op, |
SelectionDAG & | DAG | ||
) | const |
Definition at line 963 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 |
Definition at line 1011 of file TCEISelLowering.cc.
Referenced by LowerBuildVector().
SDValue TCETargetLowering::LowerBuildVector | ( | SDValue | Op, |
SelectionDAG & | DAG | ||
) | const |
Definition at line 1040 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 327 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 992 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 2028 of file TCEISelLowering.cc.
References assert.
Referenced by LowerOperation().
SDValue TCETargetLowering::lowerFABS | ( | SDValue | op, |
SelectionDAG & | dag | ||
) | const |
Lowers FABS operation.
TODO: Do not custom lower if FABS supported by machine.
Definition at line 1423 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 930 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 1347 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 1444 of file TCEISelLowering.cc.
References assert, LowerBlockAddress(), LowerBuildVector(), LowerConstant(), LowerCONSTANTPOOL(), lowerExtOrBoolLoad(), lowerFABS(), LowerGLOBALADDRESS(), lowerHWLoops(), LowerShift(), LowerTRAP(), and LowerVASTART().
|
overridevirtual |
Definition at line 97 of file TCEISelLowering.cc.
References assert, and TCEISD::RET_FLAG.
SDValue TCETargetLowering::LowerShift | ( | SDValue | op, |
SelectionDAG & | dag | ||
) | const |
Definition at line 1281 of file TCEISelLowering.cc.
References assert, ExpandLibCall(), getConstShiftNodeAndTCEOP(), llvm::TCETargetMachine::hasOperation(), LowerShift(), R(), and tm_.
Referenced by LowerOperation(), and LowerShift().
SDValue TCETargetLowering::LowerTRAP | ( | SDValue | Op, |
SelectionDAG & | DAG | ||
) | const |
Definition at line 900 of file TCEISelLowering.cc.
Referenced by LowerOperation().
SDValue TCETargetLowering::LowerVASTART | ( | SDValue | Op, |
SelectionDAG & | DAG | ||
) | const |
Definition at line 1167 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 1472 of file TCEISelLowering.cc.
References assert.
|
override |
Definition at line 1891 of file TCEISelLowering.cc.
References assert.
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 1773 of file TCEISelLowering.cc.
References assert, and loadGAFromConstantPool_.
Referenced by LowerGLOBALADDRESS().
|
private |
Tells if the target machine has boolean register file.
Definition at line 175 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 182 of file TCEISelLowering.hh.
Referenced by shouldLoadFromConstantPool(), and TCETargetLowering().
|
private |
Definition at line 177 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().