OpenASIP 2.2
Loading...
Searching...
No Matches
InnerLoopFinder.hh
Go to the documentation of this file.
1/**
2 * @file InnerLoopFinder.hh
3 *
4 * LLVM pass for finding loops that can be software pipelined by the TCE
5 * loop scheduler.
6 *
7 * @author Pekka Jääskeläinen
8 */
9#ifndef HH_INNER_LOOP_FINDER
10#define HH_INNER_LOOP_FINDER
11
12#include <sstream>
13#include <fstream>
14#include <string>
15#include <map>
16
17#include <llvm/IR/LegacyPassManager.h>
18#include <llvm/Analysis/LoopPass.h>
19#include <llvm/Support/CommandLine.h>
20
21#include "tce_config.h"
22#include <llvm/IR/Module.h>
23
24namespace llvm {
25 void initializeInnerLoopFinderPass(llvm::PassRegistry&);
26}
27
28struct InnerLoopFinder : public llvm::LoopPass {
29 static char ID;
30 typedef std::map<std::string, std::ostream*> DumpFileIndex;
31
33 public:
36 int tripCount() const { return tripCount_; }
37 bool isTripCountKnown() const { return tripCount_ > 0; }
38 private:
40 };
41
42 typedef std::map<const llvm::BasicBlock*, InnerLoopInfo> InnerLoopInfoIndex;
43
45 bool dump;
46
49
50 virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const;
51
52 std::ostream& out(llvm::Loop* l);
53
54 virtual std::string loopDescription(llvm::Loop* l);
55 virtual bool runOnLoop(llvm::Loop* l, llvm::LPPassManager &LPM);
56 unsigned getSmallConstantTripCount(llvm::Loop* loop);
57
59private:
61};
62
63#endif
void initializeInnerLoopFinderPass(llvm::PassRegistry &)
virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const
unsigned getSmallConstantTripCount(llvm::Loop *loop)
virtual std::string loopDescription(llvm::Loop *l)
InnerLoopInfoIndex innerLoopInfo()
DumpFileIndex dumpFiles
InnerLoopInfoIndex loopInfos_
std::map< const llvm::BasicBlock *, InnerLoopInfo > InnerLoopInfoIndex
std::ostream & out(llvm::Loop *l)
virtual bool runOnLoop(llvm::Loop *l, llvm::LPPassManager &LPM)
std::map< std::string, std::ostream * > DumpFileIndex