Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confusion about extension of LLVM IR file

Tags:

llvm

What is the actual extension of a LLVM IR file? Is is .ll or .s? Some sources say it is .ll while some points to .s.

like image 413
username_4567 Avatar asked Oct 18 '13 15:10

username_4567


1 Answers

The real answer is that it doesn't matter. The tools can accept any file you give them, they don't care about the name. The name is just a convention.

To answer more directly, the traditional extension is .ll (for LLVM, I presume). However, some toolchains want to treat LLVM IR the same as assembly files and hence prefer to use the .s extension. Myself, I prefer .ll because it clarifies the difference more clearly. Using LLVM tools like llc it's possible to transform LLVM IR to machine-specific assembly, and I like seeing the .ll -> .s transition in this case. Having LLVM IR in .s files would be confusing.

like image 134
Eli Bendersky Avatar answered Sep 28 '22 22:09

Eli Bendersky



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!