-
Notifications
You must be signed in to change notification settings - Fork 2
/
run.sh
executable file
·49 lines (36 loc) · 1.74 KB
/
run.sh
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
#!/bin/bash
LLVM_PATH="${1}/bin"
export CLANG="$LLVM_PATH/clang"
export CLANGFORM="$LLVM_PATH/clang-format"
export OPT="$LLVM_PATH/opt"
export LINKER="$LLVM_PATH/llvm-link"
export DIS="$LLVM_PATH/llvm-dis"
export SCOPEFIND="$LLVM_PATH/../lib/scope-finder.so"
export BUILD="${2}"
export PRA="$BUILD/PtrRangeAnalysis/libLLVMPtrRangeAnalysi-debug-only=print-tasks
-statss.so"
export AI="$BUILD/AliasInstrumentation/libLLVMAliasInstrumentation.so"
export DPLA="$BUILD/DepBasedParallelLoopAnalysis/libParallelLoopAnalysis.so"
export DLM="$BUILD/DivergentLoopMetadata/libDivergentLoopMetadata.so"
export CP="$BUILD/CanParallelize/libCanParallelize.so"
export PLM="$BUILD/ParallelLoopMetadata/libParallelLoopMetadata.so"
export WAI="$BUILD/ArrayInference/libLLVMArrayInference.so"
export CDA="$BUILD/ControlDivergenceAnalysis/libControlDivergenceAnalysis.so"
export ST="$BUILD/ScopeTree/libLLVMScopeTree.so"
export WTM="$BUILD/libLLVMTaskFinder.so"
export PTRA="$BUILD/PtrAccessType/libLLVMPtrAccessTypeAnalysis.so"
export XCL="-Xclang -load -Xclang"
export FLAGS="-mem2reg -tbaa -scoped-noalias -basicaa -functionattrs
-gvn -loop-rotate
-instcombine -licm"
export FLAGSAI="-mem2reg -loop-rotate"
rm result.bc result2.bc
$CLANGFORM -style="{BasedOnStyle: llvm, IndentWidth: 2}" -i "${3}"
$CLANG -Xclang -load -Xclang $SCOPEFIND -Xclang -add-plugin -Xclang
-find-scope -g -O0 -c -fsyntax-only "${3}"
$CLANG $OMP -g -S -emit-llvm "${3}" -o result.bc
$OPT -load $ST -instnamer -mem2reg -scopeTree result.bc
$OPT -load $PTRA -load $ST -load $WTM -load $WAI -instnamer -mem2reg
-loop-simplify -writeInFile -Run-Mode=true \
-RUNTIME_COST="${4}" -debug-only=print-tasks -stats -S result.bc -o result2.bc
$CLANGFORM -style="{BasedOnStyle: llvm, IndentWidth: 2}" -i ${3}