forked from UplinkCoder/axtor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
95 lines (63 loc) · 3.15 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
--------------------------------------------------------------
AST - Extractor for LLVM
(axtor)
--------------------------------------------------------------
date : 17.09.12
author : Simon Moll
licence : GPL (read file "LICENSE")
##### Introduction #####
This is the source-code of the AST-extractor (axtor) for the Low-Level Virtual
Machine (LLVM). Axtor takes a generic LLVM-Bitcode module and generates
high-level control-flow structures for its functions.
For detailed information on the algorithm refer to the author's Bachelor thesis [1].
Information about the LLVM can be found on http://llvm.org/ .
##### Remarks #####
Has only been tested on Linux systems (Scientific Linux 6.1, Ubuntu). Although,
the OpenCL backend and core library should work out of the box on other OSes
as well.
##### Build Prerequisites #####
LLVM 3.1 (release)
##### Build Instructions #####
This project is realised as a LLVM subproject and can be build
according to the generic build instructions found on the LLVM website.
Follow the instructions below to run OpenCL applications with
the "loop" driver (found in tools/axtorOCLDriver).
##### Loop Driver Build Instructions (Linux only) #####
To get it all working, proceed as follows:
1.) Checkout the project (e.g. into LLVM's projects/ folder)
2.) Patch your Clang installation using the patches provided (folder patches/)
3.) Rebuild Clang
4.) Configure & build Axtor
To run an executable with the loop driver, do as follows:
1.) Make LLVM_PATH point to the LLVM binary directory
2.) Run the OpenCL application with
LD_PRELOAD=<Path/To/libaxtorOpenCLDriver.so> <OpenCLApplication>
##### Project structure #####
lib/axtor/ - AST-Extractor
The core library of Axtor. This contains all facilites for buildling
high-level control-flow structures from LLVM-bitcode. Along with it, come
header files for writing serialization backends.
lib/axtor_ocl/ - OpenCL backend for Axtor
The OpenCL backend based on the AST-extractor serialization interface. Also
includes a custom header for the Clang OpenCL Frontend.
lib/axtor_glsl/ - (unreleased) GLSL backend for Axtor
The GLSL backend based on Axtor. Not yet ported to LLVM-svn, but will
follow.
tools/extractor/
Tool for running axtor from the shell.
tools/oclang/ - OpenCL LLVM frontend
Passes command line arguments to clang with the OpenCL frontend enabled.
tools/axtorOCLDriver/ - driver for OpenCL kernel manipulation
OpenCL driver wrapper for source-to-source kernel transformations.
Loads OpenCL source-code into LLVM bitcode and serializes it back
for execution.
To be preloaded before an actual OpenCL implementation. This requires
both the extractor and oclang.
(read tools/axtorOCLDriver/README for details).
tools/axtorIntrinsicHeaders
Installs headers for using OCL/GLSL builtin functions with C++/C through Clang. After installations,
these headers can be found in the llvm/include directory "axtor_glsl/GLSL_Intrinsics.h"
"axtor_ocl/OpenCL_Intrinsics.h", respectively.
##### References #####
[1] Simon Moll, "Decompilation of LLVM IR", Bachelor Thesis
(http://www.cdl.uni-saarland.de/publications/theses/moll_bsc.pdf)