Go to the documentation of this file.
37 #include <llvm/CodeGen/MachineFunction.h>
38 #include "tce_config.h"
39 #include <llvm/IR/Function.h>
40 #include <llvm/Support/CommandLine.h>
41 #include <llvm/Analysis/AliasAnalysis.h>
55 static cl::opt<std::string>
58 cl::desc(
"The TCE architecture definition file."),
59 cl::init(
""), cl::Hidden);
63 cl::desc(
"Disables use of LLVM Alias Analysis information."));
67 cl::desc(
"Equivalent to --dump-ddgs-dot --dump-ddgs-xml."));
71 cl::desc(
"Write out Data Dependence Graph of processed procedures in dot format."));
75 cl::desc(
"Write out Data Dependence Graph of processed procedures in XML format."));
80 MachineFunctionPass(ID), tceIRBuilder_(NULL), interPassData_(NULL) {
85 <<
"TCE: unable to load the ADF:" << std::endl
93 std::vector<std::string> args;
94 args.push_back(
"llc");
95 args.push_back(
"-O3");
97 args.push_back(
"--dump-ddgs-dot");
98 args.push_back(
"--dump-ddgs-xml");
100 args.push_back(
"--dump-ddgs-dot");
102 args.push_back(
"--dump-ddgs-xml");
105 args.push_back(
"--disable-llvmaa");
123 MF.getTarget().getSubtargetImpl(MF.getFunction())->getInstrInfo());
126 AAResultsWrapperPass* AARWPass =
127 getAnalysisIfAvailable<AAResultsWrapperPass>();
129 AA = &AARWPass->getAAResults();
145 <<
"TCE: you need to provide the ADF location via llc -adf switch!"
TTAMachine::Machine * tceMachine_
static cl::opt< bool > DumpDDG("dump-ddgs", cl::desc("Equivalent to --dump-ddgs-dot --dump-ddgs-xml."))
static cl::opt< std::string > ADFLocation("adf", cl::desc("The TCE architecture definition file."), cl::init(""), cl::Hidden)
static void setCmdLineOptions(CmdLineOptions *options_)
static std::ostream & logStream()
virtual bool doInitialization(Module &m)
static cl::opt< bool > DisableLLVMAA("disable-llvmaa", cl::desc("Disables use of LLVM Alias Analysis information."))
static void setLLVMTargetInstrInfo(const llvm::MCInstrInfo *tid)
std::string errorMessageStack(bool messagesOnly=false) const
FunctionPass * createTCESchedulerPass(const char *)
virtual bool runOnMachineFunction(MachineFunction &MF)
std::string errorMessage() const
void parse(char *argv[], int argc)
static MachInfoCmdLineOptions options
bool writeMachineFunction(MachineFunction &mf)
#define IGNORE_COMPILER_WARNING(X)
LLVMTCEIRBuilder * tceIRBuilder_
#define POP_COMPILER_DIAGS
static cl::opt< bool > DumpDDGDot("dump-ddgs-dot", cl::desc("Write out Data Dependence Graph of processed procedures in dot format."))
virtual bool doInitialization(Module &m)
static cl::opt< bool > DumpDDGXML("dump-ddgs-xml", cl::desc("Write out Data Dependence Graph of processed procedures in XML format."))
InterPassData * interPassData_
static Machine * loadFromADF(const std::string &adfFileName)