OpenASIP  2.0
TCETargetMachine.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2020 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 TCETargeMachine.cpp
26  *
27  * Declaration of TCETargetMachine 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 2007-2015
32  */
33 
34 #include "CompilerWarnings.hh"
35 
36 IGNORE_COMPILER_WARNING("-Wunused-parameter")
37 
38 #include "tce_config.h"
39 
40 #include "llvm/IR/PassManager.h"
41 #include "llvm/CodeGen/TargetRegisterInfo.h"
42 #include "llvm/CodeGen/SelectionDAGNodes.h"
43 #include "llvm/MC/MCContext.h"
44 #include "llvm/MC/MCStreamer.h"
45 #include "llvm/MC/MCInstPrinter.h"
46 #include "llvm/CodeGen/MachineModuleInfo.h"
47 #include "llvm/ADT/APFloat.h"
48 
49 #include "TCEStubTargetMachine.hh"
50 #include "TCETargetMachine.hh"
51 #include "TCEMCAsmInfo.hh"
52 #include "LLVMPOMBuilder.hh"
53 #include "PluginTools.hh"
54 #include "MathTools.hh"
55 #include "FileSystem.hh"
56 #include "ADFSerializer.hh"
57 #include "Conversion.hh"
58 #include "MachineInfo.hh"
60 #include "Machine.hh"
61 #include "ImmediateAnalyzer.hh"
62 #include "ImmInfo.hh"
63 #include <llvm/Transforms/Scalar.h>
64 
65 
66 #include <iostream>
67 
68 #include "LLVMTCECmdLineOptions.hh"
69 
71 
72 using namespace llvm;
73 
74 
76 Pass* createLinkBitcodePass(Module& inputCode);
77 Pass* createProgramPartitionerPass(std::string partitioningStrategy);
79 
80 class DummyInstPrinter : public MCInstPrinter {
81 public:
83  const llvm::MCAsmInfo& mai, const llvm::MCInstrInfo& mii,
84  const llvm::MCRegisterInfo& mri) : llvm::MCInstPrinter(mai, mii, mri) {}
85 
86  bool
87  applyTargetSpecificCLOption(StringRef Opt) override {
88  return false;
89  }
90  std::pair<const char*, uint64_t>
91  getMnemonic(const MCInst* MI) override {
92  return std::make_pair(nullptr, 0);
93  }
94 
95  void printInst(
96  const MCInst*, uint64_t, StringRef,
97  const MCSubtargetInfo&, raw_ostream&) override {}
98 
99  void
100  printRegName(raw_ostream& OS, unsigned RegNo) const override {}
101 };
102 
103 // In TCE target we don't print the MCInsts from LLVM, but
104 // just want to run the codegen passes so we can get the
105 // MachineInstrs in to our own finalization phases. LLVM 3.7
106 // started to require MCInstPrinter to be created, a dummy
107 // must be created therefore.
108 MCInstPrinter *dummyInstrPrinterCtor(
109  const Triple &,
110  unsigned,
111  const MCAsmInfo &MAI,
112  const MCInstrInfo &MII,
113  const MCRegisterInfo &MRI) {
114  return new DummyInstPrinter(MAI, MII, MRI);
115 }
116 
117 extern "C" void LLVMInitializeTCETarget() {
118  RegisterTargetMachine<TCETargetMachine> Y(TheTCETarget);
119  RegisterTargetMachine<TCETargetMachine> X0(TheTCELE64Target);
120  RegisterTargetMachine<TCETargetMachine> X(TheTCELETarget);
121 
122  RegisterMCAsmInfo<TCEMCAsmInfo> Z(TheTCETarget);
123  RegisterMCAsmInfo<TCEMCAsmInfo> V0(TheTCELE64Target);
124  RegisterMCAsmInfo<TCEMCAsmInfo> V(TheTCELETarget);
125  TargetRegistry::RegisterMCInstPrinter(TheTCETarget, dummyInstrPrinterCtor);
126  TargetRegistry::RegisterMCInstPrinter(
128  TargetRegistry::RegisterMCInstPrinter(
130 }
131 
132 //
133 // Data layout:
134 //--------------
135 // E-p:32:32:32-a0:0:64-i1:8:8-i8:8:8-i32:32:32-i64:32:64-f32:32:32-f64:32:64" (old)
136 // E-p:32:32:32-a0:0:32-i1:8:8-i8:8:8-i32:32:32-i64:32:32-f32:32:32-f64:32:32" (new)
137 // E = Big endian data
138 // -p:32:32:32 = Pointer size 32 bits, api & preferred alignment 32 bits.
139 // -i8:8:8 = 8bit integer api & preferred alignment 8 bits.
140 // a0:0:32 = struct alignment (abi packed?), preferred 32 bits.
141 // etc.
142 //
143 
145  const Target &T, const Triple& TTriple,
146  const llvm::StringRef& CPU, const llvm::StringRef& FS,
147  const TargetOptions &Options,
148  Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM, CodeGenOpt::Level OL, bool) :
149  TCEBaseTargetMachine(T, TTriple, CPU, FS, Options,
150  RM?*RM:Reloc::Model::Static, CM?*CM:CodeModel::Small, OL),
151  // Note: Reloc::Model does not have "Default" named member. "Static" is ok?
152  // Note: CodeModel does not have "Default" named member. "Small" is ok?
153  plugin_(NULL), pluginTool_(NULL) {
154 }
155 
156 /**
157  * The Destructor.
158  */
160  if (pluginTool_ != NULL) {
161  delete pluginTool_;
162  pluginTool_ = NULL;
163  }
164 }
165 
166 void
168  TCETargetMachinePlugin& plugin, TTAMachine::Machine& target) {
169 
170  setTTAMach(&target);
171  plugin_ = &plugin;
172  missingOps_.clear();
173  promotedOps_.clear();
174  MVT::SimpleValueType defType = plugin_->getDefaultType();
175  if (!plugin_->hasSDIV()) missingOps_.insert(std::make_pair(llvm::ISD::SDIV, defType));
176  if (!plugin_->hasUDIV()) missingOps_.insert(std::make_pair(llvm::ISD::UDIV, defType));
177  if (!plugin_->hasSREM()) missingOps_.insert(std::make_pair(llvm::ISD::SREM, defType));
178  if (!plugin_->hasUREM()) missingOps_.insert(std::make_pair(llvm::ISD::UREM, defType));
179  if (!plugin_->hasMUL()) missingOps_.insert(std::make_pair(llvm::ISD::MUL, defType));
180  if (!plugin_->hasROTL()) missingOps_.insert(std::make_pair(llvm::ISD::ROTL, defType));
181  if (!plugin_->hasROTR()) missingOps_.insert(std::make_pair(llvm::ISD::ROTR, defType));
182 
183  if (!plugin_->hasSHL()) customLegalizedOps_.insert(std::make_pair(llvm::ISD::SHL, MVT::i32));
184  if (!plugin_->hasSHR()) customLegalizedOps_.insert(std::make_pair(llvm::ISD::SRA, MVT::i32));
185  if (!plugin_->hasSHRU()) customLegalizedOps_.insert(std::make_pair(llvm::ISD::SRL, MVT::i32));
186 
187  if (!plugin_->hasSXHW()) missingOps_.insert(
188  std::make_pair(llvm::ISD::SIGN_EXTEND_INREG, MVT::i16));
189 
190  if (!plugin_->hasSXQW()) missingOps_.insert(
191  std::make_pair(llvm::ISD::SIGN_EXTEND_INREG, MVT::i8));
192 
193  if (!plugin_->hasSQRTF()) {
194  missingOps_.insert(std::make_pair(llvm::ISD::FSQRT, MVT::f32));
195  }
196 
197  // register machine to plugin
199 
200  initAsmInfo();
201 
202  // Set data layout with correct stack alignment.
203  unsigned alignBits = MachineInfo::maxMemoryAlignment(target) * 8;
204  TCEString dataLayoutStr("");
205  if (plugin_->isLittleEndian()) {
206  dataLayoutStr += target.is64bit() ? "e-p:64:64:64" : "e-p:32:32:32";
207  } else {
208  dataLayoutStr += "E-p:32:32:32";
209  }
210  dataLayoutStr += "-a0:0:" + Conversion::toString(alignBits);
211  if (target.is64bit()) {
212  dataLayoutStr += "-i1:8:64";
213  dataLayoutStr += "-i8:8:64";
214  dataLayoutStr += "-i16:16:64";
215  dataLayoutStr += "-i32:32:64";
216  dataLayoutStr += "-i64:64:64";
217  dataLayoutStr += "-f16:16:64";
218  dataLayoutStr += "-f32:32:64";
219  } else {
220  dataLayoutStr += "-i1:8:8";
221  dataLayoutStr += "-i8:8:32";
222  dataLayoutStr += "-i16:16:32";
223  dataLayoutStr += "-i32:32:32";
224  dataLayoutStr += "-i64:64:64";
225  dataLayoutStr += "-f16:16:16";
226  dataLayoutStr += "-f32:32:32";
227  }
228  dataLayoutStr += "-f64:64:64";
229  dataLayoutStr += "-v64:64:64";
230  dataLayoutStr += "-v128:128:128";
231  dataLayoutStr += "-v256:256:256";
232  dataLayoutStr += "-v512:512:512";
233  dataLayoutStr += "-v1024:1024:1024";
234 #if LLVM_HAS_CUSTOM_VECTOR_EXTENSION == 2
235  dataLayoutStr += "-v2048:2048:2048";
236  dataLayoutStr += "-v4096:4096:4096";
237 #endif
238 
239  DataLayout* dl = plugin_->getDataLayout();
240  dl->reset(dataLayoutStr.c_str());
241 }
242 
243 /**
244  * Creates an instruction selector instance.
245  *
246  */
247 bool
249 {
250  addPass(plugin_->createISelPass(static_cast<TCETargetMachine*>(TM)));
251  return false;
252 }
253 
254 /**
255  * Some extra passes needed by TCE
256  *
257  * @param pm Function pass manager to add isel pass.
258  * @param fast Not used.
259  */
260 void
262 }
263 
264 
265 bool
269  if (options != NULL && !options->disableHWLoops() &&
270  ((static_cast<TCETargetMachine*>(TM))->ttaMach_)
271  ->hasOperation("hwloop"))
272  addPass(createHardwareLoopsPass());
273 
274  // lower floating point stuff.. maybe could use plugin as param instead machine...
276  *((static_cast<TCETargetMachine*>(TM))->ttaMach_)));
277 
278  if ((static_cast<TCETargetMachine*>(TM))->emulationModule_ != NULL) {
280  *((static_cast<TCETargetMachine*>(TM))->emulationModule_)));
281  }
282 
283  CodeGenOpt::Level OptLevel = getOptLevel();
284 
285  // if llvm-tce opt level is -O2 or -O3
286  if (OptLevel != CodeGenOpt::None) {
287  // get some pass lists from llvm/Support/StandardPasses.h from
288  // createStandardLTOPasses function. (do not add memcpyopt or dce!)
289  addPass(createInternalizePass());
290  }
291 
292  // NOTE: This must be added before Machine function analysis pass..
293  // needed by POMBuilder to prevent writing debug data to data section
294  // might be good to disable when printing out machine function code...
295  // However, it need to comment out to support debug info
296 // PM.add(createStripSymbolsPass(/*bool OnlyDebugInfo=*/true));
297 
298  return false;
299 }
300 
301 /**
302  * Creates a TTAMachine::Machine object of the target architecture.
303  */
306  ADFSerializer serializer;
307  serializer.setSourceString(*plugin_->adfXML());
308  return serializer.readMachine();
309 }
310 
311 /**
312  * Returns list of llvm::ISD SelectionDAG opcodes for operations that are not
313  * supported in the target architecture.
314  *
315  * The returned operations have to be expanded to emulation function calls
316  * or emulation patterns in TCETargetLowering.
317  */
318 const std::set<std::pair<unsigned, llvm::MVT::SimpleValueType> >*
320  return &missingOps_;
321 }
322 
323 /**
324  * Returns list of llvm::ISD SelectionDAG opcodes for operations that are not
325  * supported in the target architecture but will be promoted.
326  *
327  * The returned operations have to be promoted to emulation function calls
328  * or emulation patterns in TCETargetLowering.
329  */
330 const std::set<std::pair<unsigned, llvm::MVT::SimpleValueType> >*
332  return &promotedOps_;
333 }
334 
335 /**
336  * Returns list of llvm::ISD SelectionDAG opcodes for operations that are not
337  * supported in the target architecture but will be custom-selected.
338  */
339 const std::set<std::pair<unsigned, llvm::MVT::SimpleValueType> >*
341  return &customLegalizedOps_;
342 }
343 
344 TargetPassConfig*
346  PassManagerBase &PM) {
347  TCEPassConfig *tpc;
348  tpc = new TCEPassConfig(this, PM, plugin_);
349  // TODO: is this false by default if not set?
350  // false seems to give slightly better performance than true.
351  tpc->setEnableTailMerge(false);
352  return tpc;
353 }
354 
355 /**
356  * Returns true if the value can be encoded as immediate to register.
357  */
358 bool
359 TCETargetMachine::canEncodeAsMOVI(const llvm::MVT& vt, int64_t val) const {
360  // setTargetMachinePlugin() calls calculateSupportedImmediateLimits.
361  assert(ttaMach_ && "setTargetMachinePlugin() was not called");
362  switch (vt.SimpleTy) {
363  case MVT::i1:
364  return (1 <= largestImm_);
365  case MVT::i8:
366  case MVT::i16:
367  case MVT::i32:
368  case MVT::i64:
369  return smallestImm_ == INT64_MIN || largestImm_ == UINT64_MAX ||
370  ((int64_t)smallestImm_ <= val &&
371  (val < 0 || val <= (int64_t)largestImm_));
372  default: assert(false && "Not implemented or supported.");
373  }
374  return false;
375 }
376 
377 /**
378  * Returns true if the floating point value can be encoded as immediate to
379  * register.
380  */
381 bool
382 TCETargetMachine::canEncodeAsMOVF(const llvm::APFloat& fp) const {
383  int fpBitWidth = static_cast<int>(
384  llvm::APFloat::getSizeInBits(fp.getSemantics()));
385  return fpBitWidth <= SupportedFPImmWidth_;
386 }
387 
388 void
390  using MCC = MachineConnectivityCheck;
391 
392  // FIX ME: All 32 bit regs are assumed to be RF-connected.
393  std::pair<int64_t, uint64_t> moveImm{
394  std::numeric_limits<int64_t>::max(),
395  std::numeric_limits<uint64_t>::min() };
396  assert(ttaMach_);
397  for (auto& rf : ttaMach_->registerFileNavigator()) {
398  if (rf->width() != 32) continue;
399 
400  for (auto& bus : ttaMach_->busNavigator()) {
401  if (!MCC::busConnectedToRF(*bus, *rf)
402  || bus->immediateWidth() == 0) {
403  continue;
404  }
405 
406  if (bus->immediateWidth() >= 32) {
407  moveImm.first = -(1ll << (32-1));
408  moveImm.second = (1ll << 32)-1;
409  break;
410  } else {
411  std::pair<int64_t, uint64_t> imm =
412  MathTools::bitsToIntegerRange<int64_t, uint64_t>(
413  bus->immediateWidth(),
414  bus->signExtends());
415 
416  moveImm.first = std::min(moveImm.first, imm.first);
417  moveImm.second = std::max(moveImm.second, imm.second);
418  }
419  }
420  }
421 
422  for (auto& iu : ttaMach_->immediateUnitNavigator()) {
423  for (auto& it : ttaMach_->instructionTemplateNavigator()) {
424  int supportedWidth = it->supportedWidth(*iu);
425  if (supportedWidth >= 32) {
426  moveImm.first = -(1ll << (32-1));
427  moveImm.second = (1ll << 32)-1;
428  break;
429  } else {
430  std::pair<int64_t, uint64_t> imm =
431  MathTools::bitsToIntegerRange<int64_t, uint64_t>(
432  supportedWidth, iu->signExtends());
433 
434  moveImm.first = std::min(moveImm.first, imm.first);
435  moveImm.second = std::max(moveImm.second, imm.second);
436  }
437  }
438  }
439  smallestImm_ = moveImm.first;
440  largestImm_ = moveImm.second;
441 
442  for (auto* rf : ttaMach_->registerFileNavigator()) {
443  if (!MCC::rfConnected(*rf)) continue;
444 
445  SupportedFPImmWidth_ = std::max(
448  }
449 }
450 
451 void
453  addPass(&IfConverterID);
454 }
455 
456 int TCETargetMachine::getLoadOpcode(int asid, int align, const llvm::EVT& vt) const {
457  int laneCount = vt.getVectorElementCount().getKnownMinValue();
458 
459  int laneSize = vt.getScalarSizeInBits();
460  int vecSize = laneCount * laneSize;
461  TCEString relaxedName = "LD"; relaxedName << laneSize << "X" << laneCount;
462  TCEString strictName = "LD"; strictName << vecSize;
463  bool allowStrict = vecSize <= align;
464 
465  auto fuNav = ttaMach_->functionUnitNavigator();
466  bool found = false;
467  for (int i = 0; i < fuNav.count(); i++) {
468  auto fu = fuNav.item(i);
469  if (fu->hasOperation(relaxedName) && fu->hasAddressSpace()) {
470  auto as = fu->addressSpace();
471  if (as->hasNumericalId(asid)) {
472  found = true;
473  break;
474  }
475  }
476  if (allowStrict) {
477  if (fu->hasOperation(strictName) && fu->hasAddressSpace()) {
478  auto as = fu->addressSpace();
479  if (as->hasNumericalId(asid)) {
480  found = true;
481  break;
482  }
483  }
484  }
485  }
486  return found ? plugin_->getLoadOpcode(vt) : -1;
487 }
createLowerMissingInstructionsPass
Pass * createLowerMissingInstructionsPass(const TTAMachine::Machine &mach)
Definition: LowerMissingInstructions.cc:147
llvm::TCEPassConfig
Definition: TCETargetMachine.hh:81
ImmediateAnalyzer.hh
llvm::TCETargetMachine::canEncodeAsMOVF
bool canEncodeAsMOVF(const llvm::APFloat &fp) const
Definition: TCETargetMachine.cc:382
llvm
Definition: InlineAsmParser.hh:49
Options
Definition: Options.hh:51
llvm::TCETargetMachine::customLegalizedOperations
const std::set< std::pair< unsigned, llvm::MVT::SimpleValueType > > * customLegalizedOperations()
Definition: TCETargetMachine.cc:340
MachineInfo::maxMemoryAlignment
static int maxMemoryAlignment(const TTAMachine::Machine &mach)
Definition: MachineInfo.cc:261
FileSystem.hh
MachineConnectivityCheck
Definition: MachineConnectivityCheck.hh:69
llvm::TCEPassConfig::addInstSelector
virtual bool addInstSelector()
Definition: TCETargetMachine.cc:248
llvm::TCETargetMachinePlugin::hasSXHW
virtual bool hasSXHW() const =0
llvm::TCEPassConfig::plugin_
TCETargetMachinePlugin * plugin_
Definition: TCETargetMachine.hh:98
llvm::TheTCETarget
Target TheTCETarget
Definition: TCEStubTargetMachine.cc:63
MachineConnectivityCheck.hh
llvm::TCETargetMachinePlugin::getLoadOpcode
virtual int getLoadOpcode(const llvm::EVT &vt) const =0
DummyInstPrinter::getMnemonic
std::pair< const char *, uint64_t > getMnemonic(const MCInst *MI) override
Definition: TCETargetMachine.cc:91
llvm::TCETargetMachinePlugin::hasSQRTF
virtual bool hasSQRTF() const =0
llvm::TheTCELETarget
Target TheTCELETarget
Definition: TCEStubTargetMachine.cc:64
llvm::TCETargetMachinePlugin::hasUREM
virtual bool hasUREM() const =0
DummyInstPrinter::DummyInstPrinter
DummyInstPrinter(const llvm::MCAsmInfo &mai, const llvm::MCInstrInfo &mii, const llvm::MCRegisterInfo &mri)
Definition: TCETargetMachine.cc:82
llvm::TCETargetMachinePlugin::hasROTR
virtual bool hasROTR() const =0
TTAMachine::Machine::is64bit
bool is64bit() const
Definition: Machine.hh:260
MachineInfo.hh
createInstructionPatternAnalyzer
Pass * createInstructionPatternAnalyzer()
Definition: InstructionPatternAnalyzer.cc:55
llvm::TCETargetMachinePlugin::registerTargetMachine
virtual void registerTargetMachine(TCETargetMachine &tm)=0
Plugin needs target machine for TragetLowering generation.
llvm::TCETargetMachine::setTargetMachinePlugin
virtual void setTargetMachinePlugin(TCETargetMachinePlugin &plugin, TTAMachine::Machine &target)
Definition: TCETargetMachine.cc:167
Conversion::toString
static std::string toString(const T &source)
llvm::TCETargetMachinePlugin::hasUDIV
virtual bool hasUDIV() const =0
llvm::TCETargetMachinePlugin::adfXML
virtual const std::string * adfXML()=0
Returns pointer to xml string of the target machine .adf.
llvm::TCETargetMachinePlugin::isLittleEndian
virtual bool isLittleEndian() const =0
llvm::TCETargetMachinePlugin::hasROTL
virtual bool hasROTL() const =0
ImmInfo.hh
llvm::TCETargetMachine::setTTAMach
virtual void setTTAMach(const TTAMachine::Machine *mach) override
Definition: TCETargetMachine.hh:131
assert
#define assert(condition)
Definition: Application.hh:86
llvm::TCETargetMachine::customLegalizedOps_
std::set< std::pair< unsigned, llvm::MVT::SimpleValueType > > customLegalizedOps_
Definition: TCETargetMachine.hh:335
llvm::TCETargetMachinePlugin::hasSREM
virtual bool hasSREM() const =0
llvm::TCETargetMachinePlugin::hasSHL
virtual bool hasSHL() const =0
addPass
#define addPass(P)
llvm::TCETargetMachine::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: TCETargetMachine.cc:144
TCEMCAsmInfo.hh
DummyInstPrinter
Definition: TCETargetMachine.cc:80
DummyInstPrinter::printInst
void printInst(const MCInst *, uint64_t, StringRef, const MCSubtargetInfo &, raw_ostream &) override
Definition: TCETargetMachine.cc:95
TTAMachine::Machine::immediateUnitNavigator
virtual ImmediateUnitNavigator immediateUnitNavigator() const
Definition: Machine.cc:416
Conversion.hh
LLVMInitializeTCETarget
void LLVMInitializeTCETarget()
Definition: TCETargetMachine.cc:117
LLVMTCECmdLineOptions.hh
TCETargetMachine.hh
ADFSerializer
Definition: ADFSerializer.hh:49
Application::cmdLineOptions
static CmdLineOptions * cmdLineOptions()
Definition: Application.cc:397
TTAMachine::Machine::functionUnitNavigator
virtual FunctionUnitNavigator functionUnitNavigator() const
Definition: Machine.cc:380
llvm::TCETargetMachine::missingOperations
const std::set< std::pair< unsigned, llvm::MVT::SimpleValueType > > * missingOperations()
Definition: TCETargetMachine.cc:319
llvm::TCETargetMachinePlugin::hasSXQW
virtual bool hasSXQW() const =0
llvm::TCETargetMachinePlugin::hasSHRU
virtual bool hasSHRU() const =0
llvm::TCETargetMachine::getLoadOpcode
int getLoadOpcode(int asid, int align, const llvm::EVT &vt) const
Definition: TCETargetMachine.cc:456
llvm::TCETargetMachinePlugin::hasSDIV
virtual bool hasSDIV() const =0
createProgramPartitionerPass
Pass * createProgramPartitionerPass(std::string partitioningStrategy)
llvm::TCETargetMachine::pluginTool_
PluginTools * pluginTool_
Definition: TCETargetMachine.hh:331
llvm::TCETargetMachine::plugin_
TCETargetMachinePlugin * plugin_
Definition: TCETargetMachine.hh:330
LLVMPOMBuilder.hh
llvm::TCETargetMachine::missingOps_
std::set< std::pair< unsigned, llvm::MVT::SimpleValueType > > missingOps_
llvm::ISD opcode list of operations that have to be expanded.
Definition: TCETargetMachine.hh:333
llvm::TCETargetMachine::createPassConfig
virtual TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Definition: TCETargetMachine.cc:345
llvm::TCETargetMachine::~TCETargetMachine
virtual ~TCETargetMachine()
Definition: TCETargetMachine.cc:159
Machine.hh
createLinkBitcodePass
Pass * createLinkBitcodePass(Module &inputCode)
Definition: LinkBitcode.cc:98
PluginTools.hh
LLVMTCECmdLineOptions
Definition: LLVMTCECmdLineOptions.hh:48
DummyInstPrinter::printRegName
void printRegName(raw_ostream &OS, unsigned RegNo) const override
Definition: TCETargetMachine.cc:100
llvm::TCEPassConfig::addPreRegAlloc
virtual void addPreRegAlloc()
Definition: TCETargetMachine.cc:261
llvm::TCEPassConfig::addPreISel
virtual bool addPreISel()
Definition: TCETargetMachine.cc:266
options
static MachInfoCmdLineOptions options
Definition: MachInfo.cc:46
llvm::TCETargetMachine::smallestImm_
int64_t smallestImm_
Definition: TCETargetMachine.hh:339
llvm::TCETargetMachinePlugin
Definition: TCETargetMachinePlugin.hh:109
llvm::TCETargetMachinePlugin::getDataLayout
virtual const DataLayout * getDataLayout() const
Definition: TCETargetMachinePlugin.hh:223
TTAMachine::Machine::registerFileNavigator
virtual RegisterFileNavigator registerFileNavigator() const
Definition: Machine.cc:450
X
static llvm::RegisterPass< InnerLoopFinder > X("find-innerloops-test", "Finds inner loops test.", false, true)
IGNORE_COMPILER_WARNING
#define IGNORE_COMPILER_WARNING(X)
Definition: CompilerWarnings.hh:51
llvm::TCEBaseTargetMachine
Definition: TCEStubTargetMachine.hh:82
llvm::TCETargetMachine::calculateSupportedImmediates
void calculateSupportedImmediates()
Definition: TCETargetMachine.cc:389
Model
Definition: Model.hh:50
llvm::TCETargetMachine::promotedOps_
std::set< std::pair< unsigned, llvm::MVT::SimpleValueType > > promotedOps_
Definition: TCETargetMachine.hh:334
ADFSerializer.hh
llvm::TCETargetMachinePlugin::getDefaultType
virtual MVT::SimpleValueType getDefaultType() const =0
llvm::TCETargetMachine::canEncodeAsMOVI
bool canEncodeAsMOVI(const llvm::MVT &vt, int64_t val) const
Definition: TCETargetMachine.cc:359
TCEStubTargetMachine.hh
llvm::TCEBaseTargetMachine::ttaMach_
const TTAMachine::Machine * ttaMach_
Definition: TCEStubTargetMachine.hh:92
TCEString
Definition: TCEString.hh:53
llvm::TCETargetMachinePlugin::hasMUL
virtual bool hasMUL() const =0
llvm::TCETargetMachine::createMachine
TTAMachine::Machine * createMachine()
Definition: TCETargetMachine.cc:305
POP_COMPILER_DIAGS
#define POP_COMPILER_DIAGS
Definition: CompilerWarnings.hh:68
TTAMachine::Machine::busNavigator
virtual BusNavigator busNavigator() const
Definition: Machine.cc:356
llvm::TCETargetMachinePlugin::hasSHR
virtual bool hasSHR() const =0
llvm::TCEPassConfig::addPreSched2
virtual void addPreSched2()
Definition: TCETargetMachine.cc:452
dummyInstrPrinterCtor
MCInstPrinter * dummyInstrPrinterCtor(const Triple &, unsigned, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
Definition: TCETargetMachine.cc:108
ADFSerializer::readMachine
TTAMachine::Machine * readMachine()
Definition: ADFSerializer.cc:275
llvm::TCETargetMachine
Definition: TCETargetMachine.hh:106
TTAMachine::Machine::Navigator::item
ComponentType * item(int index) const
XMLSerializer::setSourceString
void setSourceString(const std::string &source)
Definition: XMLSerializer.cc:128
MathTools.hh
DummyInstPrinter::applyTargetSpecificCLOption
bool applyTargetSpecificCLOption(StringRef Opt) override
Definition: TCETargetMachine.cc:87
llvm::TCETargetMachine::promotedOperations
const std::set< std::pair< unsigned, llvm::MVT::SimpleValueType > > * promotedOperations()
Definition: TCETargetMachine.cc:331
TTAMachine::Machine::instructionTemplateNavigator
virtual InstructionTemplateNavigator instructionTemplateNavigator() const
Definition: Machine.cc:428
llvm::TCETargetMachinePlugin::createISelPass
virtual FunctionPass * createISelPass(TCETargetMachine *tm)=0
llvm::TheTCELE64Target
Target TheTCELE64Target
Definition: TCEStubTargetMachine.cc:65
llvm::TCETargetMachine::SupportedFPImmWidth_
int SupportedFPImmWidth_
Definition: TCETargetMachine.hh:341
CompilerWarnings.hh
TTAMachine::Machine
Definition: Machine.hh:73
llvm::TCETargetMachine::largestImm_
uint64_t largestImm_
Definition: TCETargetMachine.hh:340
ImmInfo::registerImmediateLoadWidth
static int registerImmediateLoadWidth(const TTAMachine::RegisterFile &targetRF, bool allowSignExtension=false)
Definition: ImmInfo.cc:326