==================================================== POINTER DISAMBIGUATION VIA STRICT INEQUALITIES ==================================================== This virtual machine contains the code and execution scripts for the work presented in the article "Pointer Disambiguation via Strict Inequalities". In the desktop folder, you'll find ways of running our analysis on any source code you choose, or on the benchmarks used in this paper's evaluation. ==================================================== THE CODE ==================================================== The code from this work can be found inside LLVM's build directory inside the virtual machine. The LLVM source&build directory is at ~/llvm/, and the code for the analyses are in ~/llvm/lib/Transforms/. In total we used 4 passes in this paper. ~/llvm/lib/Transforms/sraa The main pointer alias analysis presented in this paper. ~/llvm/lib/Transforms/vSSA A pass that transforms the program to the e-SSA form, needed in order to use the Strict Relations Alias Analysis. ~/llvm/lib/Transforms/RangeAnalysis A symbolic Range Analysis also used in the Strict Relations Alias Analysis. ~/llvm/lib/Transforms/DepGraph A pass that builds the program dependence graph. This pass is used in one of our tests, to show the effectiveness of our new alias analysis when comparing the number of memory nodes yielded by the DepGraph when running it coupled with the Strict Relations Alias Analysis. We developed our work on LLVM 3.7 version. ==================================================== GETTING STARTED ==================================================== The artifact is provided as a Virtual Machine image. To use the artifact, you need to dowload and install the VirtualBox VM player at https://www.virtualbox.org/wiki/Downloads. After downloading and installing VirtualBox, to run the VM image do the following: -  Download and uncompress the VM image -  Open VirtualBox -  Create a new virtual machine, by clicking in "Machine"->"New..." -  Give a name to the new VM, by filling the "Name" field -  In "Type", select "Linux" -  In "Version", select "Ubuntu (64 bit)" -  Click "continue", select the desired amount of RAM memory, then click "continue" again -  In the hard drive selection screen, select the option "Use an existing virtual hard drive file", then select the .vdi file containing the VM image that you just downloaded -  Your Virtual Machine is ready to use! To start, simply double-click it in the VirtualBox VM list If the VM prompts for a username and password, you may use the following combination: LOGIN: cgoartifact PASSWORD: artifact ==================================================== RUNNING THE EXAMPLES ==================================================== Inside the folder ExecuteExamples you may find a scripts to compile any c code and run our analysis. If you wish to compile a code of your desire, you may use the script compile.sh and pass as first parameter the name of the program you wish to compile. For example, say you want to compile the program test.c: $ bash compile.sh test You may omit the file extension (.c) when passing the name of the program as a parameter. After the compilation, if you wish to run our Strict Relations Alias Analysis evaluation, you can run the script sraa.sh. The output will be the LLVM's default alias analysis evaluation, with a thorough list of alias information on the program. $ bash sraa.sh test If you wish to compare it with the LLVM's basic alias analysis alone, you can also run the script basicaa.sh on any program you wish. You may also use the script random.sh to generate a random C program with the tool Csmith: $ bash random.sh random The clean.sh script will remove all files created by the other scripts. ==================================================== RUNNING THE BENCHMARKS ==================================================== We executed 3 main evaluation tests in our paper: Precision, Scalability and Applicability. In the folder Benchmarks you'll find the scripts to run the benchmarks used in the paper. You'll find two folders: aaeval and memnodes. In the folder aaeval there's a script called run.sh that runs two of the 3 evaluation tests we ran in our paper, the tests of Precision and Scalability. Both tests are executed on the LLVM's test-suite and on the SpecCPU2006. The test of Precision evaluates how better our alias analysis is compared to the Basic Alias Analysis provided by LLVM. So it runs the basicaa, the sraa and both together on the entire test-suite. The test of Scalability evaluates the growth of the number of constraints generated during the Strict Relations Alias Analysis compared to the size of the programs being analyzed. The script run.sh will basically run the tests on the entire test-suite and copy the .csv files containing the statistics to the folder aaeval. At the end of the execution you may find the .csv files in the folder. Bear in mind that the tests may take a while (up to 4 hours), mainly because they are running on a virtual machine. In the folder memnodes you may find another script called run.sh that executes the third test in our paper, the test of Applicability. The test of Applicability runs a Dependence Graph pass that generates a PDG (Program Dependence Graph) and counts the number of memory nodes in it. Our aim is to show that our new alias analysis yields more memory nodes in these graphs, because it is more precise. We also run this test in the entire test-suite plus SPECCpu2006. In order to do improve our evaluation, we used the tool Csmith to generate 120 random C programs and then we ran the Dependence Graph coupled with our Strict Relations Alias Analysis in all of them. We showed that the PDG generated without our analysis has less memory nodes than the PDG generated with our alias analysis. The random generated C programs are in the folder SingleSource, inside the LLVM's test-suite root, so this test already evaluates the entire test-suite and the random generated programs as well. If you wish to use csmith to generate a random program, feel free to do it using the script random.sh in the folder ExecuteExamples. ==================================================== THE OUTPUT ==================================================== The output for our analysis is very simple. We use the aa-eval pass to compare, within the same function, all possible pairs of pointers and then we return how many comparisons issued a NoAlias, MayAlias or a MustAlias response. Regrding the Depencende Graph, we basically count the number of Memory Nodes yielded. The output for this analysis is formatted in CSV files. When you run the tests with the script run.sh, the CSV files will be copied to your working directory.