OpenASIP  2.0
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
llvm::LLVMTCEScheduler Class Reference

#include <LLVMTCEScheduler.hh>

Inheritance diagram for llvm::LLVMTCEScheduler:
Inheritance graph
Collaboration diagram for llvm::LLVMTCEScheduler:
Collaboration graph

Public Member Functions

 LLVMTCEScheduler ()
 
virtual ~LLVMTCEScheduler ()
 
virtual bool runOnMachineFunction (MachineFunction &MF)
 

Static Public Attributes

static char ID = 0
 

Private Member Functions

virtual bool doInitialization (Module &m)
 

Private Attributes

TTAMachine::MachinetceMachine_
 
LLVMTCEIRBuildertceIRBuilder_
 
InterPassDatainterPassData_
 
llvm::Module * mod_
 

Detailed Description

Definition at line 47 of file LLVMTCEScheduler.hh.

Constructor & Destructor Documentation

◆ LLVMTCEScheduler()

llvm::LLVMTCEScheduler::LLVMTCEScheduler ( )

Definition at line 79 of file LLVMTCEScheduler.cc.

79  :
80  MachineFunctionPass(ID), tceIRBuilder_(NULL), interPassData_(NULL) {
81  try {
83  } catch (const Exception& e) {
85  << "TCE: unable to load the ADF:" << std::endl
86  << e.errorMessage() << std::endl;
87  }
88  // By default Application::cmdLineOptions returns NULL.
89  // If we want to pass dump-ddg options we need to create new one.
90  // Add also -O3 flag, otherwise the -O0 is used and Sequential Scheduler
91  // called.
93  std::vector<std::string> args;
94  args.push_back("llc");
95  args.push_back("-O3");
96  if (DumpDDG) {
97  args.push_back("--dump-ddgs-dot");
98  args.push_back("--dump-ddgs-xml");
99  } else if (DumpDDGDot) {
100  args.push_back("--dump-ddgs-dot");
101  } else if (DumpDDGXML) {
102  args.push_back("--dump-ddgs-xml");
103  }
104  if (DisableLLVMAA) {
105  args.push_back("--disable-llvmaa");
106  }
107  try {
108  options->parse(args);
110  } catch (const IllegalCommandLine& e) {
111  std::cerr << e.errorMessageStack() << std::endl;
112  }
113 }

References llvm::ADFLocation(), llvm::DisableLLVMAA(), llvm::DumpDDG(), llvm::DumpDDGDot(), llvm::DumpDDGXML(), Exception::errorMessage(), Exception::errorMessageStack(), TTAMachine::Machine::loadFromADF(), Application::logStream(), options, CmdLineOptions::parse(), Application::setCmdLineOptions(), and tceMachine_.

Here is the call graph for this function:

◆ ~LLVMTCEScheduler()

virtual llvm::LLVMTCEScheduler::~LLVMTCEScheduler ( )
inlinevirtual

Definition at line 51 of file LLVMTCEScheduler.hh.

51 {}

Member Function Documentation

◆ doInitialization()

bool llvm::LLVMTCEScheduler::doInitialization ( Module &  m)
privatevirtual

Definition at line 116 of file LLVMTCEScheduler.cc.

116  {
117  mod_ = &m;
118  return false;
119 }

References mod_.

◆ runOnMachineFunction()

bool llvm::LLVMTCEScheduler::runOnMachineFunction ( MachineFunction &  MF)
virtual

Definition at line 121 of file LLVMTCEScheduler.cc.

121  {
123  MF.getTarget().getSubtargetImpl(MF.getFunction())->getInstrInfo());
124 
125  AliasAnalysis* AA = nullptr;
126  AAResultsWrapperPass* AARWPass =
127  getAnalysisIfAvailable<AAResultsWrapperPass>();
128  if (AARWPass)
129  AA = &AARWPass->getAAResults();
130 
131  if (tceIRBuilder_ == NULL) {
133  tceIRBuilder_ = new LLVMTCEIRBuilder(
134  MF.getTarget(), tceMachine_, *interPassData_, AA, true, true);
136  }
138  return false;
139 }

References llvm::LLVMTCEIRBuilder::doInitialization(), interPassData_, mod_, OperationPool::setLLVMTargetInstrInfo(), tceIRBuilder_, tceMachine_, and llvm::LLVMTCEIRBuilder::writeMachineFunction().

Here is the call graph for this function:

Member Data Documentation

◆ ID

char llvm::LLVMTCEScheduler::ID = 0
static

Definition at line 49 of file LLVMTCEScheduler.hh.

◆ interPassData_

InterPassData* llvm::LLVMTCEScheduler::interPassData_
private

Definition at line 57 of file LLVMTCEScheduler.hh.

Referenced by runOnMachineFunction().

◆ mod_

llvm::Module* llvm::LLVMTCEScheduler::mod_
private

Definition at line 58 of file LLVMTCEScheduler.hh.

Referenced by doInitialization(), and runOnMachineFunction().

◆ tceIRBuilder_

LLVMTCEIRBuilder* llvm::LLVMTCEScheduler::tceIRBuilder_
private

Definition at line 56 of file LLVMTCEScheduler.hh.

Referenced by runOnMachineFunction().

◆ tceMachine_

TTAMachine::Machine* llvm::LLVMTCEScheduler::tceMachine_
private

Definition at line 55 of file LLVMTCEScheduler.hh.

Referenced by LLVMTCEScheduler(), and runOnMachineFunction().


The documentation for this class was generated from the following files:
llvm::LLVMTCEScheduler::mod_
llvm::Module * mod_
Definition: LLVMTCEScheduler.hh:58
llvm::LLVMTCEScheduler::tceMachine_
TTAMachine::Machine * tceMachine_
Definition: LLVMTCEScheduler.hh:55
llvm::DumpDDG
static cl::opt< bool > DumpDDG("dump-ddgs", cl::desc("Equivalent to --dump-ddgs-dot --dump-ddgs-xml."))
llvm::ADFLocation
static cl::opt< std::string > ADFLocation("adf", cl::desc("The TCE architecture definition file."), cl::init(""), cl::Hidden)
Application::setCmdLineOptions
static void setCmdLineOptions(CmdLineOptions *options_)
Definition: Application.cc:381
IllegalCommandLine
Definition: Exception.hh:438
Application::logStream
static std::ostream & logStream()
Definition: Application.cc:155
llvm::DisableLLVMAA
static cl::opt< bool > DisableLLVMAA("disable-llvmaa", cl::desc("Disables use of LLVM Alias Analysis information."))
OperationPool::setLLVMTargetInstrInfo
static void setLLVMTargetInstrInfo(const llvm::MCInstrInfo *tid)
Definition: OperationPool.cc:132
InterPassData
Definition: InterPassData.hh:48
Exception::errorMessageStack
std::string errorMessageStack(bool messagesOnly=false) const
Definition: Exception.cc:138
Exception
Definition: Exception.hh:54
LLVMTCECmdLineOptions
Definition: LLVMTCECmdLineOptions.hh:48
Exception::errorMessage
std::string errorMessage() const
Definition: Exception.cc:123
CmdLineOptions::parse
void parse(char *argv[], int argc)
Definition: CmdLineOptions.cc:107
options
static MachInfoCmdLineOptions options
Definition: MachInfo.cc:46
llvm::LLVMTCEIRBuilder::writeMachineFunction
bool writeMachineFunction(MachineFunction &mf)
Definition: LLVMTCEIRBuilder.cc:136
llvm::LLVMTCEScheduler::tceIRBuilder_
LLVMTCEIRBuilder * tceIRBuilder_
Definition: LLVMTCEScheduler.hh:56
llvm::DumpDDGDot
static cl::opt< bool > DumpDDGDot("dump-ddgs-dot", cl::desc("Write out Data Dependence Graph of processed procedures in dot format."))
llvm::LLVMTCEIRBuilder::doInitialization
virtual bool doInitialization(Module &m)
Definition: LLVMTCEIRBuilder.cc:1118
llvm::AliasAnalysis
AAResults AliasAnalysis
Definition: DataDependenceGraphBuilder.hh:45
llvm::LLVMTCEScheduler::ID
static char ID
Definition: LLVMTCEScheduler.hh:49
llvm::DumpDDGXML
static cl::opt< bool > DumpDDGXML("dump-ddgs-xml", cl::desc("Write out Data Dependence Graph of processed procedures in XML format."))
llvm::LLVMTCEScheduler::interPassData_
InterPassData * interPassData_
Definition: LLVMTCEScheduler.hh:57
TTAMachine::Machine::loadFromADF
static Machine * loadFromADF(const std::string &adfFileName)
Definition: Machine.cc:905