Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LLVM IR opcode documentation [closed]

I have read LLVM IR language reference and bitcode file format, but I haven't found any documentation containing an opcode list or explaining the instruction encoding.

Is there any place where it'd be possible to find this information, or searching the source code is necessary?

like image 976
user35443 Avatar asked May 20 '14 04:05

user35443


People also ask

What is LLVM IR code?

LLVM IR is a low-level intermediate representation used by the LLVM compiler framework. You can think of LLVM IR as a platform-independent assembly language with an infinite number of function local registers.

How does LLVM IR work?

A developer uses the API to generate instructions in a format called an intermediate representation, or IR. LLVM can then compile the IR into a standalone binary or perform a JIT (just-in-time) compilation on the code to run in the context of another program, such as an interpreter or runtime for the language.

Is LLVM an IR?

Since 2011, LLVM is a brand that applies to the LLVM umbrella project, encompassing the LLVM intermediate representation (IR), the LLVM debugger, the LLVM implementation of the C++ Standard Library (with full support of C++11 and C++14), etc.

Is LLVM IR portable?

So in that sense, it doesn't solve the aforementioned issues: The LLVM IR is not portable to platform with a different ABI. The only reason this is more portable is that the clients provide a layer which matches the PNaCl ABI to the actual ABI.


1 Answers

You'll have to look in the source code. Fortunately for you, it's all pretty neatly laid out in LLVMBitCodes.h.

Just keep in mind that the encoding does occasionally change, so be careful if you depend on it for anything (though I think things are only added to the enums, not removed or changed).

like image 200
Oak Avatar answered Nov 25 '22 14:11

Oak