OpenASIP  2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
llvm::GeneratedTCEPlugin Class Reference
Inheritance diagram for llvm::GeneratedTCEPlugin:
Inheritance graph
Collaboration diagram for llvm::GeneratedTCEPlugin:
Collaboration graph

Public Member Functions

 GeneratedTCEPlugin ()
 
virtual ~GeneratedTCEPlugin ()
 
virtual const TargetInstrInfo * getInstrInfo () const override
 
virtual const TargetRegisterInfo * getRegisterInfo () const override
 
virtual const TargetFrameLowering * getFrameLowering () const override
 
virtual TargetLowering * getTargetLowering () const override
 
virtual TargetTransformInfo getTargetTransformInfo (const Function &F) const override
 
virtual const TargetSubtargetInfo * getSubtarget () const override
 
virtual FunctionPass * createISelPass (TCETargetMachine *tm) override
 
virtual unsigned spDRegNum () override
 Returns ID number of the stack pointer register. More...
 
virtual unsigned fpDRegNum () override
 Returns ID number of the frame pointer register. More...
 
virtual unsigned rvDRegNum () override
 
virtual unsigned rvHighDRegNum () override
 
virtual std::vector< unsigned > getParamDRegNums () const override
 
virtual std::vector< unsigned > getVectorRVDRegNums () const override
 
virtual const std::string * adfXML () override
 Returns pointer to xml string of the target machine .adf. More...
 
virtual MVT::SimpleValueType getDefaultType () const override
 
virtual std::string rfName (unsigned dwarfRegNum) override
 
virtual unsigned registerIndex (unsigned dwarfRegNum) override
 
unsigned llvmRegisterId (const TCEString &ttaRegister) override
 
unsigned int extractElementLane (const llvm::MachineInstr &) const override
 
virtual std::string operationName (unsigned opc) const override
 
virtual bool validStackAccessOperation (const std::string &opName) const override
 Returns true if OSAL operation is valid for stack accesses. More...
 
virtual bool hasOperation (TCEString operationName) const override
 Returns true in case the target supports the given osal operation. More...
 
virtual unsigned opcode (TCEString operationName) const override
 Returns the opcode for the given osal operation, undefined if not found. More...
 
virtual int getTruePredicateOpcode (unsigned opc) const override
 
virtual int getFalsePredicateOpcode (unsigned opc) const override
 
unsigned int raPortDRegNum () override
 Returns ID number of the return address register. More...
 
std::string dataASName () override
 Returns name of the data address space. More...
 
virtual bool hasSDIV () const override
 
virtual bool hasUDIV () const override
 
virtual bool hasSREM () const override
 
virtual bool hasUREM () const override
 
virtual bool hasMUL () const override
 
virtual bool hasROTL () const override
 
virtual bool hasROTR () const override
 
virtual bool hasSXHW () const override
 
virtual bool hasSXQW () const override
 
virtual bool hasSQRTF () const override
 
virtual bool hasSHR () const override
 
virtual bool hasSHL () const override
 
virtual bool hasSHRU () const override
 
virtual bool has8bitLoads () const override
 
virtual bool has16bitLoads () const override
 
virtual int maxVectorSize () const override
 
virtual bool analyzeCCBranch (llvm::MachineInstr &i, llvm::SmallVectorImpl< llvm::MachineOperand > &cond) const override
 
virtual void registerTargetMachine (TCETargetMachine &tm) override
 Plugin needs target machine for TragetLowering generation. More...
 
virtual int getLoad (const TargetRegisterClass *rc) const override
 
virtual int getStore (const TargetRegisterClass *rc) const override
 
virtual int getMinOpcode (llvm::SDNode *n) const override
 
virtual int getMaxOpcode (llvm::SDNode *n) const override
 
virtual int getMinuOpcode (llvm::SDNode *n) const override
 
virtual int getMaxuOpcode (llvm::SDNode *n) const override
 
virtual const llvm::TargetRegisterClass * extrasRegClass (const llvm::TargetRegisterClass *current) const override
 
virtual const llvm::TargetRegisterClass * nodeRegClass (unsigned nodeId, const llvm::TargetRegisterClass *current) const override
 
virtual int getLoadOpcode (const EVT &vt) const override
 
virtual int getAddOpcode (const EVT &vt) const override
 
virtual int getShlOpcode (const EVT &vt) const override
 
virtual int getIorOpcode (const EVT &vt) const override
 
virtual bool isLittleEndian () const override
 
virtual bool is64bit () const override
 
virtual bool canMaterializeConstant (const ConstantInt &ci) const override
 
virtual std::tuple< int, int > getPointerAdjustment (int offset) const override
 
virtual void manualInitialize ()
 
- Public Member Functions inherited from llvm::TCETargetMachinePlugin
 TCETargetMachinePlugin ()
 
virtual ~TCETargetMachinePlugin ()
 
virtual unsigned int extractElementLane (const MachineInstr &mi) const =0
 
virtual int getLoadOpcode (const llvm::EVT &vt) const =0
 
virtual int getAddOpcode (const llvm::EVT &vt) const =0
 
virtual int getShlOpcode (const llvm::EVT &vt) const =0
 
virtual int getIorOpcode (const llvm::EVT &vt) const =0
 
virtual const DataLayout * getDataLayout () const
 
virtual DataLayout * getDataLayout ()
 
virtual TCETargetMachinegetCurrentTargetMachine ()
 
virtual const TCETargetMachinegetCurrentTargetMachine () const
 
virtual const SelectionDAGTargetInfo * getSelectionDAGInfo () const
 

Private Member Functions

void initialize ()
 

Private Attributes

std::map< unsigned, TCEStringopNames_
 
std::map< unsigned, unsigned > truePredOps_
 
std::map< unsigned, unsigned > falsePredOps_
 
std::map< unsigned, TCEStringregNames_
 
std::map< unsigned, unsigned > regIndices_
 
std::map< TCEString, unsigned > ttallvmRegMap_
 Map for TTA register to LLVM register id conversion. More...
 
TCETools::CIStringSet validStackAccessOperations_
 Set of valid LLVM opcodes for stack accesses. More...
 
std::string adfXML_
 
std::string dataASName_
 

Additional Inherited Members

- Protected Attributes inherited from llvm::TCETargetMachinePlugin
TCEInstrInfoinstrInfo_
 Target machine instruction info for the llvm framework. More...
 
TargetLowering * lowering_
 
TargetFrameLowering * frameInfo_
 
TCETargetMachinetm_
 
TCESubtargetsubTarget_
 
DataLayout dl_
 
SelectionDAGTargetInfo tsInfo_
 

Detailed Description

Definition at line 56 of file TCETargetMachinePlugin.cc.

Constructor & Destructor Documentation

◆ GeneratedTCEPlugin()

GeneratedTCEPlugin::GeneratedTCEPlugin ( )

The Constructor.

Definition at line 231 of file TCETargetMachinePlugin.cc.

231  :
233 }

◆ ~GeneratedTCEPlugin()

GeneratedTCEPlugin::~GeneratedTCEPlugin ( )
virtual

The Destructor.

Definition at line 239 of file TCETargetMachinePlugin.cc.

239  {
240  delete instrInfo_;
241  if (lowering_ != NULL) {
242  delete lowering_;
243  lowering_ = NULL;
244  }
245 }

References llvm::TCETargetMachinePlugin::instrInfo_, and llvm::TCETargetMachinePlugin::lowering_.

Member Function Documentation

◆ adfXML()

virtual const std::string* llvm::GeneratedTCEPlugin::adfXML ( )
inlineoverridevirtual

Returns pointer to xml string of the target machine .adf.

Implements llvm::TCETargetMachinePlugin.

Definition at line 90 of file TCETargetMachinePlugin.cc.

90  {
91  return &adfXML_;
92  }

References adfXML_.

Referenced by TCEPluginInitializer::TCEPluginInitializer().

◆ analyzeCCBranch()

virtual bool llvm::GeneratedTCEPlugin::analyzeCCBranch ( llvm::MachineInstr &  i,
llvm::SmallVectorImpl< llvm::MachineOperand > &  cond 
) const
overridevirtual

Reimplemented from llvm::TCETargetMachinePlugin.

◆ canMaterializeConstant()

virtual bool llvm::GeneratedTCEPlugin::canMaterializeConstant ( const ConstantInt &  ci) const
overridevirtual

◆ createISelPass()

FunctionPass * GeneratedTCEPlugin::createISelPass ( TCETargetMachine tm)
overridevirtual

Creates instruction selector for TCE target machine.

Implements llvm::TCETargetMachinePlugin.

Definition at line 327 of file TCETargetMachinePlugin.cc.

327  {
328  return createTCEISelDag(*tm);
329 }

References llvm::createTCEISelDag().

Here is the call graph for this function:

◆ dataASName()

std::string GeneratedTCEPlugin::dataASName ( )
overridevirtual

Returns name of the data address space.

Implements llvm::TCETargetMachinePlugin.

Definition at line 573 of file TCETargetMachinePlugin.cc.

573  {
574  return dataASName_;
575 }

References dataASName_.

◆ extractElementLane()

unsigned int GeneratedTCEPlugin::extractElementLane ( const llvm::MachineInstr &  mi) const
override

Returns true in case the given opc is for an extract element operation.

Definition at line 336 of file TCETargetMachinePlugin.cc.

336  {
337  // TODO: use subregisters (extract_subreg) instead.
338  if (mi.getDesc().getOpcode() == TCE::COPY) {
339  assert(mi.getNumOperands() >= 2);
340  const MachineOperand& src = mi.getOperand(1);
341  int subreg = src.getSubReg();
342  if (subreg > 0 && subreg < 9) {
343  return subreg -1;
344  }
345  }
346  return UINT_MAX;
347 }

References assert.

◆ extrasRegClass()

const llvm::TargetRegisterClass * GeneratedTCEPlugin::extrasRegClass ( const llvm::TargetRegisterClass *  current) const
overridevirtual

Returns the specific register class representing registers belonging to the "extras node" inside a clustered-TTA.

Parameters
currentThe "more general" register class to replace.

Implements llvm::TCETargetMachinePlugin.

Definition at line 541 of file TCETargetMachinePlugin.cc.

542  {
543  const llvm::TargetRegisterInfo& TRI = *getRegisterInfo();
544 
545  return NULL;
546 }

References getRegisterInfo().

Here is the call graph for this function:

◆ fpDRegNum()

virtual unsigned llvm::GeneratedTCEPlugin::fpDRegNum ( )
inlineoverridevirtual

Returns ID number of the frame pointer register.

Implements llvm::TCETargetMachinePlugin.

Definition at line 74 of file TCETargetMachinePlugin.cc.

74  {
75  return TCE::FP;
76  }

◆ getAddOpcode()

virtual int llvm::GeneratedTCEPlugin::getAddOpcode ( const EVT &  vt) const
overridevirtual

◆ getDefaultType()

virtual MVT::SimpleValueType llvm::GeneratedTCEPlugin::getDefaultType ( ) const
inlineoverridevirtual

Implements llvm::TCETargetMachinePlugin.

Definition at line 94 of file TCETargetMachinePlugin.cc.

94  {
95 #ifdef TARGET64BIT
96  return MVT::i64;
97 #else
98  return MVT::i32;
99 #endif
100  }

◆ getFalsePredicateOpcode()

int GeneratedTCEPlugin::getFalsePredicateOpcode ( unsigned  opc) const
overridevirtual

Implements llvm::TCETargetMachinePlugin.

Definition at line 358 of file TCETargetMachinePlugin.cc.

358  {
359  std::map<unsigned int, unsigned int>::const_iterator i = falsePredOps_.find(opc);
360  if (i == falsePredOps_.end()) {
361  return -1;
362  } else {
363  return i->second;
364  }
365 }

References falsePredOps_.

◆ getFrameLowering()

const TargetFrameLowering * GeneratedTCEPlugin::getFrameLowering ( ) const
overridevirtual

Returns TargetFrameInfo object for TCE target.

Implements llvm::TCETargetMachinePlugin.

Definition at line 300 of file TCETargetMachinePlugin.cc.

300  {
301  return frameInfo_;
302 }

References llvm::TCETargetMachinePlugin::frameInfo_.

◆ getInstrInfo()

const TargetInstrInfo * GeneratedTCEPlugin::getInstrInfo ( ) const
overridevirtual

Returns TargetInstrInfo object for TCE target.

Implements llvm::TCETargetMachinePlugin.

Definition at line 284 of file TCETargetMachinePlugin.cc.

284  {
285  return instrInfo_;
286 }

References llvm::TCETargetMachinePlugin::instrInfo_.

◆ getIorOpcode()

virtual int llvm::GeneratedTCEPlugin::getIorOpcode ( const EVT &  vt) const
overridevirtual

◆ getLoad()

virtual int llvm::GeneratedTCEPlugin::getLoad ( const TargetRegisterClass *  rc) const
overridevirtual

◆ getLoadOpcode()

virtual int llvm::GeneratedTCEPlugin::getLoadOpcode ( const EVT &  vt) const
overridevirtual

◆ getMaxOpcode()

virtual int llvm::GeneratedTCEPlugin::getMaxOpcode ( llvm::SDNode *  n) const
overridevirtual

◆ getMaxuOpcode()

virtual int llvm::GeneratedTCEPlugin::getMaxuOpcode ( llvm::SDNode *  n) const
overridevirtual

◆ getMinOpcode()

virtual int llvm::GeneratedTCEPlugin::getMinOpcode ( llvm::SDNode *  n) const
overridevirtual

◆ getMinuOpcode()

virtual int llvm::GeneratedTCEPlugin::getMinuOpcode ( llvm::SDNode *  n) const
overridevirtual

◆ getParamDRegNums()

virtual std::vector<unsigned> llvm::GeneratedTCEPlugin::getParamDRegNums ( ) const
overridevirtual

◆ getPointerAdjustment()

virtual std::tuple<int, int> llvm::GeneratedTCEPlugin::getPointerAdjustment ( int  offset) const
overridevirtual

◆ getRegisterInfo()

const TargetRegisterInfo * GeneratedTCEPlugin::getRegisterInfo ( ) const
overridevirtual

Returns TargetRegisterInfo object for TCE target.

Implements llvm::TCETargetMachinePlugin.

Definition at line 292 of file TCETargetMachinePlugin.cc.

292  {
293  return &(static_cast<TCEInstrInfo*>(instrInfo_))->getRegisterInfo();
294 }

References llvm::TCETargetMachinePlugin::instrInfo_.

Referenced by extrasRegClass(), and registerTargetMachine().

◆ getShlOpcode()

virtual int llvm::GeneratedTCEPlugin::getShlOpcode ( const EVT &  vt) const
overridevirtual

◆ getStore()

virtual int llvm::GeneratedTCEPlugin::getStore ( const TargetRegisterClass *  rc) const
overridevirtual

◆ getSubtarget()

const TargetSubtargetInfo * GeneratedTCEPlugin::getSubtarget ( ) const
overridevirtual

Implements llvm::TCETargetMachinePlugin.

Definition at line 319 of file TCETargetMachinePlugin.cc.

319  {
320  return subTarget_;
321 }

References llvm::TCETargetMachinePlugin::subTarget_.

◆ getTargetLowering()

TargetLowering * GeneratedTCEPlugin::getTargetLowering ( ) const
overridevirtual

Returns TargetLowering object for TCE target.

Implements llvm::TCETargetMachinePlugin.

Definition at line 313 of file TCETargetMachinePlugin.cc.

313  {
314  assert(lowering_ != NULL && "TCETargetMachine has not registered to plugin.");
315  return lowering_;
316 }

References assert, and llvm::TCETargetMachinePlugin::lowering_.

◆ getTargetTransformInfo()

TargetTransformInfo GeneratedTCEPlugin::getTargetTransformInfo ( const Function &  F) const
overridevirtual

Implements llvm::TCETargetMachinePlugin.

Definition at line 305 of file TCETargetMachinePlugin.cc.

305  {
306  return TargetTransformInfo(TCETTIImpl(tm_, F));
307 }

References llvm::TCETargetMachinePlugin::tm_.

◆ getTruePredicateOpcode()

int GeneratedTCEPlugin::getTruePredicateOpcode ( unsigned  opc) const
overridevirtual

Implements llvm::TCETargetMachinePlugin.

Definition at line 349 of file TCETargetMachinePlugin.cc.

349  {
350  std::map<unsigned int, unsigned int>::const_iterator i = truePredOps_.find(opc);
351  if (i == truePredOps_.end()) {
352  return -1;
353  } else {
354  return i->second;
355  }
356 }

References truePredOps_.

◆ getVectorRVDRegNums()

virtual std::vector<unsigned> llvm::GeneratedTCEPlugin::getVectorRVDRegNums ( ) const
overridevirtual

◆ has16bitLoads()

virtual bool llvm::GeneratedTCEPlugin::has16bitLoads ( ) const
overridevirtual

◆ has8bitLoads()

virtual bool llvm::GeneratedTCEPlugin::has8bitLoads ( ) const
overridevirtual

◆ hasMUL()

virtual bool llvm::GeneratedTCEPlugin::hasMUL ( ) const
overridevirtual

◆ hasOperation()

virtual bool llvm::GeneratedTCEPlugin::hasOperation ( TCEString  operationName) const
inlineoverridevirtual

Returns true in case the target supports the given osal operation.

Implements llvm::TCETargetMachinePlugin.

Definition at line 117 of file TCETargetMachinePlugin.cc.

117  {
119  }

References MapTools::containsValue(), operationName(), and opNames_.

Here is the call graph for this function:

◆ hasROTL()

virtual bool llvm::GeneratedTCEPlugin::hasROTL ( ) const
overridevirtual

◆ hasROTR()

virtual bool llvm::GeneratedTCEPlugin::hasROTR ( ) const
overridevirtual

◆ hasSDIV()

virtual bool llvm::GeneratedTCEPlugin::hasSDIV ( ) const
overridevirtual

◆ hasSHL()

virtual bool llvm::GeneratedTCEPlugin::hasSHL ( ) const
overridevirtual

◆ hasSHR()

virtual bool llvm::GeneratedTCEPlugin::hasSHR ( ) const
overridevirtual

◆ hasSHRU()

virtual bool llvm::GeneratedTCEPlugin::hasSHRU ( ) const
overridevirtual

◆ hasSQRTF()

virtual bool llvm::GeneratedTCEPlugin::hasSQRTF ( ) const
overridevirtual

◆ hasSREM()

virtual bool llvm::GeneratedTCEPlugin::hasSREM ( ) const
overridevirtual

◆ hasSXHW()

virtual bool llvm::GeneratedTCEPlugin::hasSXHW ( ) const
overridevirtual

◆ hasSXQW()

virtual bool llvm::GeneratedTCEPlugin::hasSXQW ( ) const
overridevirtual

◆ hasUDIV()

virtual bool llvm::GeneratedTCEPlugin::hasUDIV ( ) const
overridevirtual

◆ hasUREM()

virtual bool llvm::GeneratedTCEPlugin::hasUREM ( ) const
overridevirtual

◆ initialize()

void llvm::GeneratedTCEPlugin::initialize ( )
private

◆ is64bit()

virtual bool llvm::GeneratedTCEPlugin::is64bit ( ) const
overridevirtual

◆ isLittleEndian()

virtual bool llvm::GeneratedTCEPlugin::isLittleEndian ( ) const
overridevirtual

◆ llvmRegisterId()

unsigned llvm::GeneratedTCEPlugin::llvmRegisterId ( const TCEString ttaRegister)
inlineoverridevirtual

Returns LLVM register ID corresponding to TTA register name.

Parameters
ttaRegisterThe name of the TTA register. For example "RF.5".
Returns
The register number if it exists in the target. Otherwise, returns TCE::NoRegister.

Implements llvm::TCETargetMachinePlugin.

Definition at line 104 of file TCETargetMachinePlugin.cc.

104  {
105  if (ttallvmRegMap_.count(ttaRegister)) {
106  return ttallvmRegMap_[ttaRegister];
107  }
108  return TCE::NoRegister;
109  }

References ttallvmRegMap_.

◆ manualInitialize()

void GeneratedTCEPlugin::manualInitialize ( )
virtual

Definition at line 248 of file TCETargetMachinePlugin.cc.

248  {
249  initialize();
250 }

References initialize().

Referenced by TCEPluginInitializer::TCEPluginInitializer().

Here is the call graph for this function:

◆ maxVectorSize()

virtual int llvm::GeneratedTCEPlugin::maxVectorSize ( ) const
overridevirtual

◆ nodeRegClass()

const llvm::TargetRegisterClass * GeneratedTCEPlugin::nodeRegClass ( unsigned  nodeId,
const llvm::TargetRegisterClass *  current 
) const
overridevirtual

Returns the specific register class representing registers belonging to a "computation node" inside a clustered-TTA.

This can be used to limit the registers to be allocated from a single node, thus also suggest scheduling the operations there. For data parallel code.

Parameters
nodeIdthe ID of the node (starting from 0)
currentThe "more general" register class to replace.

Implements llvm::TCETargetMachinePlugin.

Definition at line 527 of file TCETargetMachinePlugin.cc.

528  {
529 
530  return NULL;
531 }

◆ opcode()

virtual unsigned llvm::GeneratedTCEPlugin::opcode ( TCEString  operationName) const
inlineoverridevirtual

Returns the opcode for the given osal operation, undefined if not found.

Implements llvm::TCETargetMachinePlugin.

Definition at line 121 of file TCETargetMachinePlugin.cc.

121  {
122  return MapTools::keyForValue<unsigned>(opNames_, operationName.upper());
123  }

References operationName(), and opNames_.

Here is the call graph for this function:

◆ operationName()

std::string GeneratedTCEPlugin::operationName ( unsigned  opc) const
overridevirtual

Maps llvm target opcodes to target operation names.

Returns an empty string in case the operation code could not be mapped to an OSAL operation name. This is the case with pseudo ops, for example.

Implements llvm::TCETargetMachinePlugin.

Definition at line 375 of file TCETargetMachinePlugin.cc.

375  {
376 
377  const std::string MOVE = "MOVE";
378  const std::string PSEUDO = "PSEUDO";
379  const std::string NOP = "NOP";
380  const std::string INLINEASM = "INLINEASM";
381  const std::string DEBUG_LABEL = "DEBUG_LABEL";
382  const std::string DEBUG_VALUE = "DEBUG_VALUE";
383  const std::string DEBUG_INSTR_REF = "DEBUG_INSTR_REF";
384  const std::string DEBUG_VALUE_LIST = "DEBUG_VALUE_LIST";
385  const std::string DEBUG_PHI = "DEBUG_PHI";
386 
387  if (opc == TCE::IMPLICIT_DEF) return PSEUDO;
388  else if (opc == TCE::ADJCALLSTACKDOWN) return PSEUDO;
389  else if (opc == TCE::ADJCALLSTACKUP) return PSEUDO;
390  else if (opc == TCE::NOP) return NOP;
391  if (opc == TCE::DBG_VALUE) return DEBUG_VALUE;
392  if (opc == TCE::DBG_INSTR_REF) return DEBUG_INSTR_REF;
393  if (opc == TCE::DBG_LABEL) return DEBUG_LABEL;
394  if (opc == TCE::DBG_VALUE_LIST) return DEBUG_VALUE_LIST;
395  if (opc == TCE::DBG_PHI) return DEBUG_PHI;
396  // Moves
397  if (opc == TCE::COPY) return MOVE;
398  if (opc == TCE::MOVI1rr) return MOVE;
399  if (opc == TCE::PRED_TRUE_MOVI1rr) return "?MOVE";
400  if (opc == TCE::PRED_FALSE_MOVI1rr) return "!MOVE";
401  if (opc == TCE::MOVI1ri) return MOVE;
402  if (opc == TCE::PRED_TRUE_MOVI1ri) return "?MOVE";
403  if (opc == TCE::PRED_FALSE_MOVI1ri) return "!MOVE";
404  if (opc == TCE::MOVGri) return MOVE;
405  if (opc == TCE::MOVI32rr) return MOVE;
406  if (opc == TCE::PRED_TRUE_MOVI32rr) return "?MOVE";
407  if (opc == TCE::PRED_FALSE_MOVI32rr) return "!MOVE";
408  if (opc == TCE::MOVI32ri) return MOVE;
409  if (opc == TCE::PRED_TRUE_MOVI32ri) return "?MOVE";
410  if (opc == TCE::PRED_FALSE_MOVI32ri) return "!MOVE";
411  if (opc == TCE::MOVI64sa) return MOVE;
412  if (opc == TCE::PRED_TRUE_MOVI64sa) return "?MOVE";
413  if (opc == TCE::PRED_FALSE_MOVI64sa) return "!MOVE";
414  if (opc == TCE::MOV64ss) return MOVE;
415  if (opc == TCE::PRED_TRUE_MOV64ss) return "?MOVE";
416  if (opc == TCE::PRED_FALSE_MOV64ss) return "!MOVE";
417  if (opc == TCE::MOVI64I1ss) return MOVE;
418 
419  // TODO: why no predicated version of this?
420  if (opc == TCE::MOVff) return MOVE;
421  if (opc == TCE::MOVfi) return MOVE;
422  if (opc == TCE::MOVfk) return MOVE;
423  if (opc == TCE::MOVI32I1rr) return MOVE;
424  if (opc == TCE::MOVFI32rf) return MOVE;
425  if (opc == TCE::MOVIF32fr) return MOVE;
426  if (opc == TCE::MOVGrr) return MOVE;
427  if (opc == TCE::MOVGI32rr) return MOVE;
428  if (opc == TCE::MOVI32Grr) return MOVE;
429  if (opc == TCE::MOVGI1rr) return MOVE;
430  if (opc == TCE::MOVI1Grr) return MOVE;
431  if (opc == TCE::MOVhh) return MOVE;
432  if (opc == TCE::MOVhk) return MOVE;
433  if (opc == TCE::MOVrh) return MOVE;
434  if (opc == TCE::MOVhr) return MOVE;
435  if (opc == TCE::MOVhi) return MOVE;
436  if (opc == TCE::MOVsd) return MOVE;
437  if (opc == TCE::MOVds) return MOVE;
438 
439  // TODO: added as a spot fix for simd_operations_On,
440  // which selects this particular move operation.
441  // Most likely, the compiler can pick other moves not
442  // listed here, and subsequently crash.
443  if (opc == TCE::MOVI1I32rr) return MOVE;
444 
445  if (opc == TCE::INLINEASM) return INLINEASM;
446 
447 /* TODO: 64-bit support missing here? */
448 
449  if (opc == TCE::ADDfri || opc == TCE::ADDhri) return "add";
450 
451  if (opc == TCE::SUBfir || opc == TCE::SUBfri || opc == TCE::SUBhir ||
452  opc == TCE::SUBhri) return "sub";
453 
454  if (opc == TCE::SUBfir) return "sub";
455  if (opc == TCE::SUBfri) return "sub";
456 
457 #ifdef TARGET64BIT
458  if (opc == TCE::ANDext) return "and64";
459  if (opc == TCE::XORbicmp) return "xor64";
460 #else
461  if (opc == TCE::ANDext) return "and";
462  if (opc == TCE::XORbicmp) return "xor";
463 #endif
464 
465 
466  if (opc == TCE::STQBrb) return "stq";
467  if (opc == TCE::STQBib) return "stq";
468  if (opc == TCE::STQBrj) return "stq";
469  if (opc == TCE::STQBij) return "stq";
470 
471  if (opc == TCE::ST8Brb) return "st8";
472  if (opc == TCE::ST8Bib) return "st8";
473  if (opc == TCE::ST8Brj) return "st8";
474  if (opc == TCE::ST8Bij) return "st8";
475 
476  // temporary RA register store/loads
477 #ifdef TARGET64BIT
478  if (opc == TCE::ST64RAss) return "st64";
479  if (opc == TCE::LD64RAs) return "ld64";
480 #else
481  if (opc == TCE::STWRArr) return "stw";
482  if (opc == TCE::LDWRAr) return "ldw";
483  if (opc == TCE::ST32RArr) return "st32";
484  if (opc == TCE::LD32RAr) return "ld32";
485 #endif
486  if (opc == TCE::TCEBR) return "jump";
487  if (opc == TCE::TCEBRIND) return "jump";
488  if (opc == TCE::CALL) return "call";
489  if (opc == TCE::CALL_MEMrr) return "call";
490  if (opc == TCE::CALL_MEMri) return "call";
491 
492  std::map<unsigned int, TCEString>::const_iterator opNameIt;
493 
494  std::map<unsigned int, TCEString>::const_iterator i = opNames_.find(opc);
495  if (i == opNames_.end()) {
496  std::cerr << "ERROR: Couldn't find operation with opc: " << opc
497  << std::endl;
498  std::cerr << "Total ops: " << opNames_.size() << std::endl;
499 /*
500  abort();
501 */
502  return "";
503  } else {
504  return i->second;
505  }
506 }

References TCEISD::CALL, MOVE, NOP, and opNames_.

Referenced by hasOperation(), and opcode().

◆ raPortDRegNum()

unsigned GeneratedTCEPlugin::raPortDRegNum ( )
overridevirtual

Returns ID number of the return address register.

Implements llvm::TCETargetMachinePlugin.

Definition at line 578 of file TCETargetMachinePlugin.cc.

578  {
579  return TCE::RA;
580 }

References RA.

◆ registerIndex()

unsigned GeneratedTCEPlugin::registerIndex ( unsigned  dwarfRegNum)
overridevirtual

Maps llvm register numbers to target RF indices.

Implements llvm::TCETargetMachinePlugin.

Definition at line 564 of file TCETargetMachinePlugin.cc.

564  {
565  if (regIndices_.find(dwarfRegNum) == regIndices_.end()) {
566  return dwarfRegNum;
567  }
568  return regIndices_[dwarfRegNum];
569 }

References regIndices_.

◆ registerTargetMachine()

void GeneratedTCEPlugin::registerTargetMachine ( TCETargetMachine tm)
overridevirtual

Plugin needs target machine for TragetLowering generation.

Implements llvm::TCETargetMachinePlugin.

Definition at line 253 of file TCETargetMachinePlugin.cc.

254  {
255  tm_ = &tm;
256  instrInfo_ = new TCEInstrInfo(this);
257  // Initialize register & opcode maps.
258  initialize();
259 
260  TCERegisterInfo* ri =
261  const_cast<TCERegisterInfo*>(
262  static_cast<const TCERegisterInfo*>(getRegisterInfo()));
264 
265  if (isLittleEndian()) {
266 #ifndef TARGET64BIT
267  subTarget_ = new TCELESubtarget(this);
268 #else
269  subTarget_ = new TCELE64Subtarget(this);
270 #endif
271  } else {
272  subTarget_ = new TCESubtarget(this);
273  }
274 
275  if (lowering_ == NULL) {
277  }
278 }

References llvm::TCETargetMachinePlugin::frameInfo_, getRegisterInfo(), initialize(), llvm::TCETargetMachinePlugin::instrInfo_, isLittleEndian(), llvm::TCETargetMachinePlugin::lowering_, llvm::TCETargetMachine::stackAlignment(), llvm::TCETargetMachinePlugin::subTarget_, and llvm::TCETargetMachinePlugin::tm_.

Here is the call graph for this function:

◆ rfName()

std::string GeneratedTCEPlugin::rfName ( unsigned  dwarfRegNum)
overridevirtual

Maps llvm register numbers to target RF names.

Implements llvm::TCETargetMachinePlugin.

Definition at line 553 of file TCETargetMachinePlugin.cc.

553  {
554  if (regNames_.find(dwarfRegNum) == regNames_.end()) {
555  return "BYPASS_PSEUDO";
556  }
557  return regNames_[dwarfRegNum];
558 }

References regNames_.

◆ rvDRegNum()

virtual unsigned llvm::GeneratedTCEPlugin::rvDRegNum ( )
inlineoverridevirtual

Implements llvm::TCETargetMachinePlugin.

Definition at line 78 of file TCETargetMachinePlugin.cc.

78  {
79  return TCE::IRES0;
80  }

◆ rvHighDRegNum()

virtual unsigned llvm::GeneratedTCEPlugin::rvHighDRegNum ( )
inlineoverridevirtual

Implements llvm::TCETargetMachinePlugin.

Definition at line 82 of file TCETargetMachinePlugin.cc.

82  {
83  return TCE::KLUDGE_REGISTER;
84  }

◆ spDRegNum()

virtual unsigned llvm::GeneratedTCEPlugin::spDRegNum ( )
inlineoverridevirtual

Returns ID number of the stack pointer register.

Implements llvm::TCETargetMachinePlugin.

Definition at line 70 of file TCETargetMachinePlugin.cc.

70  {
71  return TCE::SP;
72  }

◆ validStackAccessOperation()

bool GeneratedTCEPlugin::validStackAccessOperation ( const std::string &  opName) const
overridevirtual

Returns true if OSAL operation is valid for stack accesses.

Implements llvm::TCETargetMachinePlugin.

Definition at line 509 of file TCETargetMachinePlugin.cc.

509  {
510  return validStackAccessOperations_.count(opName);
511 }

References validStackAccessOperations_.

Member Data Documentation

◆ adfXML_

std::string llvm::GeneratedTCEPlugin::adfXML_
private

Definition at line 202 of file TCETargetMachinePlugin.cc.

Referenced by adfXML().

◆ dataASName_

std::string llvm::GeneratedTCEPlugin::dataASName_
private

Definition at line 203 of file TCETargetMachinePlugin.cc.

Referenced by dataASName().

◆ falsePredOps_

std::map<unsigned, unsigned> llvm::GeneratedTCEPlugin::falsePredOps_
private

Definition at line 194 of file TCETargetMachinePlugin.cc.

Referenced by getFalsePredicateOpcode().

◆ opNames_

std::map<unsigned, TCEString> llvm::GeneratedTCEPlugin::opNames_
private

Definition at line 192 of file TCETargetMachinePlugin.cc.

Referenced by hasOperation(), opcode(), and operationName().

◆ regIndices_

std::map<unsigned, unsigned> llvm::GeneratedTCEPlugin::regIndices_
private

Definition at line 196 of file TCETargetMachinePlugin.cc.

Referenced by registerIndex().

◆ regNames_

std::map<unsigned, TCEString> llvm::GeneratedTCEPlugin::regNames_
private

Definition at line 195 of file TCETargetMachinePlugin.cc.

Referenced by rfName().

◆ truePredOps_

std::map<unsigned, unsigned> llvm::GeneratedTCEPlugin::truePredOps_
private

Definition at line 193 of file TCETargetMachinePlugin.cc.

Referenced by getTruePredicateOpcode().

◆ ttallvmRegMap_

std::map<TCEString, unsigned> llvm::GeneratedTCEPlugin::ttallvmRegMap_
private

Map for TTA register to LLVM register id conversion.

Definition at line 198 of file TCETargetMachinePlugin.cc.

Referenced by llvmRegisterId().

◆ validStackAccessOperations_

TCETools::CIStringSet llvm::GeneratedTCEPlugin::validStackAccessOperations_
private

Set of valid LLVM opcodes for stack accesses.

Definition at line 200 of file TCETargetMachinePlugin.cc.

Referenced by validStackAccessOperation().


The documentation for this class was generated from the following file:
llvm::TCETargetMachinePlugin::subTarget_
TCESubtarget * subTarget_
Definition: TCETargetMachinePlugin.hh:261
llvm::TCEFrameLowering
Definition: TCEFrameInfo.hh:60
llvm::TCEInstrInfo
Definition: TCEInstrInfo.hh:57
llvm::TCESubtarget
Definition: TCESubtarget.hh:56
llvm::TCETTIImpl
Definition: TCETargetTransformInfo.hh:42
llvm::TCELESubtarget
Definition: TCESubtarget.hh:90
llvm::TCETargetMachinePlugin::tm_
TCETargetMachine * tm_
Definition: TCETargetMachinePlugin.hh:260
llvm::GeneratedTCEPlugin::regNames_
std::map< unsigned, TCEString > regNames_
Definition: TCETargetMachinePlugin.cc:195
llvm::GeneratedTCEPlugin::operationName
virtual std::string operationName(unsigned opc) const override
Definition: TCETargetMachinePlugin.cc:375
assert
#define assert(condition)
Definition: Application.hh:86
TCEISD::CALL
@ CALL
Definition: TCEISelLowering.hh:65
llvm::GeneratedTCEPlugin::opNames_
std::map< unsigned, TCEString > opNames_
Definition: TCETargetMachinePlugin.cc:192
llvm::GeneratedTCEPlugin::isLittleEndian
virtual bool isLittleEndian() const override
llvm::GeneratedTCEPlugin::ttallvmRegMap_
std::map< TCEString, unsigned > ttallvmRegMap_
Map for TTA register to LLVM register id conversion.
Definition: TCETargetMachinePlugin.cc:198
NOP
#define NOP
Definition: POMGenMacros.hh:465
llvm::createTCEISelDag
FunctionPass * createTCEISelDag(TCETargetMachine &tm)
Definition: TCEDAGToDAGISel.cc:284
llvm::GeneratedTCEPlugin::getRegisterInfo
virtual const TargetRegisterInfo * getRegisterInfo() const override
Definition: TCETargetMachinePlugin.cc:292
llvm::TCETargetMachinePlugin::frameInfo_
TargetFrameLowering * frameInfo_
Definition: TCETargetMachinePlugin.hh:259
llvm::GeneratedTCEPlugin::adfXML_
std::string adfXML_
Definition: TCETargetMachinePlugin.cc:202
llvm::TCETargetMachinePlugin::TCETargetMachinePlugin
TCETargetMachinePlugin()
Definition: TCETargetMachinePlugin.hh:112
llvm::GeneratedTCEPlugin::truePredOps_
std::map< unsigned, unsigned > truePredOps_
Definition: TCETargetMachinePlugin.cc:193
llvm::TCETargetMachinePlugin::lowering_
TargetLowering * lowering_
Definition: TCETargetMachinePlugin.hh:258
llvm::GeneratedTCEPlugin::dataASName_
std::string dataASName_
Definition: TCETargetMachinePlugin.cc:203
llvm::TCETargetLowering
Definition: TCEISelLowering.hh:83
RA
#define RA()
Definition: POMGenMacros.hh:393
MapTools::containsValue
static bool containsValue(const MapType &aMap, const ValueType &aValue)
llvm::GeneratedTCEPlugin::initialize
void initialize()
MOVE
#define MOVE(SRC, DST)
Definition: POMGenMacros.hh:458
llvm::TCETargetMachine::stackAlignment
unsigned stackAlignment() const
Definition: TCETargetMachine.hh:277
llvm::GeneratedTCEPlugin::validStackAccessOperations_
TCETools::CIStringSet validStackAccessOperations_
Set of valid LLVM opcodes for stack accesses.
Definition: TCETargetMachinePlugin.cc:200
llvm::GeneratedTCEPlugin::regIndices_
std::map< unsigned, unsigned > regIndices_
Definition: TCETargetMachinePlugin.cc:196
llvm::GeneratedTCEPlugin::falsePredOps_
std::map< unsigned, unsigned > falsePredOps_
Definition: TCETargetMachinePlugin.cc:194
llvm::TCERegisterInfo
Definition: TCERegisterInfo.hh:53
llvm::TCETargetMachinePlugin::instrInfo_
TCEInstrInfo * instrInfo_
Target machine instruction info for the llvm framework.
Definition: TCETargetMachinePlugin.hh:257
llvm::TCELE64Subtarget
Definition: TCESubtarget.hh:98