OpenASIP
2.0
|
#include <TCETargetMachine.hh>
Public Member Functions | |
TCETargetMachine (const Target &T, const Triple &TTriple, const llvm::StringRef &CPU, const llvm::StringRef &FS, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM, CodeGenOpt::Level OL, bool isLittle) | |
virtual | ~TCETargetMachine () |
virtual void | setTargetMachinePlugin (TCETargetMachinePlugin &plugin, TTAMachine::Machine &target) |
virtual TCETargetMachinePlugin & | targetPlugin () const |
virtual void | setEmulationModule (Module *mod) |
virtual void | setTTAMach (const TTAMachine::Machine *mach) override |
virtual const TTAMachine::Machine & | ttaMachine () const |
virtual const TCESubtarget * | getSubtargetImpl () const |
virtual const TargetSubtargetInfo * | getSubtargetImpl (const Function &) const override |
virtual const TargetInstrInfo * | getInstrInfo () const |
virtual const TargetRegisterInfo * | getRegisterInfo () const |
virtual const DataLayout * | getDataLayout () const |
virtual const TargetFrameLowering * | getFrameLowering () const |
virtual TargetLowering * | getTargetLowering () const |
virtual TargetPassConfig * | createPassConfig (PassManagerBase &PM) override |
TargetTransformInfo | getTargetTransformInfo (const Function &F) const override |
std::string | operationName (unsigned opc) const |
bool | validStackAccessOperation (const std::string &opName) const |
bool | hasOperation (TCEString operationName) const |
std::string | rfName (unsigned dwarfRegNum) const |
unsigned | registerIndex (unsigned dwarfRegNum) const |
std::string | registerName (unsigned dwarfRegNum) const |
unsigned | llvmRegisterId (const TCEString &ttaRegister) |
TTAMachine::Machine * | createMachine () |
std::string | dataASName () |
unsigned | raPortDRegNum () const |
void | loadPlugin () |
unsigned | spDRegNum () const |
unsigned | opcode (TCEString operationName) const |
int | getMinOpcode (llvm::SDNode *n) |
int | getMinuOpcode (llvm::SDNode *n) |
int | getMaxOpcode (llvm::SDNode *n) |
int | getMaxuOpcode (llvm::SDNode *n) |
int | getAddOpcode (const llvm::EVT &vt) const |
int | getShlOpcode (const llvm::EVT &vt) const |
int | getIorOpcode (const llvm::EVT &vt) const |
void | setStackAlignment (unsigned align) |
unsigned | stackAlignment () const |
bool | has8bitLoads () const |
bool | has16bitLoads () const |
int | bitness () const |
const std::set< std::pair< unsigned, llvm::MVT::SimpleValueType > > * | missingOperations () |
const std::set< std::pair< unsigned, llvm::MVT::SimpleValueType > > * | promotedOperations () |
const std::set< std::pair< unsigned, llvm::MVT::SimpleValueType > > * | customLegalizedOperations () |
int64_t | smallestImmValue () const |
uint64_t | largestImmValue () const |
bool | canEncodeAsMOVI (const llvm::MVT &vt, int64_t val) const |
bool | canEncodeAsMOVF (const llvm::APFloat &fp) const |
bool | canMaterializeConstant (const ConstantInt &ci) const |
int | getLoadOpcode (int asid, int align, const llvm::EVT &vt) const |
Public Member Functions inherited from llvm::TCEBaseTargetMachine | |
TCEBaseTargetMachine (const Target &T, const Triple &TT, const llvm::StringRef &CPU, const llvm::StringRef &FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL) | |
virtual bool | isNoopAddrSpaceCast (unsigned SrcAS, unsigned DestAS) const override |
Public Attributes | |
Module * | emulationModule_ |
Public Attributes inherited from llvm::TCEBaseTargetMachine | |
const TTAMachine::Machine * | ttaMach_ |
Private Member Functions | |
void | calculateSupportedImmediates () |
Private Attributes | |
TCETargetMachinePlugin * | plugin_ |
PluginTools * | pluginTool_ |
std::set< std::pair< unsigned, llvm::MVT::SimpleValueType > > | missingOps_ |
llvm::ISD opcode list of operations that have to be expanded. More... | |
std::set< std::pair< unsigned, llvm::MVT::SimpleValueType > > | promotedOps_ |
std::set< std::pair< unsigned, llvm::MVT::SimpleValueType > > | customLegalizedOps_ |
int64_t | smallestImm_ = std::numeric_limits<int64_t>::max() |
uint64_t | largestImm_ = std::numeric_limits<int64_t>::min() |
int | SupportedFPImmWidth_ = std::numeric_limits<int>::min() |
unsigned | stackAlignment_ |
TCE Universal machine target description.
Definition at line 106 of file TCETargetMachine.hh.
TCETargetMachine::TCETargetMachine | ( | const Target & | T, |
const Triple & | TTriple, | ||
const llvm::StringRef & | CPU, | ||
const llvm::StringRef & | FS, | ||
const TargetOptions & | Options, | ||
Optional< Reloc::Model > | RM, | ||
Optional< CodeModel::Model > | CM, | ||
CodeGenOpt::Level | OL, | ||
bool | isLittle | ||
) |
Definition at line 144 of file TCETargetMachine.cc.
|
virtual |
|
inline |
Definition at line 294 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::is64bit(), and plugin_.
|
private |
Definition at line 389 of file TCETargetMachine.cc.
References assert, TTAMachine::Machine::busNavigator(), TTAMachine::Machine::immediateUnitNavigator(), TTAMachine::Machine::instructionTemplateNavigator(), largestImm_, TTAMachine::Machine::registerFileNavigator(), ImmInfo::registerImmediateLoadWidth(), smallestImm_, SupportedFPImmWidth_, and llvm::TCEBaseTargetMachine::ttaMach_.
Referenced by setTTAMach().
bool TCETargetMachine::canEncodeAsMOVF | ( | const llvm::APFloat & | fp | ) | const |
Returns true if the floating point value can be encoded as immediate to register.
Definition at line 382 of file TCETargetMachine.cc.
References SupportedFPImmWidth_.
Referenced by llvm::TCETargetLowering::isFPImmLegal().
bool TCETargetMachine::canEncodeAsMOVI | ( | const llvm::MVT & | vt, |
int64_t | val | ||
) | const |
Returns true if the value can be encoded as immediate to register.
Definition at line 359 of file TCETargetMachine.cc.
References assert, largestImm_, smallestImm_, and llvm::TCEBaseTargetMachine::ttaMach_.
Referenced by llvm::TCETargetLowering::canEncodeImmediate(), and llvm::TCETargetLowering::LowerBuildVector().
|
inline |
Definition at line 321 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::canMaterializeConstant(), and plugin_.
Referenced by llvm::TCETargetLowering::canEncodeImmediate().
TTAMachine::Machine * TCETargetMachine::createMachine | ( | ) |
Creates a TTAMachine::Machine object of the target architecture.
Definition at line 305 of file TCETargetMachine.cc.
References llvm::TCETargetMachinePlugin::adfXML(), plugin_, ADFSerializer::readMachine(), and XMLSerializer::setSourceString().
|
overridevirtual |
const std::set< std::pair< unsigned, llvm::MVT::SimpleValueType > > * TCETargetMachine::customLegalizedOperations | ( | ) |
Returns list of llvm::ISD SelectionDAG opcodes for operations that are not supported in the target architecture but will be custom-selected.
Definition at line 340 of file TCETargetMachine.cc.
References customLegalizedOps_.
Referenced by llvm::TCETargetLowering::TCETargetLowering().
|
inline |
Definition at line 227 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::dataASName(), and plugin_.
|
inline |
Definition at line 261 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::getAddOpcode(), and plugin_.
|
inlinevirtual |
Definition at line 162 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::getDataLayout(), and plugin_.
|
inlinevirtual |
Definition at line 166 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::getFrameLowering(), and plugin_.
|
inlinevirtual |
Definition at line 154 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::getInstrInfo(), and plugin_.
|
inline |
Definition at line 269 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::getIorOpcode(), and plugin_.
int TCETargetMachine::getLoadOpcode | ( | int | asid, |
int | align, | ||
const llvm::EVT & | vt | ||
) | const |
Definition at line 456 of file TCETargetMachine.cc.
References TTAMachine::Machine::functionUnitNavigator(), llvm::TCETargetMachinePlugin::getLoadOpcode(), TTAMachine::Machine::Navigator< ComponentType >::item(), plugin_, and llvm::TCEBaseTargetMachine::ttaMach_.
|
inline |
Definition at line 253 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::getMaxOpcode(), and plugin_.
Referenced by TCEDAGToDAGISel::Select().
|
inline |
Definition at line 257 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::getMaxuOpcode(), and plugin_.
Referenced by TCEDAGToDAGISel::Select().
|
inline |
Definition at line 245 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::getMinOpcode(), and plugin_.
Referenced by TCEDAGToDAGISel::Select().
|
inline |
Definition at line 249 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::getMinuOpcode(), and plugin_.
Referenced by TCEDAGToDAGISel::Select().
|
inlinevirtual |
Definition at line 158 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::getRegisterInfo(), and plugin_.
|
inline |
Definition at line 265 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::getShlOpcode(), and plugin_.
|
inlinevirtual |
Definition at line 144 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::getSubtarget(), and plugin_.
|
inlineoverridevirtual |
Definition at line 150 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::getSubtarget(), and plugin_.
|
inlinevirtual |
Definition at line 169 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::getTargetLowering(), and plugin_.
|
inlineoverride |
Definition at line 183 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::getTargetTransformInfo(), and plugin_.
|
inline |
Definition at line 290 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::has16bitLoads(), and plugin_.
Referenced by llvm::TCETargetLowering::TCETargetLowering().
|
inline |
Definition at line 286 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::has8bitLoads(), and plugin_.
Referenced by llvm::TCETargetLowering::TCETargetLowering().
|
inline |
Definition at line 200 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::hasOperation(), operationName(), and plugin_.
Referenced by llvm::TCERegisterInfo::eliminateFrameIndex(), llvm::TCETargetLowering::LowerBuildVector(), and llvm::TCETargetLowering::LowerShift().
|
inline |
Definition at line 314 of file TCETargetMachine.hh.
References assert, largestImm_, and llvm::TCEBaseTargetMachine::ttaMach_.
Referenced by llvm::TCETargetLowering::TCETargetLowering().
|
inline |
Definition at line 221 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::llvmRegisterId(), and plugin_.
Referenced by llvm::TCETargetLowering::getRegForInlineAsmConstraint().
void llvm::TCETargetMachine::loadPlugin | ( | ) |
const std::set< std::pair< unsigned, llvm::MVT::SimpleValueType > > * TCETargetMachine::missingOperations | ( | ) |
Returns list of llvm::ISD SelectionDAG opcodes for operations that are not supported in the target architecture.
The returned operations have to be expanded to emulation function calls or emulation patterns in TCETargetLowering.
Definition at line 319 of file TCETargetMachine.cc.
References missingOps_.
Referenced by llvm::TCETargetLowering::TCETargetLowering().
|
inline |
Definition at line 241 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::opcode(), operationName(), and plugin_.
Referenced by llvm::TCERegisterInfo::eliminateFrameIndex().
|
inline |
Definition at line 188 of file TCETargetMachine.hh.
References llvm::TCETargetMachinePlugin::operationName(), and plugin_.
Referenced by llvm::TCERegisterInfo::eliminateFrameIndex(), hasOperation(), opcode(), osalInputIndex(), and ConstantTransformer::runOnMachineFunction().
const std::set< std::pair< unsigned, llvm::MVT::SimpleValueType > > * TCETargetMachine::promotedOperations | ( | ) |
Returns list of llvm::ISD SelectionDAG opcodes for operations that are not supported in the target architecture but will be promoted.
The returned operations have to be promoted to emulation function calls or emulation patterns in TCETargetLowering.
Definition at line 331 of file TCETargetMachine.cc.
References promotedOps_.
Referenced by llvm::TCETargetLowering::TCETargetLowering().
|
inline |
Definition at line 231 of file TCETargetMachine.hh.
References plugin_, and llvm::TCETargetMachinePlugin::raPortDRegNum().
|
inline |
Definition at line 208 of file TCETargetMachine.hh.
References plugin_, and llvm::TCETargetMachinePlugin::registerIndex().
Referenced by llvm::LLVMTCEBuilder::emitWriteSP(), and registerName().
|
inline |
Returns full name of the register.
Definition at line 216 of file TCETargetMachine.hh.
References registerIndex(), and rfName().
Referenced by llvm::LLVMTCEBuilder::emitInlineAsm(), InlineAsmParser::registerName(), and InlineAsmParser::substituteAsmString().
|
inline |
Definition at line 204 of file TCETargetMachine.hh.
References plugin_, and llvm::TCETargetMachinePlugin::rfName().
Referenced by llvm::LLVMTCEBuilder::emitWriteSP(), llvm::TCETargetLowering::hasI1RegisterClass(), and registerName().
|
inlinevirtual |
Definition at line 127 of file TCETargetMachine.hh.
References emulationModule_.
Referenced by LLVMBackend::compile().
|
inline |
Definition at line 273 of file TCETargetMachine.hh.
References stackAlignment_.
Referenced by LLVMBackend::compile().
|
virtual |
Definition at line 167 of file TCETargetMachine.cc.
References customLegalizedOps_, llvm::TCETargetMachinePlugin::getDataLayout(), llvm::TCETargetMachinePlugin::getDefaultType(), llvm::TCETargetMachinePlugin::hasMUL(), llvm::TCETargetMachinePlugin::hasROTL(), llvm::TCETargetMachinePlugin::hasROTR(), llvm::TCETargetMachinePlugin::hasSDIV(), llvm::TCETargetMachinePlugin::hasSHL(), llvm::TCETargetMachinePlugin::hasSHR(), llvm::TCETargetMachinePlugin::hasSHRU(), llvm::TCETargetMachinePlugin::hasSQRTF(), llvm::TCETargetMachinePlugin::hasSREM(), llvm::TCETargetMachinePlugin::hasSXHW(), llvm::TCETargetMachinePlugin::hasSXQW(), llvm::TCETargetMachinePlugin::hasUDIV(), llvm::TCETargetMachinePlugin::hasUREM(), TTAMachine::Machine::is64bit(), llvm::TCETargetMachinePlugin::isLittleEndian(), MachineInfo::maxMemoryAlignment(), missingOps_, plugin_, promotedOps_, llvm::TCETargetMachinePlugin::registerTargetMachine(), setTTAMach(), and Conversion::toString().
Referenced by LLVMBackend::compile().
|
inlineoverridevirtual |
Reimplemented from llvm::TCEBaseTargetMachine.
Definition at line 131 of file TCETargetMachine.hh.
References calculateSupportedImmediates(), and llvm::TCEBaseTargetMachine::setTTAMach().
Referenced by setTargetMachinePlugin().
|
inline |
Definition at line 310 of file TCETargetMachine.hh.
References assert, smallestImm_, and llvm::TCEBaseTargetMachine::ttaMach_.
|
inline |
Definition at line 237 of file TCETargetMachine.hh.
References plugin_, and llvm::TCETargetMachinePlugin::spDRegNum().
Referenced by llvm::LLVMTCEBuilder::emitWriteSP().
|
inline |
Definition at line 277 of file TCETargetMachine.hh.
References assert, and stackAlignment_.
Referenced by llvm::LLVMTCEBuilder::emitSPInitialization(), llvm::LLVMTCEBuilder::initDataSections(), llvm::TCETargetLowering::LowerCall(), llvm::TCETargetLowering::LowerFormalArguments(), and llvm::GeneratedTCEPlugin::registerTargetMachine().
|
inlinevirtual |
Definition at line 120 of file TCETargetMachine.hh.
References plugin_.
Referenced by ConstantTransformer::runOnMachineFunction().
|
inlinevirtual |
Definition at line 137 of file TCETargetMachine.hh.
References llvm::TCEBaseTargetMachine::ttaMach_.
Referenced by InlineAsmParser::parse(), and llvm::TCETargetLowering::TCETargetLowering().
|
inline |
Returns true if LLVM opcode if valid for stack variable accesses.
Definition at line 196 of file TCETargetMachine.hh.
References plugin_, and llvm::TCETargetMachinePlugin::validStackAccessOperation().
Referenced by llvm::TCERegisterInfo::eliminateFrameIndex().
|
private |
Definition at line 335 of file TCETargetMachine.hh.
Referenced by customLegalizedOperations(), and setTargetMachinePlugin().
Module* llvm::TCETargetMachine::emulationModule_ |
These two parameter passing should be rethought... maybe TTAMach can be avoided by changing pass to use plugin_ instead.
Definition at line 126 of file TCETargetMachine.hh.
Referenced by setEmulationModule().
|
private |
Definition at line 340 of file TCETargetMachine.hh.
Referenced by calculateSupportedImmediates(), canEncodeAsMOVI(), and largestImmValue().
|
private |
llvm::ISD opcode list of operations that have to be expanded.
Definition at line 333 of file TCETargetMachine.hh.
Referenced by missingOperations(), and setTargetMachinePlugin().
|
private |
Definition at line 330 of file TCETargetMachine.hh.
Referenced by bitness(), canMaterializeConstant(), createMachine(), createPassConfig(), dataASName(), getAddOpcode(), getDataLayout(), getFrameLowering(), getInstrInfo(), getIorOpcode(), getLoadOpcode(), getMaxOpcode(), getMaxuOpcode(), getMinOpcode(), getMinuOpcode(), getRegisterInfo(), getShlOpcode(), getSubtargetImpl(), getTargetLowering(), getTargetTransformInfo(), has16bitLoads(), has8bitLoads(), hasOperation(), llvmRegisterId(), opcode(), operationName(), raPortDRegNum(), registerIndex(), rfName(), setTargetMachinePlugin(), spDRegNum(), targetPlugin(), and validStackAccessOperation().
|
private |
Definition at line 331 of file TCETargetMachine.hh.
Referenced by ~TCETargetMachine().
|
private |
Definition at line 334 of file TCETargetMachine.hh.
Referenced by promotedOperations(), and setTargetMachinePlugin().
|
private |
Definition at line 339 of file TCETargetMachine.hh.
Referenced by calculateSupportedImmediates(), canEncodeAsMOVI(), and smallestImmValue().
|
private |
Definition at line 344 of file TCETargetMachine.hh.
Referenced by setStackAlignment(), and stackAlignment().
|
private |
Definition at line 341 of file TCETargetMachine.hh.
Referenced by calculateSupportedImmediates(), and canEncodeAsMOVF().