-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
45 lines (38 loc) · 1.41 KB
/
README
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
=====================================
Dimentia: Static dimensional analysis
Sol Boucher and Goran Žužić
=====================================
Dependencies
============
You need the following Debian packages, or your distribution's equivalents:
- clang-3.7 (Tested with version 1:3.7-1-2 on stretch)
- llvm-3.7 (Tested with version 1:3.7-1-2 on stretch)
- liblapacke-dev (Tested with version 3.6.0-2 on stretch)
Building
========
First you need to build the tracevarsng and dimens LLVM analysis passes:
$ cd annotations/
$ make
The tracevarsng and dimens wrapper script in that same directory make it easier to run the passes: simply pass these scripts a .ll or .bc file.
Now try it out on some of our example programs:
$ cd tests/
$ make
$ ../annotations/dimens annot0.ll
<snip>
Found 2 dimensionless variables:
main::opnd
main::sum
Suggest inspecting the following source locations:
annot0.c:6:9
annot0.c:7:10
$ ../annotations/dimens annot1.ll
<snip>
Found 2 dimensionless variables:
main::opnd
sum
Suggest inspecting the following source locations:
annot1.c:7:9
annot1.c:8:10
Running on other programs is quite easy; just be sure to compile them with the clang options -S, --emit-llvm, and -g in order to generate .ll (LLVM intermediate) files.
We also running through opt with the -mem2reg option, which will speed up the analysis considerably.
Then run dimens on the output files as usual.