Machine intermediate representation

As a Computer Science and Engineering student, I have been assigned a project that entails the implementation of a Machine Intermediate Representation within the LLVM framework. I am eager to acquire the necessary knowledge and skills to successfully complete this project.

Hi,
IMO, you’ll have to be a bit more specific. The concept of the intermediate representation (IR) is to be not machine specific. If I understand, you want to write machine code from LLVM IR. Hence, I would recommend those tutorials. User Guides — LLVM 16.0.0git documentation. Else, you’ll find all the tutorials you may need to get started with LLVM in the same page.
Cheers,

You could use MLIR, which is part of the LLVM project, to define your own IR. MLIR calls it a dialect:

There is also already something called Machine Intermediate Representation in case that is any use Machine IR (MIR) Format Reference Manual — LLVM 16.0.0git documentation

1 Like

Actually What my project is : Convert the Intermediate Representation (IR) of LLVM to the Machine Intermediate Representation (MIR) of a target machine ARM-8.

There are two approaches that convert LLVM IR into MIR. The traditional solution is Selection DAG (SDAG). The modern one is GlobalIsel. The latter one is still in development.