by moring · 6y ago · 0 comments
Why? Optimizing machine-independent code for a particular machine is part of the "core business" of LLVM, up to the point where a sufficiently capable bytecode/optimizer becomes comparable to LLVM.
OTOH, if the main argument here is the size/speed/other weight of LLVM, then of course the host machine that wants to run WASM only needs a tiny subet of LLVM: no frontend, single backend, only a subset of optimization passes... There is also a tradeoff to make to leave optimization passes out that actually improve the code a bit but are too heavy for the host machine.
Do you have an example in mind of a lower-level instruction set that can be efficiently translated to different real-world ISAs?
Performance comes only after those two. LLVM as far as I know, has a completely different order of priorities.