Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
utpalbora committed May 28, 2020
0 parents commit e724bf5
Show file tree
Hide file tree
Showing 2,324 changed files with 894,822 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.out
*.s
*.ll
*.dot
out/
36 changes: 36 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
(C) 2019-2020 Utpal Bora
Department of Computer Science and Engineering, IIT Hyderabad

All rights reserved. Redistribution and use in source and binary forms, with
or without modification, are permitted provided that the following
conditions are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:

This product includes software developed by Utpal Bora, Pankaj Kukreja
Department of Computer Science and Engineering, IIT Hyderabad, India

4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.


THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
109 changes: 109 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# LLOV: A Fast Static Data-Race Checker for OpenMP Programs.

LLOV stands for LLVM OpenMP Verifier. It is a static data race detection
tools in LLVM for OpenMP Programs.
LLOV can detect data races in OpenMP v4.5 programs written in C/C++ and FORTRAN.

LLOV uses polyhedral compilation techniques to detect race conditions at
compile time.

Unlike other race detection tool, LLOV can mark a region of code as Data
Race Free.

## How to Run LLOV
#### Running LLOV on OpenMP C/C++ code from clang
```
./bin/clang -Xclang -disable-O0-optnone -Xclang -load -Xclang ./lib/OpenMPVerify.so \
-fopenmp -g tests/1.race1.c
./bin/clang++ -Xclang -disable-O0-optnone -Xclang -load -Xclang ./lib/OpenMPVerify.so \
-fopenmp -g test.cpp
```

#### Running LLOV on OpenMP C/C++ code from opt
```
./bin/clang -fopenmp -S -emit-llvm -g tests/1.race1.c -o test.ll
./bin/opt -mem2reg test.ll -S -o test.ssa.ll
./bin/opt -load ./lib/OpenMPVerify.so -openmp-forceinline \
-inline -openmp-resetbounds test.ssa.ll -S -o test.resetbounds.ll
./bin/opt -load ./lib/OpenMPVerify.so \
-disable-output \
-openmp-verify \
test.resetbounds.ll
```

#### Running LLOV on OpenMP FORTRAN code
```
flang -fopenmp -S -emit-llvm -g test.f95 -o test.ll
./bin/opt -O1 test.ll -S -o test.ssa.ll
./bin/opt -load ./lib/OpenMPVerify.so -openmp-forceinline \
-inline -openmp-resetbounds test.ssa.ll -S -o test.resetbounds.ll
./bin/opt -load ./lib/OpenMPVerify.so \
-disable-output \
-openmp-verify \
test.resetbounds.ll
```
For more FORTRAN examples with known race conditions, check out our
microbenchmark
[DataRaceBench FORTRAN](https://github.com/utpalbora/drb_fortran)

## Authors
Utpal Bora <[email protected]>.

## Credits
The following people contirbuted to LLOV in different ways.
Pankaj Kukreja &lt;[email protected]&gt;
Santanu Das &lt;[email protected]&gt;
Saurabh Joshi [website](https://sbjoshi.github.io)
Ramakrishna Upadrasta [website](https://www.iith.ac.in/~ramakrishna/)
Sanjay Rajopadhye [website](https://www.cs.colostate.edu/~svr/)

## Release
Source of LLOV will be released soon under BSD license.

## Docker container
Docker Registry: [hub.docker.com](https://hub.docker.com/r/utpalbora/llvm/tags)
repository: llvm
tag: llov

The docker image contians LLOV, along with the following race detection tools-
TSan-LLVM, Archer, SWORD, Helgrind, and Valgrind DRD.

There are three OpenMP benchmarks for experimentation-
[DataRaceBench v1.2](https://github.com/LLNL/dataracebench),
[DataRaceBench FORTRAN](https://github.com/utpalbora/drb_fortran), and
[OmpSCR v2.0](https://github.com/utpalbora/OmpSCR_v2.0).

## How to cite LLOV in a publication

```
@article{bora2019llov,
title={LLOV: A Fast Static Data-Race Checker for OpenMP Programs},
author={Bora, Utpal and Das, Santanu and Kureja, Pankaj and Joshi, Saurabh and Upadrasta, Ramakrishna and Rajopadhye, Sanjay},
journal={arXiv preprint arXiv:1912.12189},
year={2019}
}
```

## Current Limitations
Following are the limitations of the current version of LLOV.
* Does not support explicit synchronization in OpenMP. This might result
in FN cases for programs with dependences across SCoPs.
* Does not handle dynamic control flow.
* Does not support target offloading constructs.
* Does not support OpenMP tasks.
* Can not handle irregular accesses (a[b[i]]).
* Might produce FP for tiled and/or parallel code generated by
automatic code generation tools such as Pluto, Polly and PolyOPT.
* Might produce FP for OpenMP sections construct.
* Function calls within OpenMP constructs are handled only if the
function can be inlined.
* For some cases, source line number mapping in Polly is not preserved.
For those cases, race is flagged at the corresponding loop line number.

## Contact
If you have any query, please contact "Utpal Bora" &lt;[email protected]&gt;.
Please file a bug if you find the race checker is not working as required.

Regards,
Utpal

Binary file added bin/FileCheck
Binary file not shown.
Binary file added bin/bugpoint
Binary file not shown.
Binary file added bin/c-index-test
Binary file not shown.
1 change: 1 addition & 0 deletions bin/clang
1 change: 1 addition & 0 deletions bin/clang++
Loading

0 comments on commit e724bf5

Please sign in to comment.