[LLVMdev] Bug in opt

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Mar 16 09:37:41 PDT 2011


On Mar 16, 2011, at 3:14 AM, Joe armstrong wrote:

> I have made a .s file, which can be correctly assembled
> and run with lli. But when I optimize it I get no errors
> from the optimizer, but the resultant file is incorrect.
> 
> Here's what happens:
> 
> llvm-as test2_gen.s   %% no errors test2_gen.s.bc is produced
> 
> lli test2_gen.s.bc
> n=887459712           %% no errors
> 
> opt -std-compile-opts -S test2_gen.s.bc > test2_opt.s.bc

We normally reserve the .s suffix for native assembly files and use .ll for LLVM IR assembly. The .bc suffix implies binary bitcode.

llvm-as: .ll -> .bc
llvm-dis: .bc -> .ll
llc: .ll/.bc -> .s

I don't think the tools require these suffixes, but it helps avoid confusion.

/jakob





More information about the llvm-dev mailing list