OpenASIP  2.0
TCETargetMachinePlugin.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2015 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file TCETargetMachinePlugin.cc
26  *
27  * Implementation of TCETargetMachinePlugin class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2007 (vjaaskel-no.spam-cs.tut.fi)
30  * @author Mikael Lepistö 2009 (mikael.lepisto-no.spam-tut.fi)
31  * @author Pekka Jääskeläinen 2012
32  * @note rating: red
33  */
34 
35 //#include <llvm/Config/config.h>
36 #include <string>
37 #include <iostream>
38 #include <sstream>
40 #include "TCEPlugin.hh"
41 #include "TCETargetMachine.hh"
42 #include "TCEFrameInfo.hh"
43 #include "TCEISelLowering.hh"
44 #include "TCESubtarget.hh"
45 #include "MapTools.hh"
46 #include "CIStringSet.hh"
47 #include "LLVMTCECmdLineOptions.hh"
48 #include "TCEStubTargetMachine.hh"
50 
51 using namespace llvm;
52 
53 using std::string;
54 
55 namespace llvm {
57 public:
59  virtual ~GeneratedTCEPlugin();
60  virtual const TargetInstrInfo* getInstrInfo() const override;
61  virtual const TargetRegisterInfo* getRegisterInfo() const override;
62  virtual const TargetFrameLowering* getFrameLowering() const override;
63  virtual TargetLowering* getTargetLowering() const override;
64  virtual TargetTransformInfo getTargetTransformInfo(
65  const Function& F) const override;
66  virtual const TargetSubtargetInfo* getSubtarget() const override;
67 
68  virtual FunctionPass* createISelPass(TCETargetMachine* tm) override;
69 
70  virtual unsigned spDRegNum() override {
71  return TCE::SP;
72  }
73 
74  virtual unsigned fpDRegNum() override {
75  return TCE::FP;
76  }
77 
78  virtual unsigned rvDRegNum() override {
79  return TCE::IRES0;
80  }
81 
82  virtual unsigned rvHighDRegNum() override {
83  return TCE::KLUDGE_REGISTER;
84  }
85 
86  virtual std::vector<unsigned> getParamDRegNums() const override;
87 
88  virtual std::vector<unsigned> getVectorRVDRegNums() const override;
89 
90  virtual const std::string* adfXML() override {
91  return &adfXML_;
92  }
93 
94  virtual MVT::SimpleValueType getDefaultType() const override {
95 #ifdef TARGET64BIT
96  return MVT::i64;
97 #else
98  return MVT::i32;
99 #endif
100  }
101  virtual std::string rfName(unsigned dwarfRegNum) override;
102  virtual unsigned registerIndex(unsigned dwarfRegNum) override;
103 
104  unsigned llvmRegisterId(const TCEString& ttaRegister) override {
105  if (ttallvmRegMap_.count(ttaRegister)) {
106  return ttallvmRegMap_[ttaRegister];
107  }
108  return TCE::NoRegister;
109  }
110 
111  unsigned int extractElementLane(const llvm::MachineInstr&) const override;
112 
113  virtual std::string operationName(unsigned opc) const override;
114  virtual bool validStackAccessOperation(
115  const std::string& opName) const override;
116 
117  virtual bool hasOperation(TCEString operationName) const override {
119  }
120 
121  virtual unsigned opcode(TCEString operationName) const override {
122  return MapTools::keyForValue<unsigned>(opNames_, operationName.upper());
123  }
124 
125  virtual int getTruePredicateOpcode(unsigned opc) const override;
126  virtual int getFalsePredicateOpcode(unsigned opc) const override;
127 
128  unsigned int raPortDRegNum() override;
129  std::string dataASName() override;
130 
131  virtual bool hasSDIV() const override;
132  virtual bool hasUDIV() const override;
133  virtual bool hasSREM() const override;
134  virtual bool hasUREM() const override;
135  virtual bool hasMUL() const override;
136  virtual bool hasROTL() const override;
137  virtual bool hasROTR() const override;
138  virtual bool hasSXHW() const override;
139  virtual bool hasSXQW() const override;
140  virtual bool hasSQRTF() const override;
141  virtual bool hasSHR() const override;
142  virtual bool hasSHL() const override;
143  virtual bool hasSHRU() const override;
144  virtual bool has8bitLoads() const override;
145  virtual bool has16bitLoads() const override;
146 
147  virtual int maxVectorSize() const override;
148 
149  virtual bool analyzeCCBranch(
150  llvm::MachineInstr& i,
151  llvm::SmallVectorImpl<llvm::MachineOperand>& cond) const override;
152 
153  virtual void registerTargetMachine(TCETargetMachine &tm) override;
154 
155  virtual int getLoad(const TargetRegisterClass *rc) const override;
156  virtual int getStore(const TargetRegisterClass *rc) const override;
157 
158  virtual int getMinOpcode(llvm::SDNode* n) const override;
159  virtual int getMaxOpcode(llvm::SDNode* n) const override;
160  virtual int getMinuOpcode(llvm::SDNode* n) const override;
161  virtual int getMaxuOpcode(llvm::SDNode* n) const override;
162 
163  virtual const llvm::TargetRegisterClass* extrasRegClass(
164  const llvm::TargetRegisterClass* current) const override;
165  virtual const llvm::TargetRegisterClass* nodeRegClass(
166  unsigned nodeId,
167  const llvm::TargetRegisterClass* current) const override;
168 
169  virtual int getLoadOpcode(const EVT& vt) const override;
170  // -1 or vector add opcode. Implementation generated to Backend.inc
171  virtual int getAddOpcode(const EVT& vt) const override;
172  // -1 or vector shl opcode. Implementation generated to Backend.inc
173  virtual int getShlOpcode(const EVT& vt) const override;
174  // -1 or vector or opcode. Implementation generated to Backend.inc
175  virtual int getIorOpcode(const EVT& vt) const override;
176 
177  // If machine is little-endian.
178  virtual bool isLittleEndian() const override;
179  virtual bool is64bit() const override;
180 
181  // Returns true if the constant value can be materialized. Implementation
182  // is generated to Backend.inc
183  virtual bool canMaterializeConstant(const ConstantInt& ci) const override;
184 
185  virtual std::tuple<int, int> getPointerAdjustment(
186  int offset) const override;
187  virtual void manualInitialize();
188 
189 private:
190  void initialize();
191 
192  std::map<unsigned, TCEString> opNames_;
193  std::map<unsigned, unsigned> truePredOps_;
194  std::map<unsigned, unsigned> falsePredOps_;
195  std::map<unsigned, TCEString> regNames_;
196  std::map<unsigned, unsigned> regIndices_;
197  /// Map for TTA register to LLVM register id conversion.
198  std::map<TCEString, unsigned> ttallvmRegMap_;
199  /// Set of valid LLVM opcodes for stack accesses.
201 
202  std::string adfXML_;
203  std::string dataASName_;
204 };
205 }
206 
207 #include "Backend.inc"
208 
209 
210 // This global class initialization hack is needed to pass the adf data to the
211 // middle-end, which provides details for llvm autovectorization.
213 public:
215 
216  GeneratedTCEPlugin* plugin = new GeneratedTCEPlugin();
217  plugin->manualInitialize();
218 
219  // Pass adf xml string to the middle-end stub targetmachine
221 
222  // Register LLVM Target and TCE Stub TargetMachine
225  }
226 } myPlugin;
227 
228 /**
229  * The Constructor.
230  */
233 }
234 
235 
236 /**
237  * The Destructor.
238  */
240  delete instrInfo_;
241  if (lowering_ != NULL) {
242  delete lowering_;
243  lowering_ = NULL;
244  }
245 }
246 
247 void
249  initialize();
250 }
251 
252 void
254  TCETargetMachine &tm) {
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 }
279 
280 /**
281  * Returns TargetInstrInfo object for TCE target.
282  */
283 const TargetInstrInfo*
285  return instrInfo_;
286 }
287 
288 /**
289  * Returns TargetRegisterInfo object for TCE target.
290  */
291 const TargetRegisterInfo*
293  return &(static_cast<TCEInstrInfo*>(instrInfo_))->getRegisterInfo();
294 }
295 
296 /**
297  * Returns TargetFrameInfo object for TCE target.
298  */
299 const TargetFrameLowering*
301  return frameInfo_;
302 }
303 
304 TargetTransformInfo
306  return TargetTransformInfo(TCETTIImpl(tm_, F));
307 }
308 
309 /**
310  * Returns TargetLowering object for TCE target.
311  */
312 TargetLowering*
314  assert(lowering_ != NULL && "TCETargetMachine has not registered to plugin.");
315  return lowering_;
316 }
317 
318 const TargetSubtargetInfo*
320  return subTarget_;
321 }
322 
323 /**
324  * Creates instruction selector for TCE target machine.
325  */
326 FunctionPass*
328  return createTCEISelDag(*tm);
329 }
330 
331 /**
332  * Returns true in case the given opc is for an extract element
333  * operation.
334  */
335 unsigned int
336 GeneratedTCEPlugin::extractElementLane(const llvm::MachineInstr& mi) const {
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 }
348 
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 }
357 
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 }
366 
367 /**
368  * Maps llvm target opcodes to target operation names.
369  *
370  * Returns an empty string in case the operation code could not be
371  * mapped to an OSAL operation name. This is the case with pseudo
372  * ops, for example.
373  */
374 std::string
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 }
507 
508 bool
509 GeneratedTCEPlugin::validStackAccessOperation(const std::string& opName) const {
510  return validStackAccessOperations_.count(opName);
511 }
512 
513 #include "TCEGenRegisterInfo.inc"
514 
515 /**
516  * Returns the specific register class representing registers belonging to
517  * a "computation node" inside a clustered-TTA.
518  *
519  * This can be used to limit the registers to be allocated from a single
520  * node, thus also suggest scheduling the operations there. For data
521  * parallel code.
522  *
523  * @param nodeId the ID of the node (starting from 0)
524  * @param current The "more general" register class to replace.
525  */
526 const llvm::TargetRegisterClass*
528  unsigned nodeId, const llvm::TargetRegisterClass* current) const {
529 
530  return NULL;
531 }
532 
533 
534 /**
535  * Returns the specific register class representing registers belonging to
536  * the "extras node" inside a clustered-TTA.
537  *
538  * @param current The "more general" register class to replace.
539  */
540 const llvm::TargetRegisterClass*
542  const llvm::TargetRegisterClass* current) const {
543  const llvm::TargetRegisterInfo& TRI = *getRegisterInfo();
544 
545  return NULL;
546 }
547 
548 
549 /**
550  * Maps llvm register numbers to target RF names.
551  */
552 std::string
553 GeneratedTCEPlugin::rfName(unsigned dwarfRegNum) {
554  if (regNames_.find(dwarfRegNum) == regNames_.end()) {
555  return "BYPASS_PSEUDO";
556  }
557  return regNames_[dwarfRegNum];
558 }
559 
560 /**
561  * Maps llvm register numbers to target RF indices.
562  */
563 unsigned
564 GeneratedTCEPlugin::registerIndex(unsigned dwarfRegNum) {
565  if (regIndices_.find(dwarfRegNum) == regIndices_.end()) {
566  return dwarfRegNum;
567  }
568  return regIndices_[dwarfRegNum];
569 }
570 
571 
572 std::string
574  return dataASName_;
575 }
576 // Returns ID number of the return address register.
577 unsigned
579  return TCE::RA;
580 }
581 
582 extern "C" {
585 
586  TCETargetMachinePlugin* instance =
587  new GeneratedTCEPlugin();
588  return instance;
589  }
591  TCETargetMachinePlugin* target) {
592  delete target;
593  }
594 }
595 
llvm::GeneratedTCEPlugin::spDRegNum
virtual unsigned spDRegNum() override
Returns ID number of the stack pointer register.
Definition: TCETargetMachinePlugin.cc:70
llvm::GeneratedTCEPlugin::hasUDIV
virtual bool hasUDIV() const override
llvm::GeneratedTCEPlugin::registerIndex
virtual unsigned registerIndex(unsigned dwarfRegNum) override
Definition: TCETargetMachinePlugin.cc:564
llvm
Definition: InlineAsmParser.hh:49
llvm::TCETargetMachinePlugin::subTarget_
TCESubtarget * subTarget_
Definition: TCETargetMachinePlugin.hh:261
llvm::GeneratedTCEPlugin::validStackAccessOperation
virtual bool validStackAccessOperation(const std::string &opName) const override
Returns true if OSAL operation is valid for stack accesses.
Definition: TCETargetMachinePlugin.cc:509
llvm::GeneratedTCEPlugin::hasSXQW
virtual bool hasSXQW() const override
llvm::GeneratedTCEPlugin::has16bitLoads
virtual bool has16bitLoads() const override
llvm::GeneratedTCEPlugin::~GeneratedTCEPlugin
virtual ~GeneratedTCEPlugin()
Definition: TCETargetMachinePlugin.cc:239
TCETargetMachinePlugin.hh
llvm::GeneratedTCEPlugin::hasSREM
virtual bool hasSREM() const override
llvm::TCEFrameLowering
Definition: TCEFrameInfo.hh:60
llvm::GeneratedTCEPlugin::getAddOpcode
virtual int getAddOpcode(const EVT &vt) const override
llvm::GeneratedTCEPlugin::hasSHR
virtual bool hasSHR() const override
llvm::TCEInstrInfo
Definition: TCEInstrInfo.hh:57
llvm::GeneratedTCEPlugin::getStore
virtual int getStore(const TargetRegisterClass *rc) const override
llvm::TCESubtarget
Definition: TCESubtarget.hh:56
llvm::TCEStubTargetMachine::setADFString
static void setADFString(std::string adfXML)
Definition: TCEStubTargetMachine.cc:160
llvm::GeneratedTCEPlugin::getTargetLowering
virtual TargetLowering * getTargetLowering() const override
Definition: TCETargetMachinePlugin.cc:313
MapTools.hh
llvm::GeneratedTCEPlugin::registerTargetMachine
virtual void registerTargetMachine(TCETargetMachine &tm) override
Plugin needs target machine for TragetLowering generation.
Definition: TCETargetMachinePlugin.cc:253
llvm::GeneratedTCEPlugin::hasUREM
virtual bool hasUREM() const override
llvm::GeneratedTCEPlugin::getInstrInfo
virtual const TargetInstrInfo * getInstrInfo() const override
Definition: TCETargetMachinePlugin.cc:284
llvm::GeneratedTCEPlugin::hasSQRTF
virtual bool hasSQRTF() const override
llvm::TCETTIImpl
Definition: TCETargetTransformInfo.hh:42
llvm::GeneratedTCEPlugin::hasSHL
virtual bool hasSHL() const override
llvm::TCELESubtarget
Definition: TCESubtarget.hh:90
llvm::GeneratedTCEPlugin::getTruePredicateOpcode
virtual int getTruePredicateOpcode(unsigned opc) const override
Definition: TCETargetMachinePlugin.cc:349
llvm::TCETargetMachinePlugin::tm_
TCETargetMachine * tm_
Definition: TCETargetMachinePlugin.hh:260
TCEPluginInitializer::TCEPluginInitializer
TCEPluginInitializer()
Definition: TCETargetMachinePlugin.cc:214
LLVMInitializeTCEStubTarget
void LLVMInitializeTCEStubTarget()
Definition: TCEStubTargetMachine.cc:80
llvm::GeneratedTCEPlugin::hasOperation
virtual bool hasOperation(TCEString operationName) const override
Returns true in case the target supports the given osal operation.
Definition: TCETargetMachinePlugin.cc:117
llvm::GeneratedTCEPlugin::getMaxOpcode
virtual int getMaxOpcode(llvm::SDNode *n) const override
TCEPluginInitializer
Definition: TCETargetMachinePlugin.cc:212
delete_tce_backend_plugin
void delete_tce_backend_plugin(TCETargetMachinePlugin *target)
Definition: TCETargetMachinePlugin.cc:590
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::getMaxuOpcode
virtual int getMaxuOpcode(llvm::SDNode *n) const override
llvm::GeneratedTCEPlugin::opcode
virtual unsigned opcode(TCEString operationName) const override
Returns the opcode for the given osal operation, undefined if not found.
Definition: TCETargetMachinePlugin.cc:121
myPlugin
class TCEPluginInitializer myPlugin
TCETargetTransformInfo.hh
llvm::GeneratedTCEPlugin::hasROTL
virtual bool hasROTL() const override
llvm::GeneratedTCEPlugin::isLittleEndian
virtual bool isLittleEndian() const override
llvm::GeneratedTCEPlugin::hasSDIV
virtual bool hasSDIV() const override
CIStringSet.hh
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
LLVMTCECmdLineOptions.hh
llvm::GeneratedTCEPlugin::manualInitialize
virtual void manualInitialize()
Definition: TCETargetMachinePlugin.cc:248
TCETargetMachine.hh
llvm::createTCEISelDag
FunctionPass * createTCEISelDag(TCETargetMachine &tm)
Definition: TCEDAGToDAGISel.cc:284
llvm::GeneratedTCEPlugin::adfXML
virtual const std::string * adfXML() override
Returns pointer to xml string of the target machine .adf.
Definition: TCETargetMachinePlugin.cc:90
llvm::GeneratedTCEPlugin::getRegisterInfo
virtual const TargetRegisterInfo * getRegisterInfo() const override
Definition: TCETargetMachinePlugin.cc:292
llvm::TCETargetMachinePlugin::frameInfo_
TargetFrameLowering * frameInfo_
Definition: TCETargetMachinePlugin.hh:259
llvm::GeneratedTCEPlugin::rvHighDRegNum
virtual unsigned rvHighDRegNum() override
Definition: TCETargetMachinePlugin.cc:82
llvm::GeneratedTCEPlugin::adfXML_
std::string adfXML_
Definition: TCETargetMachinePlugin.cc:202
llvm::GeneratedTCEPlugin::getIorOpcode
virtual int getIorOpcode(const EVT &vt) const override
llvm::GeneratedTCEPlugin::dataASName
std::string dataASName() override
Returns name of the data address space.
Definition: TCETargetMachinePlugin.cc:573
llvm::GeneratedTCEPlugin::getTargetTransformInfo
virtual TargetTransformInfo getTargetTransformInfo(const Function &F) const override
Definition: TCETargetMachinePlugin.cc:305
llvm::GeneratedTCEPlugin::fpDRegNum
virtual unsigned fpDRegNum() override
Returns ID number of the frame pointer register.
Definition: TCETargetMachinePlugin.cc:74
TCETools::CIStringSet
std::set< TCEString, CaseInsensitiveCmp > CIStringSet
Definition: CIStringSet.hh:49
TCEFrameInfo.hh
llvm::GeneratedTCEPlugin::GeneratedTCEPlugin
GeneratedTCEPlugin()
Definition: TCETargetMachinePlugin.cc:231
llvm::GeneratedTCEPlugin::createISelPass
virtual FunctionPass * createISelPass(TCETargetMachine *tm) override
Definition: TCETargetMachinePlugin.cc:327
llvm::GeneratedTCEPlugin::getFalsePredicateOpcode
virtual int getFalsePredicateOpcode(unsigned opc) const override
Definition: TCETargetMachinePlugin.cc:358
llvm::GeneratedTCEPlugin::truePredOps_
std::map< unsigned, unsigned > truePredOps_
Definition: TCETargetMachinePlugin.cc:193
llvm::GeneratedTCEPlugin::getDefaultType
virtual MVT::SimpleValueType getDefaultType() const override
Definition: TCETargetMachinePlugin.cc:94
llvm::GeneratedTCEPlugin::llvmRegisterId
unsigned llvmRegisterId(const TCEString &ttaRegister) override
Definition: TCETargetMachinePlugin.cc:104
llvm::GeneratedTCEPlugin::getLoadOpcode
virtual int getLoadOpcode(const EVT &vt) const override
llvm::TCETargetMachinePlugin::lowering_
TargetLowering * lowering_
Definition: TCETargetMachinePlugin.hh:258
llvm::GeneratedTCEPlugin::dataASName_
std::string dataASName_
Definition: TCETargetMachinePlugin.cc:203
llvm::GeneratedTCEPlugin::rvDRegNum
virtual unsigned rvDRegNum() override
Definition: TCETargetMachinePlugin.cc:78
llvm::GeneratedTCEPlugin::getSubtarget
virtual const TargetSubtargetInfo * getSubtarget() const override
Definition: TCETargetMachinePlugin.cc:319
llvm::TCETargetMachinePlugin
Definition: TCETargetMachinePlugin.hh:109
llvm::TCETargetLowering
Definition: TCEISelLowering.hh:83
llvm::GeneratedTCEPlugin::getParamDRegNums
virtual std::vector< unsigned > getParamDRegNums() const override
TCEISelLowering.hh
llvm::GeneratedTCEPlugin::getMinOpcode
virtual int getMinOpcode(llvm::SDNode *n) const override
create_tce_backend_plugin
TCETargetMachinePlugin * create_tce_backend_plugin()
Definition: TCETargetMachinePlugin.cc:584
llvm::GeneratedTCEPlugin::maxVectorSize
virtual int maxVectorSize() const override
llvm::GeneratedTCEPlugin::getPointerAdjustment
virtual std::tuple< int, int > getPointerAdjustment(int offset) const override
RA
#define RA()
Definition: POMGenMacros.hh:393
llvm::GeneratedTCEPlugin::getLoad
virtual int getLoad(const TargetRegisterClass *rc) const override
MapTools::containsValue
static bool containsValue(const MapType &aMap, const ValueType &aValue)
llvm::GeneratedTCEPlugin::analyzeCCBranch
virtual bool analyzeCCBranch(llvm::MachineInstr &i, llvm::SmallVectorImpl< llvm::MachineOperand > &cond) const override
llvm::GeneratedTCEPlugin::raPortDRegNum
unsigned int raPortDRegNum() override
Returns ID number of the return address register.
Definition: TCETargetMachinePlugin.cc:578
llvm::GeneratedTCEPlugin::hasSXHW
virtual bool hasSXHW() const override
TCEStubTargetMachine.hh
TCEPlugin.hh
TCEString
Definition: TCEString.hh:53
LLVMInitializeTCETargetInfo
void LLVMInitializeTCETargetInfo()
Definition: TCEStubTargetMachine.cc:67
llvm::GeneratedTCEPlugin::initialize
void initialize()
llvm::GeneratedTCEPlugin::getVectorRVDRegNums
virtual std::vector< unsigned > getVectorRVDRegNums() const override
MOVE
#define MOVE(SRC, DST)
Definition: POMGenMacros.hh:458
llvm::GeneratedTCEPlugin::nodeRegClass
virtual const llvm::TargetRegisterClass * nodeRegClass(unsigned nodeId, const llvm::TargetRegisterClass *current) const override
Definition: TCETargetMachinePlugin.cc:527
llvm::TCETargetMachine
Definition: TCETargetMachine.hh:106
llvm::GeneratedTCEPlugin::rfName
virtual std::string rfName(unsigned dwarfRegNum) override
Definition: TCETargetMachinePlugin.cc:553
llvm::GeneratedTCEPlugin::canMaterializeConstant
virtual bool canMaterializeConstant(const ConstantInt &ci) const override
llvm::GeneratedTCEPlugin::hasMUL
virtual bool hasMUL() const override
llvm::TCETargetMachine::stackAlignment
unsigned stackAlignment() const
Definition: TCETargetMachine.hh:277
llvm::GeneratedTCEPlugin::getShlOpcode
virtual int getShlOpcode(const EVT &vt) const override
llvm::GeneratedTCEPlugin
Definition: TCETargetMachinePlugin.cc:56
llvm::GeneratedTCEPlugin::getMinuOpcode
virtual int getMinuOpcode(llvm::SDNode *n) const override
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::GeneratedTCEPlugin::hasROTR
virtual bool hasROTR() const override
llvm::GeneratedTCEPlugin::getFrameLowering
virtual const TargetFrameLowering * getFrameLowering() const override
Definition: TCETargetMachinePlugin.cc:300
llvm::GeneratedTCEPlugin::has8bitLoads
virtual bool has8bitLoads() const override
llvm::GeneratedTCEPlugin::extractElementLane
unsigned int extractElementLane(const llvm::MachineInstr &) const override
Definition: TCETargetMachinePlugin.cc:336
llvm::GeneratedTCEPlugin::is64bit
virtual bool is64bit() const override
TCESubtarget.hh
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
llvm::GeneratedTCEPlugin::hasSHRU
virtual bool hasSHRU() const override
llvm::GeneratedTCEPlugin::extrasRegClass
virtual const llvm::TargetRegisterClass * extrasRegClass(const llvm::TargetRegisterClass *current) const override
Definition: TCETargetMachinePlugin.cc:541