2 ms·
This is a broad over-simplification of compiler engineering. LLVM IR is a very leaky abstraction, and there are plenty of optimization passes which make sense f
by Jasper_ 7y ago
This is a broad over-simplification of compiler engineering. LLVM IR is a very leaky abstraction, and there are plenty of optimization passes which make sense for one but not the other. Plenty of optimization passes can and do assume that the LLVM IR is "roughly clang-shaped".
- kibwen 7y agoThis is the reason that (last I checked) Rust (by default) runs LLVM optimization passes in the same order and quantity as Clang, and even seeks to have the frontend produce LLVM IR that resembles what Clang would produce. However, modulo LLVM bugs, the worst to be expected from a frontend selecting a different set or order of LLVM passes would be a loss of codegen quality, which may not be particularly crucial for non-C++-shaped languages.