-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpatch
executable file
·63 lines (49 loc) · 2.01 KB
/
patch
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
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
#StitchUp configuration script
#LEGUP_DIR needs to be set to the root directory of the LegUp tool
if [ "$#" -ne 1 ]; then
echo "Usage ./configure <LegUp Directory>"
exit 126
fi
#Get the home directory for the legup installation.
echo "LegUp is installed at $1";
LEGUP_HOME=$1
#For now I will just assume that the LegUp directory looks sane
#Checks should be implemented here in the future though
LLVM_DIR=$LEGUP_HOME/llvm
LLVM_LIB_DIR=$LLVM_DIR/lib/Transforms
PREFETCH_ANALYSIS_DIR=$LLVM_LIB_DIR/SliceUp
LOCAL_TRANSFORMS=./libs/Transforms
#LOCAL_TARGETS=./libs/Targets
LLVMSliceUp=$LOCAL_TRANSFORMS/LVMStitchUp
#STITCHUPBACKEND=$LOCAL_TARGETS/StitchUpBackend
#TARGET_DIR=$LLVM_DIR/lib/Target
#LLVMSTITCHUP_BACKEND=$TARGET_DIR/StitchUp
#Making the StitchUp LLVM library directory and creating a symbolic link to it
if [ ! -L $PREFETCH_ANALYSIS_DIR ]; then
cp -rs $(pwd)/$LOCAL_TRANSFORMS/LLVMSliceUp $PREFETCH_ANALYSIS_DIR
fi
CURR_DIR=$(pwd)
#Include StitchUp to the library makefile lists.
if grep -q "SliceUp" $LLVM_LIB_DIR/Makefile; then
echo "The SliceUp Library has already been included into the LLVM lib Makefile $LLVM_LIB_DIR/Makefile"
else
sed -i '/^PARALLEL_DIRS = .*/ s/$/ SliceUp/' $LLVM_LIB_DIR/Makefile
fi
echo "LLVM_DIR=$LLVM_DIR" > Makefile.config
echo "LLVM_LIB_DIR=$LLVM_LIB_DIR" >> Makefile.config
echo "STITCH_UP_DIR=$STITCH_UP_DIR" >>Makefile.config
echo "LEGUP_HOME=$LEGUP_HOME" >> Makefile.config
echo "CURRDIR=$(pwd)" > ./build
echo "(cd $PREFETCH_ANALYSIS_DIR; make)" >> ./build
chmod u+x build
#Attempting to build the SliceUp pass
(cd $PREFETCH_ANALYSIS_DIR; make; cd $CURR_DIR;)
echo "Reconfiguring the LLVM base"
(cd $LLVM_DIR; ./configure; cd $CURR_DIR;)
echo "Finished configuring the LLVM base"
(cd $LLVM_DIR; make; cd $CURR_DIR;)
#Edit the LegUp makefile so that the makefile argument STITCHUP=1 can be used to build the system with stitchup
cp config/Makefile.common $LEGUP_HOME/examples/
cp config/legup.tcl $LEGUP_HOME/examples/
#(cd $LLVM_DIR/tools/llc; make; cd $CURR_DIR; )