source: parabix-LLVM/llvm_git/README.md @ 5672

Last change on this file since 5672 was 4314, checked in by linmengl, 5 years ago

Add setup instruction for building and testing Parabix-LLVM

File size: 3.2 KB
Line 
1Parabix LLVM
2===============================
3This project aims to provide a better support for LLVM IR vector operations. Usually,
4when a vector is not legal, like `v32i1`, LLVM will either "widen" or "promote element" this vector.
5We propose a third way here. An example would be good:
6
7```
8%add = add <32 x i1> %a, %b
9```
10
11It's equvalent of the following:
12```
13%add = xor i32 %a, %b
14```
15
16And we can achieve this through manipulating the selectionDAG.
17The full description of this project can be found [here](http://parabix.costar.sfu.ca/wiki/CompleteInteger).
18
19Build And Test The Modified LLVM
20================================
211. Clone this project:
22
23    svn co http://parabix.costar.sfu.ca/svn/parabix-LLVM
24
252. Prepare to build the modified LLVM, using cmake.
26
27    cd parabix-LLVM
28    mkdir llvm-build
29    cd llvm-build
30    cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_BUILD_TYPE=Debug ../llvm_git/
31
323. Make
33
34    make -j8
35
364. (Optional) Check the whole LLVM with its test suit
37
38    make check
39
405. Make the built executable available to use.
41
42    sudo ln -s YOUR-ABSOLUTE-PATH/parabix-LLVM/llvm_build/bin/llc /usr/bin/llc-svn
43    sudo ln -s YOUR-ABSOLUTE-PATH/parabix-LLVM/llvm_build/bin/opt /usr/bin/opt-svn
44    sudo ln -s YOUR-ABSOLUTE-PATH/parabix-LLVM/llvm_build/bin/lit /usr/bin/lit-svn
45    sudo ln -s YOUR-ABSOLUTE-PATH/parabix-LLVM/llvm_build/bin/llvm-link /usr/bin/llvm-link
46
47   (Optional) Check the static tests for Parabix:
48   (Static tests check the compiled assembly to see if the correct machine code is generated.)
49
50    cd parabix-LLVM/test/Parabix
51    lit-svn .
52
536. Install clang (if you don't have clang 3.4 or later)
54
55    sudo apt-get install clang-3.4
56
577. Install the Jinja2 python template. Jinja2 is used for testing.
58
59    easy_install Jinja2
60
618. Clone lib_ir. cd to some folder you prefer and then type:
62
63    svn co http://parabix.costar.sfu.ca/svn/trunk/
64
659. For quick setup, type the following commands. Refer to the README.md file in lib_ir root folder for more detail and instructions on compiling with AVX2.
66
67    cd trunk/lib_ir/build
68    cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_CXX_COMPILER=/usr/bin/clang++-3.4 -DCMAKE_C_COMPILER=/usr/bin/clang-3.4 ..
69
7010. (Optional) Enable auto-test for u8u16. If you skip this step, u8u16 cannot be tested. Back the svn root, and type
71
72    svn co http://parabix.costar.sfu.ca/svn/proto/
73    cd proto/u8u16
74    svn co http://u8u16.costar.sfu.ca/svn/QA
75    cd QA
76    python u8u16_testgen.py
77
7811. Check the IR library for Parabix and the modified LLVM:
79
80    cd trunk/lib_ir/build
81    make check
82
83Low Level Virtual Machine (LLVM)
84================================
85
86This directory and its subdirectories contain source code for the Low Level
87Virtual Machine, a toolkit for the construction of highly optimized compilers,
88optimizers, and runtime environments.
89
90LLVM is open source software. You may freely distribute it under the terms of
91the license agreement found in LICENSE.txt.
92
93Please see the documentation provided in docs/ for further
94assistance with LLVM, and in particular docs/GettingStarted.rst for getting
95started with LLVM and docs/README.txt for an overview of LLVM's
96documentation setup.
97
98If you're writing a package for LLVM, see docs/Packaging.rst for our
99suggestions.
Note: See TracBrowser for help on using the repository browser.