Adding a new instruction to RISC-V backend in LLVM
A compiler is often referred to be a mysterious piece of software. It takes a
program written in a high-level language, applies dozens of transformations on
it, and then spits out optimized machine code. It sounds like black magic.
In this article, however, I would like to provide a counter argument by
implementing a new dummy instruction in LLVM, and hopefully demonstrate how
surprisingly straightforward it is if you know your way around.
Here is our plan: add a new instruction to the RISC-V ta...
Read more at blog.gustavoleite.me