/LoopUnrollingProject

EECS 583 Final Project

Primary LanguageC++

Our project consist of three important steps. 

In the first step, we run our pass on benchmark programs 5 times for each loop-depth configuration. Implementation of our pass is "unroll.cpp" which can be found in mypass/lib/mypass/. The functions which are insterted for time measurement can be found in "mypass/measure.c". This data collection step can be done by running timer.sh under the benchmark folder after configuring LLVM and results will be found under "runs" folder.

After collecting initial data from the first experiment, we cleaned the data by using java programs under dataCleaning folder. Main.java is main program to merge all experiment results into mergedData.txt file and also mergedDataMultipleLine.txt file which are necessary for machine learning part. This "Main.java" can also be used for post processing to calculate accuracy and speed-up results from output of machine learning step. Note that some paths are hard-coded in this file.

For the machine learning, split_data.py can be run on mergedData.txt file and it will generate two files train_samples.csv and test_samples.csv. The unrolling_nn.py file requires that sklearn is installed on the computer before it can work. Put unrolling_nn.py in the same folder with  the train_samples.csv and test_samples.csv files to generate the following files clf_results.txt (Metrics for all models executed), DecisionTree.txt, kNN.txt, MLPClassifier.txt, Random-forest.txt, random.txt, most_freq.txt. All the files except clf_results.txt contain the loopID,  ground truth and prediction for each loop in the test set generated by the model.

All resulting files and charts can be found under results folder.