editing disabled
vivdesh
guest · Join · Help · Sign In · Wikispaces

Protected
Tasks Completed
Following is the list tasks which have been completed:
1. Learning LLVM IR language and LLVM tools
A study of LLVM IR as done to understand the syntax and constructs available in LLVM IR. We also studied and used the following LLVM tools,
llvm-gcc : This is a complete C compiler which uses LLVM tools. This tool was used with -emit-llvm option to generate LLVM IR. This gave an understanding of how source language constructs are mapped into LLVM IR.
llc : This tool converts LLVM IR to native assembly language. This tool helped us verify and understand how operations on vectors (e.g. %3 = fmul <4xdouble> %1, %2) in LLVM IR get converted to native vector instructions if available.
lli : This tool is LLVM IR interpreter, which is used for running and testing the LLVM byte code generated by our frond-end.

2. Building front-end for pseudo language
Code generation of front-end for pseudo language is completely done. Testing of this part is in progress, following is the test report,
moz-screenshot.pngmoz-screenshot-1.pngmoz-screenshot-2.pngmoz-screenshot-3.pngmoz-screenshot-4.pngmoz-screenshot-5.png
Functionality
Untested/Working/Not working
Comments
Variable Assignment
Working
-
Array Variable Assignment
Working
-
Arithmetic Expression Evaluation
Working
Arithmetic expressions are evaluated using abstract syntax tree, to reduce the number of unnamed variables used.
Logical expressions(=, <>, >, <, >=, <=)
Working

Comparison operations(AND ,OR)
Working

If..Then..Endif
Working

If..Then..Else...Endif
Working

While loop
Untested

Repeat...until loop
Untested

For loop
Untested

Write
Working
For write() calls we have used the printf() function provided in standard libraries like 'libc' which must be supplied to the compiler.
Read
Not Working
Similar to write(), read() used scanf() function provided in standard libraries.
Currently there is some problem with calling scanf().
Current and Future Tasks
Now that we have built a basic compiler for the pseudo language we can start with auto vectorization to identify and convert parallel operations into vector operations.
A project under development in LLVM called Polly makes use of polyhedral model to represent loop structures and perform transformation. This project does perform dependency analysis on loop statements. Specifying –lda flag to the optimizer creates the dependency related structures for the loops in the code.
So we have 2 options here, either we can use their dependence analysis and further perform auto-vectorization or we can implement dependence analysis and auto vectorization at the pseudo language level.
Option 1: Advantage is that dependence analysis is performed in a comprehensive way; we only need to use their analysis for vectorization. But this option has the disadvantage that we have to work at LLVM IR level which makes things more complicated.
Option 2: This has the advantage that we need to work with pseudo language level which is quite simple, but we have to implement dependence analysis all by ourselves.
Deciding on the right option is crucial and we have to choose between them in a day or two, before we can make any progress.

Work Distribution
The task were broken into subtasks and distributed as follows:
Kishor Kharbas
Vivek Deshpande
Studying and understanding LLVM IR, tools
Studying and understanding LLVM IR, tools
Implementing actions associated with rules in parser(except for loop)
Abstract syntax tree generation and evaluation.
Action associated with “for loop” of parser
Study of dependence analysis and vectorization theory
Study of dependence analysis and vectorization theory

Home
Loading...
Home Turn Off "Getting Started"
Loading...