[LLVMdev] CFG using LLVM

Hersh.S. Iyer coolhersh at gmail.com
Sat Nov 14 07:02:13 PST 2009


Hi,

I am a new user of LLVM. I am using it as the IR for a compiler for a subset
of LUA.
I have the .ll file ready and it executes fine when passed to the llvm
interpreter.

Now, I wish to perform a few optimizations to the code starting with dead
code elimination.
For this I would need the CFG. I am very new to all of this stuff. Please
help me out guys.
The way I want to proceed is to start at the top of the CFG and then find
out the blocks
reachable from here. At the end, if any basic block remains unreachable,
then I would
classify it as dead code.

I read a few things about llvm passes and felt this could be made a pass.
Please let me
know what's the right and fastest way to do this.

Regards,
Hersh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091114/4b7ca78f/attachment.html>


More information about the llvm-dev mailing list