-
Notifications
You must be signed in to change notification settings - Fork 1
/
loopTreeTransform.hpp
51 lines (39 loc) · 1.65 KB
/
loopTreeTransform.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef loopTreeTransform_hpp
#define loopTreeTransform_hpp
#include <map>
#include "llvm/Pass.h"
#include "llvm/IR/Function.h"
#include "Utils.hpp"
#include "idxAnalysis.hpp"
#include "argAnalysis.hpp"
#include "gVarAnalysis.hpp"
#include "loopAnalysis.hpp"
#include "sampleNumAnalysis.hpp"
using namespace llvm;
namespace loopTreeTransform {
struct ParallelLoopTreeTransform : public FunctionPass {
static char ID;
ParallelLoopTreeTransform();
typedef loopAnalysis::LoopIndvBoundAnalysis::LoopRefTNode LoopRefTNode;
struct ThreadNode: public TreeNodeBase {
int threadNum;
};
/* LoopRefTree after the parallel transofrm */
loopAnalysis::LoopIndvBoundAnalysis::LoopRefTNode* PTLoopRefTree;
std::vector<loopAnalysis::LoopIndvBoundAnalysis::LoopRefTNode*>outMostLoops;
void findAllOutMostLoops(loopAnalysis::LoopIndvBoundAnalysis::LoopRefTNode* LoopRefTree);
void insertThreadNode(loopAnalysis::LoopIndvBoundAnalysis::LoopRefTNode* LoopRefTree);
void tranverseLoopRefTree(TreeNodeBase* node);
#if defined(UNIFORM_INTERLEAVING)
void UniformLoopTreeTransform(loopAnalysis::LoopIndvBoundAnalysis::LoopRefTNode* LoopRefTree);
#elif defined(RANDOM_INTERLEAVING)
void RandomLoopTreeTransform(loopAnalysis::LoopIndvBoundAnalysis::LoopRefTNode* LoopRefTree);
#else
void LoopTreeTransform(loopAnalysis::LoopIndvBoundAnalysis::LoopRefTNode* LoopRefTree);
#endif
void DumpLoopTree(TreeNodeBase* LTroot, string prefix);
bool runOnFunction(Function &F) override;
void getAnalysisUsage(AnalysisUsage &AU) const override;
};
}
#endif