Monday, December 11, 2017

Learning LLVM compiler

Restarting my technical blogs. This time I will be posting on the LLVM compiler and its internals. I am not describing anything detail about the LLVM compiler infrastructure.
Please refer here LLVM

LLVM is a compiler. It takes your C/C++ programs and output code (binary) that can be executed on a target machine. Like any compiler it transform your program to an IR. Then optimizes the IR and generated assembly code from the optimized IR.

As a compiler developer the interest will be to understand the LLVM IR, optimizations done on IR and code generation from the IR. After code generation the IR in LLVM is called machine IR as it represents low level information of the machine you are targeting. Then optimizations on done on machine IR like register allocation and scheduling. Finally machine IR will be converted to assembly code, assembled linked and converted to binary ready for running.

I will try to cover and blog about

* LLVM IR
* Writing a Pass to process the IR
* Passes that optimize the IR
* Code generation and How to teach LLVM to generate Machine IR
* Optimization on Machine IR like scheduling, etc...







Tuesday, November 3, 2009

Visitor pattern

I am currently working in porting GCC to a VLIW architeture. Last week our tool's team director met each one of us in the GCC port team. I observed a behavioral pattern involved. I could imagine our director as a visitor who wants visit the entire team. He had to convey message to each one of us. The algorithm (message) for each one of us (elements) is different.

So our director started by asking the root node (Project manager) to accept his visit. He replied by visiting him. The project manager in-turn passed director message about visiting (accept) to the child nodes (each team member) in some order. Every member accepted his request and met him (double dispatch)one by one.


To know about visitor pattern http://en.wikipedia.org/wiki/Visitor_pattern

Sunday, November 1, 2009

My First Blog

I have been thinking for a long time on starting a blog. Last week, I had a discussion with my boss. During the discussion, he suggested me to blog what ever you want. It can be technical matters, the lessons I have learnt so far, about the process followed in our company etc.

Yes, I have decided now to start blogging my day to day experiences. It will be mostly related to my technical work . I also planned to put general subjects which are of interest to me. I think this is enough for the introduction.