[LLVMdev] opt usage?

Chris Lattner sabre at nondot.org
Fri Oct 13 12:44:43 PDT 2006

On Fri, 13 Oct 2006, Lewis, Brian T wrote:
> I'm new to the LLVM, so please forgive what might be a silly question.

> I'd like to use the opt bytecode-to-bytecode optimizer, but when I try
> running it to do, for example, dead code elimination (-dce) or global
> common subexpression elimination (-gcse), nothing much seems to happen:
>            opt -gcse -dce -o bar-opt.bc bar.bc
>            llvm2cpp -o bar-opt.cpp bar-opt.bc
>            diff bar.bc bar-opt.bc

That should work.  Depending on where you got the .bc files from, it could 
be that there is no dead code or common subexpressions left...

Note that llvm-dis will give you much easier to read info about a .bc file 
than llvm2cpp.



More information about the llvm-dev mailing list