4 ms·
Why? Well, LLVM IR is pretty low level. Lattner and company learned when doing Swift that analyses and optimizations were more easily done with a higher level I
by CalChris 4y ago
Why? Well, LLVM IR is pretty low level. Lattner and company learned when doing Swift that analyses and optimizations were more easily done with a higher level IR. So they created the higher level Swift IR and analyzed and optimized in that higher level IR and then lowered to LLVM IR. Generalizing from that, they created MLIR as a toolkit for higher level IRs which can lower to LLVM IR and indeed even other targets.
However, Clang remained unchanged. So what Facebook is doing now is applying this IR refactoring that had been successful with Swift to Clang. The result, CIR, will allow a better structured, faster and more secure Clang front end [1].
This is not some magical nonsense and you're not going to get magical results. This is just solid engineering and is based on an already successful pattern.
[1] https://www.phoronix.com/scan.php?page=news_item&px=Meta-Developing-Clang-IR-CIR https://www.phoronix.com/scan.php?page=news_item&px=Meta-Dev...